結果
問題 |
No.791 うし数列
|
ユーザー |
![]() |
提出日時 | 2019-11-26 22:35:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 372 bytes |
コンパイル時間 | 673 ms |
コンパイル使用メモリ | 70,144 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 00:59:10 |
合計ジャッジ時間 | 1,393 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 1 |
ソースコード
#include <iostream> #include <algorithm> #include <math.h> using namespace std; int main(){ string s; cin >> s; int n = s.size(); int ans = 0; for ( int i = 0; i < n; i ++ ) { if ( i == 0 && s[i] != '1' ) ans = -1; else if ( i > 0 && s[i] != '3' ) ans = -1; } if ( ans != -1 ) ans = n-1; cout << ans << endl; return 0; }