QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#790948 | #5279. New Time | sanm | WA | 0ms | 3836kb | C++20 | 563b | 2024-11-28 16:09:38 | 2024-11-28 16:09:38 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main(){
string s,t; cin>>s>>t;
int a=(s[0]-'0')*10+(s[1]-'0');
int b=(t[0]-'0')*10+(t[1]-'0');
int c=(s[3]-'0')*10+(s[4]-'0');
int d=(t[3]-'0')*10+(t[4]-'0');
int ans1,ans2;
if(a>b){
ans1=24-a+b;
}else{
ans1=b-a;
}
bool addt=false;
if(c>d){
addt=true;
ans2=60-c+d;
}else{
ans2=d-c;
}
if(addt){
cout<<ans1+ans2-1;
}else{
cout<<ans1+ans2;
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3568kb
input:
11:57 12:00
output:
3
result:
ok 1 number(s): "3"
Test #2:
score: 0
Accepted
time: 0ms
memory: 3500kb
input:
09:09 21:21
output:
24
result:
ok 1 number(s): "24"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
19:44 08:50
output:
19
result:
ok 1 number(s): "19"
Test #4:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
13:45 17:58
output:
17
result:
ok 1 number(s): "17"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3836kb
input:
02:57 21:05
output:
26
result:
ok 1 number(s): "26"
Test #6:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
18:15 22:59
output:
48
result:
ok 1 number(s): "48"
Test #7:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
18:12 09:42
output:
45
result:
ok 1 number(s): "45"
Test #8:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
00:00 00:00
output:
0
result:
ok 1 number(s): "0"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3796kb
input:
00:00 23:59
output:
82
result:
ok 1 number(s): "82"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3528kb
input:
23:59 00:00
output:
1
result:
ok 1 number(s): "1"
Test #11:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
23:59 23:59
output:
0
result:
ok 1 number(s): "0"
Test #12:
score: 0
Accepted
time: 0ms
memory: 3828kb
input:
18:55 18:55
output:
0
result:
ok 1 number(s): "0"
Test #13:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
18:54 18:55
output:
1
result:
ok 1 number(s): "1"
Test #14:
score: -100
Wrong Answer
time: 0ms
memory: 3596kb
input:
18:56 18:55
output:
58
result:
wrong answer 1st numbers differ - expected: '82', found: '58'