結果
| 問題 |
No.113 宝探し
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-08-03 09:45:48 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 429 bytes |
| コンパイル時間 | 1,227 ms |
| コンパイル使用メモリ | 157,744 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-11 20:20:29 |
| 合計ジャッジ時間 | 2,427 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 4 |
| other | AC * 4 WA * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main(int, char**)’:
main.cpp:11:8: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%s",a);
| ~~~~~^~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv)
{
int counter = 1; //カウンタ
int i; //ループカウンタ
char a[1000]; //文字列
scanf("%s",a);
for(i = 0;i < strlen(a);i++)
{
if('L' == a[i])
{
counter = counter * 2;
}
else if('R' == a[i])
{
counter = (counter * 2) + 1;
}
}
printf("%d\n",counter);
return 0;
}