Submission #00039
ソースコード
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 | #include<bits/stdc++.h> #define ll long long #define np(v) next_permutation(v.begin(),v.end()) //次の順列 #define gcd(a,b) __gcd(a,b) //最大公約数 #define lcm(a,b) a*b/(gcd(a,b)) //最小公倍数 #define lb(v,a) lower_bound(v.begin(),v.end(),a) #define ub(v,a) upper_bound(v.begin(),v.end(),a) #define bs(v,a) binary_search(v.begin(),v.end(),a) #define fixed(a) fixed<<setprecision(a) #define bitcount(i) __builtin_popcount(i) #define pq priority_queue using namespace std; int main(){ ios::sync_with_stdio( false ); cin.tie(0); int Y[3],M[3],D[3]; int y[3]; for ( int i = 0;i < 3;i++){ cin>>Y[i]>>M[i]>>D[i]; } for ( int i = 0;i < 2;i++){ y[i] = Y[i] - Y[2]; if (M[i] > M[2]) y[i]++; if (M[i] == M[2] && D[i] > D[2]) y[i]++; } cout<< abs (y[1] - y[0])<< "\n" ; return (0); } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - Age Difference |
ユーザー名 | r2213 |
投稿日時 | 2023-09-20 16:30:01 |
言語 | C++17 |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 881 Byte |
最大実行時間 | 28 ms |
最大メモリ使用量 | 764 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 100 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
hand_made01.txt | AC | 28 ms | 600 KB |
1
|
hand_made02.txt | AC | 20 ms | 556 KB |
1
|
hand_made03.txt | AC | 22 ms | 512 KB |
1
|
hand_made04.txt | AC | 23 ms | 464 KB |
1
|
hand_made05.txt | AC | 24 ms | 548 KB |
1
|
in01.txt | AC | 18 ms | 504 KB |
1
|
in02.txt | AC | 28 ms | 456 KB |
1
|
in03.txt | AC | 19 ms | 540 KB |
1
|
in04.txt | AC | 21 ms | 620 KB |
1
|
in05.txt | AC | 23 ms | 700 KB |
1
|
in06.txt | AC | 24 ms | 656 KB |
1
|
in07.txt | AC | 23 ms | 608 KB |
1
|
in08.txt | AC | 27 ms | 568 KB |
1
|
in09.txt | AC | 27 ms | 520 KB |
1
|
in10.txt | AC | 23 ms | 608 KB |
1
|
in11.txt | AC | 21 ms | 684 KB |
1
|
in12.txt | AC | 16 ms | 636 KB |
1
|
in13.txt | AC | 15 ms | 720 KB |
1
|
in14.txt | AC | 16 ms | 680 KB |
1
|
in15.txt | AC | 19 ms | 764 KB |
1
|
in16.txt | AC | 19 ms | 720 KB |
1
|
in17.txt | AC | 24 ms | 672 KB |
1
|
in18.txt | AC | 20 ms | 624 KB |
1
|
in19.txt | AC | 18 ms | 580 KB |
1
|
in20.txt | AC | 24 ms | 536 KB |
1
|
in21.txt | AC | 23 ms | 492 KB |
1
|
in22.txt | AC | 19 ms | 576 KB |
1
|
in23.txt | AC | 21 ms | 536 KB |
1
|
in24.txt | AC | 17 ms | 492 KB |
1
|
in25.txt | AC | 17 ms | 576 KB |
1
|
in26.txt | AC | 20 ms | 660 KB |
1
|
in27.txt | AC | 25 ms | 488 KB |
1
|
in28.txt | AC | 17 ms | 572 KB |
1
|
in29.txt | AC | 17 ms | 660 KB |
1
|
in30.txt | AC | 20 ms | 744 KB |
1
|
sample01.txt | AC | 23 ms | 700 KB |
1
|
sample02.txt | AC | 22 ms | 660 KB |
1
|
sample03.txt | AC | 20 ms | 740 KB |
1
|