結果
| 問題 |
No.70 睡眠の重要性!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-08-04 09:42:24 |
| 言語 | Go (1.23.4) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 5,000 ms |
| コード長 | 611 bytes |
| コンパイル時間 | 13,571 ms |
| コンパイル使用メモリ | 220,616 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-07 19:57:53 |
| 合計ジャッジ時間 | 9,846 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 6 |
ソースコード
package main
import (
"bufio"
"fmt"
"os"
"strconv"
"strings"
)
func main() {
var N, total, s, e, t int
sc := bufio.NewScanner(os.Stdin)
sc.Scan()
N, _ = strconv.Atoi(sc.Text())
for i := 0; i < N; i++ {
sc.Scan()
tokens := strings.Split(sc.Text(), " ")
t, _ = strconv.Atoi(strings.Split(tokens[0], ":")[0])
s = t * 60
t, _ = strconv.Atoi(strings.Split(tokens[0], ":")[1])
s += t
t, _ = strconv.Atoi(strings.Split(tokens[1], ":")[0])
e = t * 60
t, _ = strconv.Atoi(strings.Split(tokens[1], ":")[1])
e += t
if e < s {
e += 24 * 60
}
total += e - s
}
fmt.Println(total)
}