結果

問題 No.652 E869120 and TimeZone
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-06-12 02:15:59
言語 Java21
(openjdk 21)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 889 bytes
コンパイル時間 4,962 ms
コンパイル使用メモリ 76,104 KB
実行使用メモリ 59,176 KB
最終ジャッジ日時 2023-09-24 21:58:05
合計ジャッジ時間 13,209 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 164 ms
57,048 KB
testcase_01 AC 163 ms
57,196 KB
testcase_02 AC 163 ms
59,176 KB
testcase_03 AC 163 ms
56,916 KB
testcase_04 AC 163 ms
57,024 KB
testcase_05 AC 160 ms
57,064 KB
testcase_06 AC 162 ms
57,088 KB
testcase_07 AC 160 ms
57,184 KB
testcase_08 AC 164 ms
57,056 KB
testcase_09 AC 161 ms
56,916 KB
testcase_10 AC 167 ms
57,044 KB
testcase_11 AC 163 ms
57,060 KB
testcase_12 AC 159 ms
57,024 KB
testcase_13 AC 161 ms
57,328 KB
testcase_14 AC 159 ms
57,360 KB
testcase_15 AC 161 ms
57,056 KB
testcase_16 AC 163 ms
57,060 KB
testcase_17 AC 161 ms
57,076 KB
testcase_18 AC 164 ms
56,924 KB
testcase_19 AC 164 ms
55,220 KB
testcase_20 AC 164 ms
56,960 KB
testcase_21 WA -
testcase_22 AC 161 ms
57,448 KB
testcase_23 AC 162 ms
57,212 KB
testcase_24 AC 159 ms
57,064 KB
testcase_25 AC 158 ms
55,116 KB
testcase_26 AC 162 ms
57,032 KB
testcase_27 AC 158 ms
56,864 KB
testcase_28 AC 161 ms
57,040 KB
testcase_29 AC 163 ms
57,124 KB
testcase_30 AC 158 ms
57,428 KB
testcase_31 AC 160 ms
57,124 KB
testcase_32 AC 162 ms
56,996 KB
testcase_33 AC 160 ms
57,052 KB
testcase_34 AC 162 ms
56,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class No652{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int b = sc.nextInt();
		String xx = sc.next();
		if(!xx.contains(".")){
			xx.concat(".0");
		}
		double x;
		if(xx.contains("+")){
			x = Double.valueOf(xx.substring(4));
		}else{
			x = -Double.valueOf(xx.substring(4));
		}
		double diff = Math.round((x-9.0)*100000)/100000.0;
		int a_diff = (int)((diff*60.0)/60.0);
		int b_diff = (int)((diff*60.0)%60.0);
		// System.out.println(diff + " " + a_diff + " " + b_diff);

		int a_new = a + a_diff;
		int b_new = b + b_diff;
		if(b_new >= 60){
			b_new -= 60;
			a_new += 1;
		}else if(b_new < 0){
			b_new += 60;
			a_new -= 1;
		}
		if(a_new >= 24) a_new -= 24;
		else if(a_new < 0) a_new += 24;

		System.out.println(String.format("%02d", a_new) + ":" + String.format("%02d", b_new));
	}
}
0