Submission #00027
ソースコード
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 | #include<bits/stdc++.h> using namespace std; int main(){ int y[3],m[3],d[3]; for ( int i=0;i<3;i++){ cin>>y[i]>>m[i]>>d[i]; } int sa= abs (y[1]-y[0]); vector< int > md(3,0); if (m[0]>=1)md[0]+=31; if (m[0]>=2)md[0]+=28; if (m[0]>=3)md[0]+=31; if (m[0]>=4)md[0]+=30; if (m[0]>=5)md[0]+=31; if (m[0]>=6)md[0]+=30; if (m[0]>=7)md[0]+=31; if (m[0]>=8)md[0]+=31; if (m[0]>=9)md[0]+=30; if (m[0]>=10)md[0]+=31; if (m[0]>=11)md[0]+=30; if (m[0]>=12)md[0]+=31; if (m[1]>=1)md[1]+=31; if (m[1]>=2)md[1]+=28; if (m[1]>=3)md[1]+=31; if (m[1]>=4)md[1]+=30; if (m[1]>=5)md[1]+=31; if (m[1]>=6)md[1]+=30; if (m[1]>=7)md[1]+=31; if (m[1]>=8)md[1]+=31; if (m[1]>=9)md[1]+=30; if (m[1]>=10)md[1]+=31; if (m[1]>=11)md[1]+=30; if (m[1]>=12)md[1]+=31; if (m[2]>=1)md[2]+=31; if (m[2]>=2)md[2]+=28; if (m[2]>=3)md[2]+=31; if (m[2]>=4)md[2]+=30; if (m[2]>=5)md[2]+=31; if (m[2]>=6)md[2]+=30; if (m[2]>=7)md[2]+=31; if (m[2]>=8)md[2]+=31; if (m[2]>=9)md[2]+=30; if (m[2]>=10)md[2]+=31; if (m[2]>=11)md[2]+=30; if (m[2]>=12)md[2]+=31; md[0]+=d[0]; md[1]+=d[1]; md[2]+=d[2]; //cout<<md[0]<<" "<<md[1]<<" "<<md[2]<<"\n"; if (md[2]>md[0]&&md[2]<md[1])sa++; else if (md[2]<md[0]&&md[2]>md[1])sa++; cout<<sa<< "\n" ; } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - Age Difference |
ユーザー名 | ei2331 |
投稿日時 | 2023-09-20 16:18:08 |
言語 | C++17 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 1395 Byte |
最大実行時間 | 33 ms |
最大メモリ使用量 | 776 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 100 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
hand_made01.txt | AC | 21 ms | 476 KB |
1
|
hand_made02.txt | AC | 33 ms | 452 KB |
1
|
hand_made03.txt | AC | 21 ms | 420 KB |
1
|
hand_made04.txt | WA | 25 ms | 520 KB |
1
|
hand_made05.txt | AC | 19 ms | 624 KB |
1
|
in01.txt | AC | 19 ms | 468 KB |
1
|
in02.txt | WA | 15 ms | 572 KB |
1
|
in03.txt | AC | 24 ms | 540 KB |
1
|
in04.txt | AC | 22 ms | 512 KB |
1
|
in05.txt | AC | 23 ms | 484 KB |
1
|
in06.txt | AC | 21 ms | 588 KB |
1
|
in07.txt | AC | 15 ms | 564 KB |
1
|
in08.txt | AC | 27 ms | 540 KB |
1
|
in09.txt | WA | 22 ms | 636 KB |
1
|
in10.txt | AC | 16 ms | 612 KB |
1
|
in11.txt | AC | 25 ms | 712 KB |
1
|
in12.txt | AC | 17 ms | 684 KB |
1
|
in13.txt | AC | 20 ms | 652 KB |
1
|
in14.txt | AC | 21 ms | 620 KB |
1
|
in15.txt | AC | 25 ms | 592 KB |
1
|
in16.txt | AC | 25 ms | 564 KB |
1
|
in17.txt | AC | 21 ms | 540 KB |
1
|
in18.txt | AC | 24 ms | 636 KB |
1
|
in19.txt | AC | 23 ms | 604 KB |
1
|
in20.txt | AC | 22 ms | 576 KB |
1
|
in21.txt | AC | 19 ms | 676 KB |
1
|
in22.txt | AC | 25 ms | 776 KB |
1
|
in23.txt | AC | 27 ms | 620 KB |
1
|
in24.txt | AC | 22 ms | 592 KB |
1
|
in25.txt | WA | 18 ms | 560 KB |
1
|
in26.txt | AC | 21 ms | 660 KB |
1
|
in27.txt | AC | 16 ms | 500 KB |
1
|
in28.txt | AC | 15 ms | 600 KB |
1
|
in29.txt | WA | 16 ms | 568 KB |
1
|
in30.txt | WA | 25 ms | 540 KB |
1
|
sample01.txt | AC | 21 ms | 640 KB |
1
|
sample02.txt | AC | 21 ms | 736 KB |
1
|
sample03.txt | AC | 21 ms | 704 KB |
1
|