結果

問題 No.296 n度寝
コンテスト
ユーザー aaa aa
提出日時 2025-11-26 11:45:34
言語 C#
(.NET 8.0.404)
結果
TLE  
実行時間 -
コード長 1,182 bytes
コンパイル時間 7,858 ms
コンパイル使用メモリ 168,740 KB
実行使用メモリ 41,636 KB
最終ジャッジ日時 2025-11-26 11:45:52
合計ジャッジ時間 12,095 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 15
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (113 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #
raw source code

using System;
public class Program
{
    public static void Main()
    {
        //int x = int.Parse(Console.ReadLine() ?? string.Empty);
        string[] pass = (Console.ReadLine() ?? string.Empty).Trim().Split(' ');
        //string a = Console.ReadLine() ?? string.Empty;

        int sleep = int.Parse(pass[0]);//何度寝
        int hour = int.Parse(pass[1]);//時間
        int minute = int.Parse(pass[2]);//分
        int time = int.Parse(pass[3]);//間隔

        int anshour = hour;
        int ansmin = minute;

        if (sleep >= 2)
        {
            for (int i = 2; i <= sleep; i++)
            {
                ansmin += time;
                if (ansmin >= 60)
                {
                    anshour += ansmin / 60;
                    if(anshour >= 24)
                    {
                        anshour %= 24;
                    }
                    //anshour++;
                    //ansmin -= 60;
                    ansmin %= 60;
                }
                Console.WriteLine(anshour);
                Console.WriteLine(ansmin);

            }

        }


        Console.WriteLine(anshour);
        Console.WriteLine(ansmin);
    }
}
0