Submission #00010


ソースコード

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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include<bits/stdc++.h>
#define rep(i,a,n) for(long long i=a;i<n;i++)
#define repp(i,a,n) for(long long i=a;i>=n;i--)
#define rep2(i,a,n,b) for(long long i=a;i<n;i+=b)
#define repp2(i,a,n,b) for(long long i=a;i>=n;i-=b)
#define so(z) sort(z.begin(),z.end())
#define sor(z) sort(z.rbegin(),z.rend())
#define re(z) reverse(z.begin(),z.end())
#define un(c) unique(c.begin(),c.end()),c.end() //連続部分の最初の一文字を前の方に移動(後ろの余りは変わらない) aaccbb -> acbcbb
#define er(v,x) v.erase(remove(v.begin(), v.end(), x), v.end()) //配列中のxを削除
#define er_un(c) erase(unique(c.begin(),c.end(),c.end())) //連続部分の最初の一文字以外を削除 aaccbb -> acb
#define maxx(v) *max_element(v.begin(), v.end()) //最大値
#define minn(v) *min_element(v.begin(), v.end()) //最小値
#define replace(v,x,y) replace(v.begin(), v.end(), x, y) // 配列中のxをyに置換
#define co(v,x) count(v.begin(), v.end(), x) //配列中のxの個数
#define sowa(v) accumulate(v.begin(), v.end(), 0) //配列の総和
#define ruisekiwa(v) partial_sum(v.begin(), v.end(), v.begin()) //累積和
#define su(a) substr(a) //ans.substr(開始位置) ←最後まで
#define sub(a,b) substr(a,b) //ans.substr(開始位置,取り出す長さ)
#define yess cout<<"YES"<<"\n"
#define noo cout<<"NO"<<"\n"
#define yes cout<<"Yes"<<"\n"
#define no cout<<"No"<<"\n"
#define fi first
#define se second
#define fr() front()
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define nn "\n"
#define ll long long
#define ull unsigned long long
#define mod 1000000007
#define IM INT_MAX
#define LM LONG_LONG_MAX
#define gcd(x,y) __gcd(x,y) //最大公約数
#define lcm(x,y) x/(__gcd(x,y))*y //最小公倍数
#define prev(a) prev_permutation(a.begin(),a.end()) //辞書前
#define next(a) next_permutation(a.begin(),a.end()) //辞書後
#define get(s) getline(cin,s) // 空白の空いたstringの入力
#define fixed(a) fixed<<setprecision(a) //小数点何桁か指定
#define ro(a) round(a) //四捨五入
#define ce(a) ceil(a) //切り上げ
#define up(a,v) upper_bound(a.begin(),a.end(),v) //指定された要素より大きい値が現れる最初のイテレータ
#define lo(a,v) lower_bound(a.begin(),a.end(),v) //指定された要素以上の値が現れる最初のイテレータ
#define bi(a,v) binary_bound(a.begin(),a.end(),v) //指定された要素が配列内にあるか
#define pp priority_queue<pair<long long,long long>, vector<pair<long long,long long>>, greater<pair<long long,long long>> > // priority_queue 昇順
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
vector<ll>a(3),b(3),c(3);
ll ans=0,ans2=0;
rep(i,0,3){
cin>>a[i]>>b[i]>>c[i];
}
ans=a[2]-a[0];
ans2=a[2]-a[1];
if(b[0]==b[2]&&c[0]>=c[2]) ans--;
else if(b[0]>b[2]) ans--;
if(b[1]==b[2]&&c[1]>=c[2]) ans2--;
else if(b[1]>b[2]) ans2--;
cout<<abs(ans-ans2)<<nn;
return(0);
}

ステータス

項目 データ
問題 0002 - Age Difference
ユーザー名 r2201
投稿日時 2023-09-20 16:03:58
言語 C++17
状態 Wrong Answer
得点 0
ソースコード長 3067 Byte
最大実行時間 39 ms
最大メモリ使用量 852 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
hand_made01.txt AC 39 ms 476 KB
1
hand_made02.txt WA 37 ms 556 KB
1
hand_made03.txt AC 20 ms 508 KB
1
hand_made04.txt WA 30 ms 464 KB
1
hand_made05.txt WA 29 ms 552 KB
1
in01.txt AC 23 ms 508 KB
1
in02.txt AC 15 ms 596 KB
1
in03.txt AC 19 ms 552 KB
1
in04.txt AC 18 ms 508 KB
1
in05.txt AC 29 ms 592 KB
1
in06.txt AC 23 ms 680 KB
1
in07.txt AC 19 ms 760 KB
1
in08.txt AC 22 ms 712 KB
1
in09.txt AC 22 ms 668 KB
1
in10.txt AC 17 ms 756 KB
1
in11.txt AC 18 ms 712 KB
1
in12.txt AC 19 ms 668 KB
1
in13.txt AC 17 ms 756 KB
1
in14.txt AC 19 ms 716 KB
1
in15.txt AC 15 ms 800 KB
1
in16.txt AC 15 ms 748 KB
1
in17.txt AC 22 ms 700 KB
1
in18.txt AC 27 ms 788 KB
1
in19.txt AC 24 ms 740 KB
1
in20.txt AC 25 ms 692 KB
1
in21.txt AC 18 ms 776 KB
1
in22.txt AC 21 ms 732 KB
1
in23.txt AC 21 ms 688 KB
1
in24.txt AC 24 ms 772 KB
1
in25.txt AC 23 ms 728 KB
1
in26.txt AC 24 ms 808 KB
1
in27.txt AC 22 ms 764 KB
1
in28.txt AC 28 ms 724 KB
1
in29.txt AC 29 ms 812 KB
1
in30.txt AC 16 ms 764 KB
1
sample01.txt AC 20 ms 852 KB
1
sample02.txt AC 28 ms 680 KB
1
sample03.txt AC 23 ms 768 KB
1