Submission #75057


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <bits/stdc++.h>
#define rep(i, x, n) for (int i = (x); i < (n); i++)
#define reps(i, x, n) for (int i = (x); i <= (n); i++)
#define lol long long
#define SUM(n) ((n) + 1) * (n) / 2 // 1〜nまでの総和を求める式
#define SYOU(x) fixed << setprecision(x + 1) //小数点桁数を指定する
#define abs(x, y) max(x, y) - min(x, y)
#define all(v) v.begin(), v.end()
#define UPDigit(a, b) (a + b - 1) / b //小数点切り上げ
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const int mod = int(998244353);
const int MOD = int(1e9 + 7);
using namespace std;
signed main(void)
{
cin.tie(nullptr);
ios_base::sync_with_stdio(false);
int y1, y2, y3, m1, m2, m3, d1, d2, d3;
cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2 >> y3 >> m3 >> d3;
int age1, age2;
age1 = y3 - y1;
if(m3 * 100 + d3 < m1 * 100 + d1){
age1 --;
}
age2 = y3 - y2;
if(m3 * 100 + d3 < m2 * 100 + d2){
age2 --;
}
cout << abs(age1, age2) << '\n';
return 0;
}

ステータス

項目 データ
問題 1514 - Age Difference
ユーザー名 NASSUN_ei1906
投稿日時 2023-08-05 16:01:11
言語 C++17
状態 Accepted
得点 100
ソースコード長 1057 Byte
最大実行時間 35 ms
最大メモリ使用量 788 KB

セット

セット 得点 Cases
1 ALL 100 / 100 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
hand_made01.txt AC 35 ms 604 KB
1
hand_made02.txt AC 22 ms 564 KB
1
hand_made03.txt AC 16 ms 648 KB
1
hand_made04.txt AC 18 ms 604 KB
1
hand_made05.txt AC 18 ms 560 KB
1
in01.txt AC 25 ms 512 KB
1
in02.txt AC 15 ms 596 KB
1
in03.txt AC 17 ms 548 KB
1
in04.txt AC 16 ms 628 KB
1
in05.txt AC 21 ms 716 KB
1
in06.txt AC 20 ms 668 KB
1
in07.txt AC 22 ms 496 KB
1
in08.txt AC 22 ms 584 KB
1
in09.txt AC 20 ms 668 KB
1
in10.txt AC 25 ms 624 KB
1
in11.txt AC 35 ms 580 KB
1
in12.txt AC 21 ms 664 KB
1
in13.txt AC 29 ms 624 KB
1
in14.txt AC 18 ms 580 KB
1
in15.txt AC 21 ms 660 KB
1
in16.txt AC 17 ms 620 KB
1
in17.txt AC 32 ms 572 KB
1
in18.txt AC 20 ms 660 KB
1
in19.txt AC 21 ms 492 KB
1
in20.txt AC 22 ms 576 KB
1
in21.txt AC 19 ms 532 KB
1
in22.txt AC 18 ms 616 KB
1
in23.txt AC 23 ms 568 KB
1
in24.txt AC 23 ms 652 KB
1
in25.txt AC 15 ms 740 KB
1
in26.txt AC 16 ms 696 KB
1
in27.txt AC 20 ms 528 KB
1
in28.txt AC 22 ms 612 KB
1
in29.txt AC 21 ms 700 KB
1
in30.txt AC 21 ms 788 KB
1
sample01.txt AC 20 ms 612 KB
1
sample02.txt AC 21 ms 692 KB
1
sample03.txt AC 20 ms 648 KB
1