QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#728221#5279. New Timesamandarhacker1WA 0ms3836kbC++14596b2024-11-09 14:48:172024-11-09 14:48:17

Judging History

你现在查看的是最新测评结果

  • [2024-11-09 14:48:17]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3836kb
  • [2024-11-09 14:48:17]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    string s, t;
    cin >> s >> t;
    int h1 = (s[0] - '0') * 10 + s[1] - '0',
    h2 = (t[0] - '0') * 10 + t[1] - '0';
    int m1 = (s[3] - '0') * 10 + s[4] - '0',
    m2 = (t[3] - '0') * 10 + t[4] - '0';
    int cnt = 0;
    if(h1 <= h2){
        cnt += h2 - h1;
    }else{
        cnt += 24 - h1 + h2;
    }
    if(m1 > m2){
        cnt--; 
        cnt += 60 - m1 + m2;
    }else{
        cnt += m2 - m1;
    }
    cout << cnt;
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3640kb

input:

11:57
12:00

output:

3

result:

ok 1 number(s): "3"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

09:09
21:21

output:

24

result:

ok 1 number(s): "24"

Test #3:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

19:44
08:50

output:

19

result:

ok 1 number(s): "19"

Test #4:

score: 0
Accepted
time: 0ms
memory: 3768kb

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: 3548kb

input:

18:15
22:59

output:

48

result:

ok 1 number(s): "48"

Test #7:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

18:12
09:42

output:

45

result:

ok 1 number(s): "45"

Test #8:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

00:00
00:00

output:

0

result:

ok 1 number(s): "0"

Test #9:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

00:00
23:59

output:

82

result:

ok 1 number(s): "82"

Test #10:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

23:59
00:00

output:

1

result:

ok 1 number(s): "1"

Test #11:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

23:59
23:59

output:

0

result:

ok 1 number(s): "0"

Test #12:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

18:55
18:55

output:

0

result:

ok 1 number(s): "0"

Test #13:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

18:54
18:55

output:

1

result:

ok 1 number(s): "1"

Test #14:

score: -100
Wrong Answer
time: 0ms
memory: 3584kb

input:

18:56
18:55

output:

58

result:

wrong answer 1st numbers differ - expected: '82', found: '58'