QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#189648 | #2869. Anno Domini 2022 | Beevo# | AC ✓ | 1ms | 3564kb | C++20 | 801b | 2023-09-27 19:06:09 | 2023-09-27 19:06:09 |
Judging History
answer
#include <bits/stdc++.h>
#define el '\n'
#define Beevo ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef long long ll;
typedef long double ld;
using namespace std;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void testCase() {
string a, b, c, d;
cin >> a >> b >> c >> d;
if (isdigit(a[0]) && isdigit(d[0]))
cout << stoi(a) + stoi(d) - 1;
else if (isdigit(a[0]) && isdigit(c[0]))
cout << max(stoi(a), stoi(c)) - min(stoi(a), stoi(c));
else if (isdigit(b[0]) && isdigit(d[0]))
cout << max(stoi(b), stoi(d)) - min(stoi(b), stoi(d));
else
cout << stoi(b) + stoi(c) - 1;
}
signed main() {
Beevo
int t = 1;
// cin >> t;
while (t--)
testCase();
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3456kb
input:
1 BC AD 1
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
AD 1 AD 2001
output:
2000
result:
ok single line: '2000'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
AD 2022 5508 BC
output:
7529
result:
ok single line: '7529'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3488kb
input:
1 BC 1 BC
output:
0
result:
ok single line: '0'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
1 BC 2 BC
output:
1
result:
ok single line: '1'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
1 BC AD 2
output:
2
result:
ok single line: '2'
Test #7:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
2 BC 1 BC
output:
1
result:
ok single line: '1'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
2 BC 2 BC
output:
0
result:
ok single line: '0'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
2 BC AD 1
output:
2
result:
ok single line: '2'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
2 BC AD 2
output:
3
result:
ok single line: '3'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
AD 1 1 BC
output:
1
result:
ok single line: '1'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
AD 1 2 BC
output:
2
result:
ok single line: '2'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3508kb
input:
AD 1 AD 1
output:
0
result:
ok single line: '0'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
AD 1 AD 2
output:
1
result:
ok single line: '1'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
AD 2 1 BC
output:
2
result:
ok single line: '2'
Test #16:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
AD 2 2 BC
output:
3
result:
ok single line: '3'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3460kb
input:
AD 2 AD 1
output:
1
result:
ok single line: '1'
Test #18:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
AD 2 AD 2
output:
0
result:
ok single line: '0'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
1 BC 9999 BC
output:
9998
result:
ok single line: '9998'
Test #20:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
1 BC AD 9999
output:
9999
result:
ok single line: '9999'
Test #21:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
AD 1 9999 BC
output:
9999
result:
ok single line: '9999'
Test #22:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
AD 1 AD 9999
output:
9998
result:
ok single line: '9998'
Test #23:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
9999 BC 1 BC
output:
9998
result:
ok single line: '9998'
Test #24:
score: 0
Accepted
time: 0ms
memory: 3564kb
input:
9999 BC AD 1
output:
9999
result:
ok single line: '9999'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
9999 BC 9999 BC
output:
0
result:
ok single line: '0'
Test #26:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
9999 BC AD 9999
output:
19997
result:
ok single line: '19997'
Test #27:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
AD 9999 1 BC
output:
9999
result:
ok single line: '9999'
Test #28:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
AD 9999 AD 1
output:
9998
result:
ok single line: '9998'
Test #29:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
AD 9999 9999 BC
output:
19997
result:
ok single line: '19997'
Test #30:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
AD 9999 AD 9999
output:
0
result:
ok single line: '0'
Test #31:
score: 0
Accepted
time: 1ms
memory: 3432kb
input:
AD 1 5 BC
output:
5
result:
ok single line: '5'
Test #32:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
AD 1 AD 60
output:
59
result:
ok single line: '59'
Test #33:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
AD 1 701 BC
output:
701
result:
ok single line: '701'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
AD 1 AD 8001
output:
8000
result:
ok single line: '8000'
Test #35:
score: 0
Accepted
time: 1ms
memory: 3500kb
input:
20 BC 5 BC
output:
15
result:
ok single line: '15'
Test #36:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
20 BC AD 60
output:
79
result:
ok single line: '79'
Test #37:
score: 0
Accepted
time: 1ms
memory: 3528kb
input:
20 BC 701 BC
output:
681
result:
ok single line: '681'
Test #38:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
20 BC AD 8001
output:
8020
result:
ok single line: '8020'
Test #39:
score: 0
Accepted
time: 0ms
memory: 3524kb
input:
AD 301 5 BC
output:
305
result:
ok single line: '305'
Test #40:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
AD 301 AD 60
output:
241
result:
ok single line: '241'
Test #41:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
AD 301 701 BC
output:
1001
result:
ok single line: '1001'
Test #42:
score: 0
Accepted
time: 1ms
memory: 3556kb
input:
AD 301 AD 8001
output:
7700
result:
ok single line: '7700'
Test #43:
score: 0
Accepted
time: 1ms
memory: 3524kb
input:
4001 BC 5 BC
output:
3996
result:
ok single line: '3996'
Test #44:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
4001 BC AD 60
output:
4060
result:
ok single line: '4060'
Test #45:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
4001 BC 701 BC
output:
3300
result:
ok single line: '3300'
Test #46:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
4001 BC AD 8001
output:
12001
result:
ok single line: '12001'
Test #47:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
AD 8176 5990 BC
output:
14165
result:
ok single line: '14165'
Test #48:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
6280 BC AD 3823
output:
10102
result:
ok single line: '10102'
Test #49:
score: 0
Accepted
time: 1ms
memory: 3436kb
input:
AD 6284 AD 8116
output:
1832
result:
ok single line: '1832'
Test #50:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
7706 BC 6637 BC
output:
1069
result:
ok single line: '1069'
Test #51:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
1944 BC 6856 BC
output:
4912
result:
ok single line: '4912'
Test #52:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
AD 3124 AD 3215
output:
91
result:
ok single line: '91'
Test #53:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
5502 BC AD 6301
output:
11802
result:
ok single line: '11802'
Test #54:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
597 BC 5108 BC
output:
4511
result:
ok single line: '4511'
Test #55:
score: 0
Accepted
time: 1ms
memory: 3504kb
input:
5809 BC 5560 BC
output:
249
result:
ok single line: '249'
Test #56:
score: 0
Accepted
time: 1ms
memory: 3548kb
input:
7133 BC AD 8788
output:
15920
result:
ok single line: '15920'
Test #57:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
8341 BC 114 BC
output:
8227
result:
ok single line: '8227'
Test #58:
score: 0
Accepted
time: 1ms
memory: 3496kb
input:
AD 7616 AD 2145
output:
5471
result:
ok single line: '5471'
Test #59:
score: 0
Accepted
time: 0ms
memory: 3440kb
input:
AD 323 6573 BC
output:
6895
result:
ok single line: '6895'
Test #60:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
AD 4972 AD 4711
output:
261
result:
ok single line: '261'
Test #61:
score: 0
Accepted
time: 1ms
memory: 3508kb
input:
AD 2296 4913 BC
output:
7208
result:
ok single line: '7208'
Test #62:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
AD 2479 5935 BC
output:
8413
result:
ok single line: '8413'
Test #63:
score: 0
Accepted
time: 0ms
memory: 3560kb
input:
3418 BC AD 7324
output:
10741
result:
ok single line: '10741'
Test #64:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
2563 BC 4362 BC
output:
1799
result:
ok single line: '1799'
Test #65:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
7274 BC 7994 BC
output:
720
result:
ok single line: '720'
Test #66:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
8867 BC AD 6424
output:
15290
result:
ok single line: '15290'
Test #67:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
AD 577 199 BC
output:
775
result:
ok single line: '775'
Test #68:
score: 0
Accepted
time: 0ms
memory: 3456kb
input:
AD 4828 469 BC
output:
5296
result:
ok single line: '5296'
Test #69:
score: 0
Accepted
time: 0ms
memory: 3444kb
input:
AD 6161 9199 BC
output:
15359
result:
ok single line: '15359'
Test #70:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
AD 6807 6676 BC
output:
13482
result:
ok single line: '13482'
Test #71:
score: 0
Accepted
time: 0ms
memory: 3496kb
input:
1325 BC AD 3158
output:
4482
result:
ok single line: '4482'
Test #72:
score: 0
Accepted
time: 0ms
memory: 3452kb
input:
AD 168 AD 1810
output:
1642
result:
ok single line: '1642'
Test #73:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
43 BC AD 3854
output:
3896
result:
ok single line: '3896'
Test #74:
score: 0
Accepted
time: 1ms
memory: 3460kb
input:
AD 9591 AD 8611
output:
980
result:
ok single line: '980'
Test #75:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
AD 9945 AD 9604
output:
341
result:
ok single line: '341'
Test #76:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
AD 5309 8072 BC
output:
13380
result:
ok single line: '13380'