QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#601567 | #5279. New Time | huaxiamengjin# | WA | 0ms | 3776kb | C++14 | 385b | 2024-09-30 07:49:47 | 2024-09-30 07:49:47 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
char s1[10],s2[10];
int main(){
scanf("%s",s1+1);
scanf("%s",s2+1);
int fl=0,ans=0;
int w1=(s1[4]-'0')*10+s1[5]-'0';
int w2=(s2[4]-'0')*10+s2[5]-'0';
while(w1>w2)ans+=60-w1,w1=0,fl++;
int t1=(s1[1]-'0')*10+s1[2]-'0'+fl;
int t2=(s2[1]-'0')*10+s2[2]-'0';
while(t1>t2)ans=24-t1,t1=0;
cout<<t2-t1+ans+w2-w1<<"\n";
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3712kb
input:
11:57 12:00
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
09:09 21:21
output:
24
result:
ok 1 number(s): "24"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3696kb
input:
19:44 08:50
output:
19
result:
ok 1 number(s): "19"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
13:45 17:58
output:
17
result:
ok 1 number(s): "17"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3624kb
input:
02:57 21:05
output:
26
result:
ok 1 number(s): "26"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
18:15 22:59
output:
48
result:
ok 1 number(s): "48"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3680kb
input:
18:12 09:42
output:
45
result:
ok 1 number(s): "45"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3716kb
input:
00:00 00:00
output:
0
result:
ok 1 number(s): "0"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
00:00 23:59
output:
82
result:
ok 1 number(s): "82"
Test #10:
score: -100
Wrong Answer
time: 0ms
memory: 3620kb
input:
23:59 00:00
output:
0
result:
wrong answer 1st numbers differ - expected: '1', found: '0'