結果
| 問題 |
No.104 国道
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-03-15 17:53:32 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 414 bytes |
| コンパイル時間 | 189 ms |
| コンパイル使用メモリ | 22,528 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-17 20:03:00 |
| 合計ジャッジ時間 | 966 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%s",S);
| ~~~~~^~~~~~~~
ソースコード
#include <stdio.h>
int main(){
//iuput
char S[30+1];
scanf("%s",S);
//search load
int cLoad = 1;
for (int i = 0;i < 30+1;i++){
if (S[i] != '\0'){
if (S[i] == 'L'){
cLoad = 2*cLoad;
}else{
cLoad = 2*cLoad+1;
}
}else{
break;
}
}
//ouput
printf("%d\n",cLoad);
return 0;
}