結果
| 問題 | No.791 うし数列 |
| コンテスト | |
| ユーザー |
kyuna
|
| 提出日時 | 2019-07-17 22:58:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 351 bytes |
| 記録 | |
| コンパイル時間 | 774 ms |
| コンパイル使用メモリ | 70,920 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-23 13:10:08 |
| 合計ジャッジ時間 | 1,437 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 1 |
ソースコード
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
int main() {
string S; cin >> S;
bool ok = S[0] == '1';
int n = S.length();
int cnt3 = count(S.begin() + 1, S.end(), '3');
ok &= cnt3 == n - 1;
if (ok) {
cout << cnt3 << endl;
} else {
cout << -1 << endl;
}
return 0;
}
kyuna