結果
問題 | No.70 睡眠の重要性! |
ユーザー |
![]() |
提出日時 | 2016-10-11 12:09:44 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 25 ms / 5,000 ms |
コード長 | 966 bytes |
コンパイル時間 | 1,072 ms |
コンパイル使用メモリ | 103,040 KB |
実行使用メモリ | 18,176 KB |
最終ジャッジ日時 | 2024-11-22 01:23:25 |
合計ジャッジ時間 | 1,506 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Linq; class Program { static void Main(string[] args) { // No.70 睡眠の重要性! int N = int.Parse(Console.ReadLine()); string sleep = ""; DateTime timeFrom, timeTo; TimeSpan sleepSum = new TimeSpan(); for (int i = 1; i <= N; i++) { sleep = Console.ReadLine(); timeFrom = new DateTime(1, 1, 1, int.Parse(sleep.Split(' ')[0].Split(':')[0]), int.Parse(sleep.Split(' ')[0].Split(':')[1]), 0); timeTo = new DateTime(1, 1, 1, int.Parse(sleep.Split(' ')[1].Split(':')[0]), int.Parse(sleep.Split(' ')[1].Split(':')[1]), 0); if (timeFrom > timeTo) timeTo = timeTo.AddDays(1); sleepSum += timeTo - timeFrom; } Console.WriteLine((sleepSum.Days * 24 + sleepSum.Hours) * 60 + sleepSum.Minutes); } }