結果
| 問題 |
No.791 うし数列
|
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2019-11-26 22:42:43 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 410 bytes |
| コンパイル時間 | 564 ms |
| コンパイル使用メモリ | 70,520 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 00:59:27 |
| 合計ジャッジ時間 | 1,229 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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 && n > 2 ) ans = n-1;
if ( ans == 0 ) ans = -1;
cout << ans << endl;
return 0;
}
Konton7