結果
問題 |
No.791 うし数列
|
ユーザー |
👑 |
提出日時 | 2019-03-19 22:24:02 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 563 bytes |
コンパイル時間 | 574 ms |
コンパイル使用メモリ | 59,868 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-14 09:37:03 |
合計ジャッジ時間 | 1,442 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 1 |
ソースコード
#include <iostream> #include <cstdlib> #include <vector> #include <algorithm> int main() { std::string s; std::cin >> s; int cnt = -1; for(auto i = s.begin(); i != s.end(); i++){ char c = *i; if(cnt == -1){ if(c != '1'){ std::cout << -1 << std::endl; return 0; } } else { if(c != '3'){ std::cout << -1 << std::endl; return 0; } } cnt++; } std::cout << cnt << std::endl; return 0; }