結果
問題 |
No.791 うし数列
|
ユーザー |
|
提出日時 | 2019-10-05 06:38:43 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 328 bytes |
コンパイル時間 | 553 ms |
コンパイル使用メモリ | 65,216 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-04 19:18:39 |
合計ジャッジ時間 | 1,371 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 8 WA * 7 |
ソースコード
#include <iostream> #include <string> using namespace std; int main() { string N; cin >> N; string ideal(N.size()-1, '3'); if(N.size() == 1) { cout << -1 << endl; } else { if(N[0] == 1 && N.substr(1) == ideal) { cout << ideal.size() << endl; } else { cout << -1 << endl; } } return 0; }