結果
問題 |
No.791 うし数列
|
ユーザー |
|
提出日時 | 2019-06-30 10:47:59 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 277 bytes |
コンパイル時間 | 514 ms |
コンパイル使用メモリ | 55,260 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 18:22:06 |
合計ジャッジ時間 | 1,055 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 15 |
ソースコード
#include <iostream> #include <string> using namespace std; int main(){ string S; int x=1; cin>>S; if(S[0]=='1'){ while((x!=0)&&(x<S.length())){ if(S[x]!='3'){ x=0; }else{ x++; } } }else{ x=0; } if(S=="1"){ x=0; } cout<<--x<<endl; return 0; }