Submission #00055


ソースコード

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
#include <bits/stdc++.h>
using namespace std;
int n, t;
int h1[111], m1[111], h2[111], m2[111];
char name1[111][111], name2[111][111], name[111][111];
int tim[111];
int cnt = 0;
int main()
{
cin >> n >> t;
for (int i = 0; i < n; i++) scanf("%d:%d %s %d:%d %s", &h1[i], &m1[i], name1[i], &h2[i], &m2[i], name2[i]);
for (int i = 1; i < n; i++) {
if (h1[i]*60 + m1[i] - (h2[i-1]*60 + m2[i-1]) >= t) {
strcpy(name[cnt], name1[i]);
tim[cnt] = h1[i]*60 + m1[i] - (h2[i-1]*60 + m2[i-1]);
cnt++;
}
}
if (!cnt) cout << '0' << endl;
else {
cout << cnt << endl;
for (int i = 0; i < cnt; i++) {
cout << name[i] << ' ' << tim[i] << endl;
}
}
}

ステータス

項目 データ
問題 0002 - 青春18きっぷ
ユーザー名 udonkun
投稿日時 2016-08-12 10:38:27
言語 C++11
状態 Accepted
得点 6
ソースコード長 723 Byte
最大実行時間 17 ms
最大メモリ使用量 720 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2515-in1.txt AC 11 ms 472 KB
1
2515-in2.txt AC 11 ms 616 KB
1
2515-in3.txt AC 13 ms 492 KB
1
2515-in4.txt AC 13 ms 604 KB
1
2515-in5.txt AC 13 ms 700 KB
1
2515-in6.txt AC 11 ms 668 KB
1
2515-in7.txt AC 10 ms 632 KB
1
2515-in8.txt AC 14 ms 600 KB
1
2515-in9.txt AC 11 ms 692 KB
1
2515-in10.txt AC 10 ms 440 KB
1
2515-in11.txt AC 15 ms 540 KB
1
2515-in12.txt AC 10 ms 500 KB
1
2515-in13.txt AC 11 ms 720 KB
1
2515-in14.txt AC 11 ms 560 KB
1
2515-in15.txt AC 13 ms 652 KB
1
2515-in16.txt AC 10 ms 492 KB
1
2515-in17.txt AC 13 ms 588 KB
1
2515-in18.txt AC 15 ms 552 KB
1
2515-in19.txt AC 10 ms 516 KB
1
2515-in20.txt AC 10 ms 580 KB
1
2515-in21.txt AC 11 ms 540 KB
1
2515-in22.txt AC 10 ms 508 KB
1
2515-in23.txt AC 14 ms 600 KB
1
2515-in24.txt AC 13 ms 568 KB
1
2515-in25.txt AC 9 ms 532 KB
1
2515-in26.txt AC 11 ms 628 KB
1
2515-in27.txt AC 13 ms 600 KB
1
2515-in28.txt AC 10 ms 564 KB
1
2515-in29.txt AC 9 ms 528 KB
1
2515-in30.txt AC 17 ms 456 KB
1
2515-in31.txt AC 13 ms 676 KB
1
2515-in32.txt AC 11 ms 640 KB
1