結果
問題 | No.70 睡眠の重要性! |
ユーザー | nanophoto12 |
提出日時 | 2014-11-18 23:47:50 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 44 ms / 5,000 ms |
コード長 | 749 bytes |
コンパイル時間 | 987 ms |
コンパイル使用メモリ | 109,480 KB |
実行使用メモリ | 22,656 KB |
最終ジャッジ日時 | 2025-01-02 19:00:30 |
合計ジャッジ時間 | 2,057 ms |
ジャッジサーバーID (参考情報) |
judge4 / 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.Collections.Generic; using System.Linq; internal class Program { public static void Main(string[] args) { var n = int.Parse(Console.ReadLine()); long sum = 0; for (int i = 0; i < n; i++) { var dateTimes = Console.ReadLine().Split(' ').Select(DateTime.Parse).ToArray(); if (dateTimes[1].CompareTo(dateTimes[0]) < 0) { sum += (dateTimes[1].AddDays(1).ToBinary() - dateTimes[0].ToBinary()); } else { sum += (dateTimes[1].ToBinary() - dateTimes[0].ToBinary()); } } Console.WriteLine(TimeSpan.FromTicks(sum).TotalMinutes); } }