結果

問題 No.70 睡眠の重要性!
ユーザー しらゆきしらゆき
提出日時 2015-11-20 11:38:13
言語 C#(csc)
(csc 3.9.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 758 bytes
コンパイル時間 1,973 ms
コンパイル使用メモリ 99,656 KB
実行使用メモリ 20,852 KB
最終ジャッジ日時 2023-10-11 18:08:52
合計ジャッジ時間 2,962 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,660 KB
testcase_01 AC 57 ms
20,852 KB
testcase_02 AC 58 ms
20,760 KB
testcase_03 AC 58 ms
20,852 KB
testcase_04 AC 58 ms
20,712 KB
testcase_05 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

class Program
{
    static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        int[] H = new int[n];
        int[] M = new int[n];
        int[] h = new int[n];
        int[] m = new int[n];
        for (int i = 0; i < n; i++)
        {
            string[] s = Console.ReadLine().Split();
            H[i] = int.Parse(s[0].Split(':')[0]);
            M[i] = int.Parse(s[0].Split(':')[1]);
            h[i] = int.Parse(s[1].Split(':')[0]);
            m[i] = int.Parse(s[1].Split(':')[1]);
        }

        int sleep = 0;

        for (int i = 0; i < n; i++)
        {
            if (H[i] > h[i]) h[i] += 24;
            sleep += h[i] * 60 + m[i] - H[i] * 60 - M[i];
        }

        Console.WriteLine(sleep);
    }
}
0