結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2022-07-02 08:53:18 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 471 bytes |
コンパイル時間 | 16,466 ms |
コンパイル使用メモリ | 221,012 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 22:11:12 |
合計ジャッジ時間 | 16,026 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
ソースコード
package main import ( "fmt" "strconv" "strings" ) func main() { var n int fmt.Scan(&n) ans := 0 for range make([]struct{}, n) { t := 0 for i := 0; i < 2; i++ { var s string fmt.Scan(&s) t += f(s, i) } if t < 0 { t += 24 * 60 } ans += t } fmt.Println(ans) } func f(s string, i int) (res int) { a := strings.Split(s, ":") a0, _ := strconv.Atoi(a[0]) a1, _ := strconv.Atoi(a[1]) res = a0*60 + a1 if i == 0 { res *= -1 } return }