結果
問題 |
No.70 睡眠の重要性!
|
ユーザー |
|
提出日時 | 2017-01-23 17:01:50 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 410 bytes |
コンパイル時間 | 732 ms |
コンパイル使用メモリ | 102,544 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 06:33:07 |
合計ジャッジ時間 | 1,245 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto n = readln.chomp.to!size_t; auto r = 0; foreach (_; n.iota) { auto rd = readln.split, a = toMin(rd[0]), b = toMin(rd[1]); auto c = b - a; if (c < 0) c += 24 * 60; r += c; } writeln(r); } auto toMin(string a) { auto hm = a.split(":"), h = hm[0].to!int, m = hm[1].to!int; return h * 60 + m; }