結果

問題 No.70 睡眠の重要性!
ユーザー kou_kkkkou_kkk
提出日時 2024-04-27 15:11:09
言語 Nim
(2.0.2)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 317 bytes
コンパイル時間 3,816 ms
コンパイル使用メモリ 67,020 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 15:11:13
合計ジャッジ時間 4,311 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sequtils, strutils

let
  n = parseInt readLine stdin
  xs = (0 ..< n).mapIt split readLine stdin

proc fn(s: string): int =
  let
    hm = s.split(':').map parseInt
    h = hm[0]
    m = hm[1]
  h * 60 + m

var ans = 0
for x in xs:
  var t = x[1].fn - x[0].fn
  if t < 0: t.inc (24 * 60)
  ans.inc t

echo ans
0