結果

問題 No.296 n度寝
ユーザー bayashiko_rbayashiko_r
提出日時 2018-11-03 17:18:40
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 23 ms / 1,000 ms
コード長 721 bytes
コンパイル時間 820 ms
コンパイル使用メモリ 111,248 KB
実行使用メモリ 26,200 KB
最終ジャッジ日時 2024-04-30 21:22:12
合計ジャッジ時間 2,003 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
26,200 KB
testcase_01 AC 22 ms
24,160 KB
testcase_02 AC 21 ms
25,868 KB
testcase_03 AC 20 ms
21,940 KB
testcase_04 AC 20 ms
21,808 KB
testcase_05 AC 21 ms
24,156 KB
testcase_06 AC 21 ms
25,940 KB
testcase_07 AC 22 ms
24,164 KB
testcase_08 AC 22 ms
26,128 KB
testcase_09 AC 20 ms
21,812 KB
testcase_10 AC 22 ms
23,984 KB
testcase_11 AC 21 ms
23,952 KB
testcase_12 AC 20 ms
23,776 KB
testcase_13 AC 23 ms
23,896 KB
testcase_14 AC 23 ms
26,128 KB
testcase_15 AC 22 ms
23,904 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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(string[] args) {
        //入力
        string s = Console.ReadLine();
        string[] t = s.Split(' ');

        //数字の割り当て
        int N = int.Parse(t[0]);
        int H = int.Parse(t[1]);  //時間
        int M = int.Parse(t[2]);  //分
        int T = int.Parse(t[3]);  //アラームの間隔

        //まずは分の値を加える
        M += T * (N - 1);

        //分の値から時間を取り出す
        H += M / 60;

        //分の値を60以下に設定する
        M %= 60;

        //時間の値を24以下に設定する
        H %= 24;

        //出力
        Console.WriteLine(H);
        Console.WriteLine(M);
    }
}
0