Submission #77642


ソースコード

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
35
36
37
38
39
40
41
42
43
44
45
#include <bits/stdc++.h>
#define S << " "
#define fin << "\n"
#define rn long double
#define SS << " " <<
#define nintendo switch
#define lol long long int
#define fout cout << "No\n"
#define tout cout << "Yes\n"
#define check cout << 1 fin;
#define ins(i) if(i) cout << " "
#define Iter(type) type::iterator
#define usort(a) sort(a.begin() , a.end())
#define dsort(a) sort(a.rbegin() , a.rend())
#define fixout(a) cout << fixed << setprecision(a)
#define push_pair(a , b) push_back(make_pair(a , b))
#define ub(a , b) upper_bound(a.begin() , a.end() , b)
#define lb(a , b) lower_bound(a.begin() , a.end() , b)
#define bs(a , b) binary_search(a.begin() , a.end() , b)
#define dptable(n , m) vvec(lol , dp , n + 1 , m + 1 , 0)
#define out_all(a , b) for(auto b = a.begin();b != a.end();b ++) cout << *b fin
#define vvec(type , arr , n , m , def) vector<vector<type>> arr(n , vector<type> (m , def))
using namespace std;
int years(int y , int m , int d , int y2 , int m2 , int d2){
int years = y2 - y;
if(m2 < m){
years --;
}else if(m == m2 && d2 < d){
years --;
}
return(years);
}
int main(void){
ios::sync_with_stdio(false);
cin.tie(0);
int y[3] , m[3] , d[3];
for(int i = 0;i < 3;i ++) cin >> y[i] >> m[i] >> d[i];
int yamada , yamamoto;
yamada = years(y[0] , m[0] , d[0] , y[2] , m[2] , d[2]);
yamamoto = years(y[1] , m[1] , d[1] , y[2] , m[2] , d[2]);
cout << abs(yamada - yamamoto) fin;
return(0);
}

ステータス

項目 データ
問題 1514 - Age Difference
ユーザー名 Koba_gochiusa
投稿日時 2024-04-05 14:43:37
言語 C++17
状態 Accepted
得点 100
ソースコード長 1523 Byte
最大実行時間 27 ms
最大メモリ使用量 780 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
hand_made01.txt AC 24 ms 600 KB
1
hand_made02.txt AC 23 ms 556 KB
1
hand_made03.txt AC 21 ms 644 KB
1
hand_made04.txt AC 18 ms 596 KB
1
hand_made05.txt AC 21 ms 552 KB
1
in01.txt AC 17 ms 508 KB
1
in02.txt AC 20 ms 460 KB
1
in03.txt AC 20 ms 420 KB
1
in04.txt AC 14 ms 504 KB
1
in05.txt AC 24 ms 460 KB
1
in06.txt AC 19 ms 540 KB
1
in07.txt AC 26 ms 500 KB
1
in08.txt AC 21 ms 584 KB
1
in09.txt AC 21 ms 668 KB
1
in10.txt AC 21 ms 500 KB
1
in11.txt AC 23 ms 588 KB
1
in12.txt AC 20 ms 548 KB
1
in13.txt AC 19 ms 504 KB
1
in14.txt AC 27 ms 584 KB
1
in15.txt AC 21 ms 532 KB
1
in16.txt AC 21 ms 492 KB
1
in17.txt AC 19 ms 576 KB
1
in18.txt AC 26 ms 660 KB
1
in19.txt AC 21 ms 492 KB
1
in20.txt AC 22 ms 576 KB
1
in21.txt AC 23 ms 528 KB
1
in22.txt AC 19 ms 612 KB
1
in23.txt AC 19 ms 696 KB
1
in24.txt AC 18 ms 780 KB
1
in25.txt AC 16 ms 740 KB
1
in26.txt AC 20 ms 696 KB
1
in27.txt AC 20 ms 648 KB
1
in28.txt AC 22 ms 604 KB
1
in29.txt AC 23 ms 680 KB
1
in30.txt AC 25 ms 764 KB
1
sample01.txt AC 23 ms 720 KB
1
sample02.txt AC 15 ms 680 KB
1
sample03.txt AC 19 ms 760 KB
1