Submission #00066
ソースコード
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 | #include<bits/stdc++.h> using namespace std; typedef struct { int island; int fly; }a; int main(){ int n; a sea[1001]; scanf ( "%d" ,&n); for ( int i=0;i<n;i++){ scanf ( "%d %d" ,&sea[i].island,&sea[i].fly); } int ans[1001]; int left=0,right=sea[n-1].island; for ( int i=0;i<n;i++){ if (sea[i].island<=sea[i].fly && right-sea[i].island<=sea[i].fly){ ans[i]=3; } else if (sea[i].island<=sea[i].fly){ ans[i]=1; } else if (right-sea[i].island<=sea[i].fly){ ans[i]=2; } else { ans[i]=4; } } for ( int i=0;i<n;i++){ if (i+1==n){ if (ans[i]==1) printf ( "L\n" ); else if (ans[i]==2) printf ( "R\n" ); else if (ans[i]==3) printf ( "O\n" ); else if (ans[i]==4) printf ( "X\n" ); } else { if (ans[i]==1) printf ( "L" ); else if (ans[i]==2) printf ( "R" ); else if (ans[i]==3) printf ( "O" ); else if (ans[i]==4) printf ( "X" ); } } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0004 - 想起「貪欲だった六番目」 |
ユーザー名 | crom |
投稿日時 | 2017-12-22 14:07:11 |
言語 | C++ |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 965 Byte |
最大実行時間 | 25 ms |
最大メモリ使用量 | 692 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 250 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
Input01 | WA | 21 ms | 480 KB |
1
|
Input02 | WA | 18 ms | 440 KB |
1
|
Input03 | WA | 17 ms | 404 KB |
1
|
Input04 | WA | 17 ms | 376 KB |
1
|
Input05 | WA | 19 ms | 476 KB |
1
|
Input06 | WA | 18 ms | 572 KB |
1
|
Input07 | WA | 25 ms | 540 KB |
1
|
Input08 | WA | 21 ms | 628 KB |
1
|
Input09 | WA | 24 ms | 596 KB |
1
|
Input10 | WA | 15 ms | 564 KB |
1
|
Input11 | WA | 19 ms | 404 KB |
1
|
Input12 | WA | 15 ms | 496 KB |
1
|
Input13 | WA | 19 ms | 596 KB |
1
|
Input14 | WA | 14 ms | 436 KB |
1
|
Input15 | WA | 18 ms | 540 KB |
1
|
Input16 | WA | 18 ms | 504 KB |
1
|
Input17 | WA | 18 ms | 596 KB |
1
|
Input18 | WA | 22 ms | 436 KB |
1
|
Input19 | WA | 19 ms | 404 KB |
1
|
Input20 | WA | 18 ms | 500 KB |
1
|
Input21 | WA | 15 ms | 596 KB |
1
|
Input22 | WA | 16 ms | 692 KB |
1
|
Input23 | WA | 18 ms | 660 KB |
1
|
Input24 | WA | 20 ms | 632 KB |
1
|
Input25 | WA | 13 ms | 600 KB |
1
|
Input26 | WA | 20 ms | 572 KB |
1
|
Input27 | WA | 16 ms | 668 KB |
1
|
Input28 | WA | 19 ms | 640 KB |
1
|
Input29 | WA | 14 ms | 480 KB |
1
|
Input30 | WA | 19 ms | 580 KB |
1
|