Submission #00031
ソースコード
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 | #include<bits/stdc++.h> using namespace std; int main(){ int n,T; string st_t[10],st[10],ar_t[10],ar[10]; string ans[10]; int ansd[10]; cin>>n>>T; for ( int i=0;i<n;i++){ cin>>st_t[i]>>st[i]>>ar_t[i]>>ar[i]; } int j=0; for ( int i=0;i<n-1;i++){ int t = ((st_t[i+1][0] - '0' ) * 10 + (st_t[i+1][1] - '0' )) - ((ar_t[i][0] - '0' )*10 + (ar_t[i][1] - '0' )); int m = ((st_t[i+1][3] - '0' ) * 10 + (st_t[i+1][4] - '0' )) - ((ar_t[i][3] - '0' )*10 + (ar_t[i][4] - '0' )); if (t == 0){ if (T <= m){ ansd[j] = m; ans[j] = ar[i]; j++; } } else { int art = ((ar_t[i][0] - '0' )*10 + (ar_t[i][1] - '0' )); int stt = ((st_t[i+1][0] - '0' ) * 10 + (st_t[i+1][1] - '0' )); int arm = ((ar_t[i][3] - '0' )*10 + (ar_t[i][4] - '0' )); int stm = ((st_t[i+1][3] - '0' ) * 10 + (st_t[i+1][4] - '0' )); t--; int M=0; while (t){ M += 60; t--; } M += (60 - arm); M += stm; if (T <= m){ ansd[j] = m; ans[j] = ar[i]; j++; } } } cout << j << endl; for ( int k=0;k<j;k++){ cout << ans[k] << " " << ansd[k] << endl; } } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 青春18きっぷ |
ユーザー名 | 椅子男 |
投稿日時 | 2016-08-12 09:47:28 |
言語 | C++11 |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 1191 Byte |
最大実行時間 | 17 ms |
最大メモリ使用量 | 796 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 6 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
2515-in1.txt | AC | 14 ms | 476 KB |
1
|
2515-in2.txt | AC | 10 ms | 472 KB |
1
|
2515-in3.txt | WA | 15 ms | 464 KB |
1
|
2515-in4.txt | WA | 11 ms | 500 KB |
1
|
2515-in5.txt | WA | 12 ms | 608 KB |
1
|
2515-in6.txt | WA | 10 ms | 588 KB |
1
|
2515-in7.txt | WA | 14 ms | 564 KB |
1
|
2515-in8.txt | WA | 11 ms | 796 KB |
1
|
2515-in9.txt | WA | 9 ms | 648 KB |
1
|
2515-in10.txt | WA | 10 ms | 452 KB |
1
|
2515-in11.txt | WA | 14 ms | 428 KB |
1
|
2515-in12.txt | WA | 14 ms | 404 KB |
1
|
2515-in13.txt | AC | 11 ms | 512 KB |
1
|
2515-in14.txt | AC | 13 ms | 484 KB |
1
|
2515-in15.txt | WA | 10 ms | 460 KB |
1
|
2515-in16.txt | AC | 11 ms | 564 KB |
1
|
2515-in17.txt | WA | 14 ms | 536 KB |
1
|
2515-in18.txt | AC | 10 ms | 516 KB |
1
|
2515-in19.txt | WA | 12 ms | 492 KB |
1
|
2515-in20.txt | AC | 17 ms | 448 KB |
1
|
2515-in21.txt | WA | 9 ms | 552 KB |
1
|
2515-in22.txt | WA | 10 ms | 656 KB |
1
|
2515-in23.txt | AC | 13 ms | 632 KB |
1
|
2515-in24.txt | AC | 14 ms | 608 KB |
1
|
2515-in25.txt | WA | 11 ms | 592 KB |
1
|
2515-in26.txt | WA | 14 ms | 572 KB |
1
|
2515-in27.txt | WA | 13 ms | 668 KB |
1
|
2515-in28.txt | WA | 13 ms | 516 KB |
1
|
2515-in29.txt | WA | 13 ms | 492 KB |
1
|
2515-in30.txt | WA | 11 ms | 444 KB |
1
|
2515-in31.txt | AC | 13 ms | 544 KB |
1
|
2515-in32.txt | WA | 11 ms | 520 KB |
1
|