結果

問題 No.652 E869120 and TimeZone
ユーザー YamaKasaYamaKasa
提出日時 2018-09-30 22:01:51
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 1,000 ms
コード長 843 bytes
コンパイル時間 3,806 ms
コンパイル使用メモリ 73,796 KB
実行使用メモリ 56,016 KB
最終ジャッジ日時 2023-09-02 05:31:37
合計ジャッジ時間 8,196 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,836 KB
testcase_01 AC 124 ms
55,344 KB
testcase_02 AC 125 ms
55,340 KB
testcase_03 AC 127 ms
55,636 KB
testcase_04 AC 127 ms
55,340 KB
testcase_05 AC 124 ms
55,620 KB
testcase_06 AC 127 ms
53,504 KB
testcase_07 AC 125 ms
55,656 KB
testcase_08 AC 125 ms
55,592 KB
testcase_09 AC 127 ms
55,732 KB
testcase_10 AC 126 ms
55,404 KB
testcase_11 AC 127 ms
55,688 KB
testcase_12 AC 127 ms
55,440 KB
testcase_13 AC 126 ms
55,448 KB
testcase_14 AC 124 ms
55,500 KB
testcase_15 AC 125 ms
55,544 KB
testcase_16 AC 126 ms
55,596 KB
testcase_17 AC 127 ms
55,536 KB
testcase_18 AC 125 ms
55,860 KB
testcase_19 AC 125 ms
55,728 KB
testcase_20 AC 127 ms
55,836 KB
testcase_21 AC 124 ms
55,708 KB
testcase_22 AC 125 ms
55,916 KB
testcase_23 AC 125 ms
55,616 KB
testcase_24 AC 127 ms
55,660 KB
testcase_25 AC 121 ms
55,928 KB
testcase_26 AC 125 ms
55,920 KB
testcase_27 AC 124 ms
55,708 KB
testcase_28 AC 125 ms
55,704 KB
testcase_29 AC 126 ms
55,868 KB
testcase_30 AC 126 ms
55,604 KB
testcase_31 AC 127 ms
55,848 KB
testcase_32 AC 125 ms
56,016 KB
testcase_33 AC 126 ms
55,416 KB
testcase_34 AC 125 ms
55,576 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String h = scan.next();
		String m = scan.next();
		String t = scan.next();
		scan.close();
		int H;
		int M;
		double k;
		if(h.charAt(0) == '0') {
			H = Integer.parseInt(h.substring(1, 2));
		}else {
			H = Integer.parseInt(h.substring(0, 2));
		}
		if(m.charAt(0) == '0') {
			M = Integer.parseInt(m.substring(1, 2));
		}else {
			M = Integer.parseInt(m.substring(0, 2));
		}
		if(t.charAt(4) == '0') {
			k = Double.parseDouble(t.substring(3, t.length()));
		}else {
			k = Double.parseDouble(t.substring(3, t.length()));
		}

		//System.out.println(H +" " + M +" " + k);

		int e = H * 60 + M - 540 + 1440 * 2 + (int)Math.round(k * 60);
		e = e % 1440;
		System.out.printf("%02d:%02d\n", e/60, e%60);
	}
}
0