結果

問題 No.296 n度寝
コンテスト
ユーザー aaa aa
提出日時 2025-11-26 11:36:17
言語 C#
(.NET 8.0.404)
結果
WA  
実行時間 -
コード長 890 bytes
コンパイル時間 14,954 ms
コンパイル使用メモリ 171,356 KB
実行使用メモリ 188,200 KB
最終ジャッジ日時 2025-11-26 11:37:49
合計ジャッジ時間 17,008 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 8 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (103 ミリ秒)。
  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;
                }
            }
        }


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