結果
| 問題 | No.104 国道 |
| コンテスト | |
| ユーザー |
sk3388607083
|
| 提出日時 | 2018-06-21 19:33:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 343 bytes |
| 記録 | |
| コンパイル時間 | 134 ms |
| コンパイル使用メモリ | 22,656 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-30 17:39:12 |
| 合計ジャッジ時間 | 3,084 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 RE * 3 |
| other | AC * 3 RE * 13 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:12:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
12 | scanf("%s", S);
| ~~~~~^~~~~~~~~
ソースコード
#include<stdio.h>
int beki2(int n){
int i, re = 1;
for(i = 0; i < n; i++) re *= 2;
return re;
}
int main(void){
int i, n = 0;
char S[30];
int sum;
scanf("%s", S);
while(S[n] != '\0') n++;
sum = beki2(n);
for(i = 0; S[i] != '\n'; i++){
if(S[i] == 'R') sum += beki2(n - 1 - i);
}
printf("%d\n", sum);
return 0;
}
sk3388607083