結果
| 問題 |
No.791 うし数列
|
| コンテスト | |
| ユーザー |
E. Gordon
|
| 提出日時 | 2019-03-30 01:21:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 378 bytes |
| コンパイル時間 | 769 ms |
| コンパイル使用メモリ | 55,216 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-07 01:37:34 |
| 合計ジャッジ時間 | 1,191 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 1 |
ソースコード
#include <iostream>
using namespace std;
int main()
{
char n[102] = {0};
cin >> n;
if(n[0] != '1'){
cout << -1 << endl;
return 0;
}
int ans = 0, i = 1;
while(n[i] != 0){
if(n[i] == '3') ++ans;
else{
cout << -1 << endl;
return 0;
}
++i;
}
cout << ans << endl;
return 0;
}
E. Gordon