結果
| 問題 |
No.791 うし数列
|
| コンテスト | |
| ユーザー |
YDK1727
|
| 提出日時 | 2019-03-03 12:10:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 828 bytes |
| コンパイル時間 | 1,551 ms |
| コンパイル使用メモリ | 168,740 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-23 13:10:14 |
| 合計ジャッジ時間 | 2,249 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 1 |
ソースコード
#include "bits/stdc++.h"
#define LF '\n'
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF = 0x3f3f3f3f;
template<class Itr>void dump(Itr begin, Itr end) {
for(;begin != end; ++begin) clog << ' ' << *begin;
clog << LF;
}
signed main()
{
string s; cin >> s;
if (s[0] != '1' || !all_of(s.begin()+1, s.end(), [](const auto &c){
return c == '3'; })
) {
cout << -1 << endl;
} else {
cout << s.length() - 1 << endl;
}
return 0;
}
YDK1727