Submission #68604


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
string s;
bool flag=true;
cin>>s;
for(int i=0;i<s.size()-1;i++){
if(s[i]=='1'&&s[i+1]=='1'){
if((i+2)-(i+1)<=1){
flag=false;
break;
}
}
}
if(flag) cout<<"safe"<<"\n";
else cout<<"unsafe"<<"\n";
return(0);
}

ステータス

項目 データ
問題 1259 - Do not stick!
ユーザー名 ei2122
投稿日時 2021-09-29 16:16:49
言語 C++11
状態 Accepted
得点 100
ソースコード長 447 Byte
最大実行時間 88 ms
最大メモリ使用量 724 KB

セット

セット 得点 Cases
1 ALL 100 / 100 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.txt AC 32 ms 604 KB
1
in02.txt AC 88 ms 688 KB
1
in03.txt AC 24 ms 644 KB
1
in04.txt AC 22 ms 600 KB
1
in05.txt AC 32 ms 556 KB
1
in06.txt AC 23 ms 644 KB
1
in07.txt AC 22 ms 604 KB
1
in08.txt AC 46 ms 692 KB
1
in09.txt AC 19 ms 652 KB
1
in10.txt AC 21 ms 608 KB
1
sample01.txt AC 22 ms 692 KB
1
sample02.txt AC 19 ms 644 KB
1
sample03.txt AC 21 ms 724 KB
1
sample04.txt AC 21 ms 680 KB
1