結果

問題 No.296 n度寝
コンテスト
ユーザー kitamoto0407
提出日時 2025-12-06 11:28:26
言語 Java
(openjdk 23)
結果
AC  
実行時間 118 ms / 1,000 ms
コード長 1,117 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,898 ms
コンパイル使用メモリ 83,104 KB
実行使用メモリ 47,132 KB
最終ジャッジ日時 2025-12-06 11:31:08
合計ジャッジ時間 5,697 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import java.io.*;
import java.util.*;
import java.util.stream.*;

class Process {
    private int N;
    private int H;
    private int M;
    private int T;

    Process(int N, int H, int M, int T) {
        this.N = N;
        this.H = H;
        this.M = M;
        this.T = T;
    }

    String getResult() {
        // 0 時 0 分から経過した時間 (分)
        int time = H * 60 + M;

        time += T * (N - 1);
        time %= 1440;

        return ((time / 60) + "\n" + (time % 60));
    }
}

public class Main {
    public static void main(String[] args) throws IOException {
        var bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        var printWriter    = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

        // 入力
        int[] input = Stream.of(bufferedReader.readLine().trim().split("[ ]+")).mapToInt(Integer::parseInt).toArray();

        // 処理および出力
        printWriter.println((new Process(input[0], input[1], input[2], input[3])).getResult());

        bufferedReader.close();
        printWriter.close();
    }
}
0