結果
| 問題 | No.791 うし数列 |
| コンテスト | |
| ユーザー |
himo
|
| 提出日時 | 2019-09-17 17:54:50 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 369 bytes |
| 記録 | |
| コンパイル時間 | 1,133 ms |
| コンパイル使用メモリ | 175,364 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-29 03:47:43 |
| 合計ジャッジ時間 | 1,929 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 13 WA * 2 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main(){
string n;
cin >>n;
bool che =false;
int ans =0;
for(int i=0;i<n.size();i++){
if(che){
if(n.at(i)=='3')ans++;
else{
che =false;
break;
}
}
if(n.at(i)=='1')che=true;
}
if(che==true){
cout << ans <<endl;
}
else{
cout <<-1<<endl;
}
}
himo