結果

問題 No.652 E869120 and TimeZone
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-23 22:44:47
言語 Java19
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 616 bytes
コンパイル時間 3,519 ms
コンパイル使用メモリ 74,084 KB
実行使用メモリ 57,420 KB
最終ジャッジ日時 2023-08-22 14:14:11
合計ジャッジ時間 10,171 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
56,896 KB
testcase_01 AC 157 ms
56,844 KB
testcase_02 WA -
testcase_03 AC 159 ms
57,016 KB
testcase_04 AC 160 ms
56,920 KB
testcase_05 AC 158 ms
56,896 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 159 ms
57,072 KB
testcase_09 AC 157 ms
57,048 KB
testcase_10 AC 157 ms
56,992 KB
testcase_11 AC 160 ms
57,184 KB
testcase_12 AC 159 ms
57,020 KB
testcase_13 WA -
testcase_14 AC 157 ms
57,028 KB
testcase_15 AC 159 ms
57,140 KB
testcase_16 AC 158 ms
56,996 KB
testcase_17 AC 158 ms
57,092 KB
testcase_18 AC 159 ms
57,192 KB
testcase_19 AC 156 ms
56,852 KB
testcase_20 AC 158 ms
56,904 KB
testcase_21 WA -
testcase_22 AC 157 ms
57,272 KB
testcase_23 AC 159 ms
57,128 KB
testcase_24 AC 159 ms
56,928 KB
testcase_25 AC 157 ms
56,840 KB
testcase_26 AC 157 ms
56,668 KB
testcase_27 AC 159 ms
56,852 KB
testcase_28 AC 157 ms
56,636 KB
testcase_29 AC 159 ms
57,080 KB
testcase_30 AC 160 ms
57,008 KB
testcase_31 AC 159 ms
56,660 KB
testcase_32 AC 157 ms
56,836 KB
testcase_33 AC 158 ms
57,420 KB
testcase_34 AC 158 ms
56,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int h = sc.nextInt();
		int m = sc.nextInt();
		String s = sc.next();
		s = s.replaceAll("[UTC+]","");
		double t = Double.parseDouble(s)-9.0;
		//tがマイナスなら時間を戻す。プラスなら進める。
		t *= 60;
		
		int ans = (h*60+m)+(int)t;
		
		if (ans<0) {
			while (ans<0) {
				ans += 1440;
			}
		}
		
		int H = ans/60;
		H %= 24;
		
		int M = ans%60;
		
		String x = "";
		if (H<10) {x+="0";}
		x+=H+":";
		if (M<10) {x+="0";}
		x+=M;
		System.out.println(x);
	}
}
0