QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#823785 | #9829. False Alarm | 0x3f# | WA | 0ms | 3584kb | C++14 | 448b | 2024-12-21 09:41:06 | 2024-12-21 09:41:07 |
Judging History
answer
#include <iostream>
#include <algorithm>
using namespace std;
const int N=30;
int n,t[N];
char s[N];
int main(){
ios::sync_with_stdio(0),cin.tie(0);
cin>>n;
for (int i=1;i<=n;i++){
cin>>s+1;
t[i]=(s[1]-'0')*60+(s[3]-'0')*10+s[4]-'0';
}
sort(t+1,t+n+1);
for (int i=1;i<=n-2;i++)
if (t[i+2]-t[i]<10) cout<<"0",exit(0);
for (int i=1;i<=n-1;i++)
if (t[i+1]-t[i]<10) cout<<"1",exit(0);
cout<<2;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3584kb
input:
5 7:47 7:56 7:59 8:05 8:13
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3576kb
input:
7 8:00 8:10 8:20 8:30 8:40 8:50 9:00
output:
2
result:
wrong answer 1st numbers differ - expected: '1', found: '2'