結果

問題 No.652 E869120 and TimeZone
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-28 16:23:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 953 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 74,660 KB
実行使用メモリ 57,532 KB
最終ジャッジ日時 2023-08-23 10:52:33
合計ジャッジ時間 9,307 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 159 ms
56,912 KB
testcase_01 WA -
testcase_02 AC 159 ms
57,096 KB
testcase_03 AC 158 ms
56,968 KB
testcase_04 AC 157 ms
57,108 KB
testcase_05 AC 158 ms
56,884 KB
testcase_06 AC 159 ms
57,288 KB
testcase_07 AC 162 ms
57,096 KB
testcase_08 AC 158 ms
56,932 KB
testcase_09 AC 157 ms
57,080 KB
testcase_10 AC 159 ms
56,772 KB
testcase_11 AC 159 ms
55,036 KB
testcase_12 AC 157 ms
57,136 KB
testcase_13 AC 161 ms
57,204 KB
testcase_14 AC 160 ms
56,876 KB
testcase_15 AC 160 ms
57,056 KB
testcase_16 AC 162 ms
57,148 KB
testcase_17 AC 162 ms
57,532 KB
testcase_18 AC 161 ms
57,144 KB
testcase_19 AC 162 ms
57,140 KB
testcase_20 AC 158 ms
56,844 KB
testcase_21 AC 160 ms
56,664 KB
testcase_22 AC 162 ms
57,000 KB
testcase_23 AC 161 ms
57,184 KB
testcase_24 AC 161 ms
56,848 KB
testcase_25 AC 160 ms
56,940 KB
testcase_26 AC 162 ms
57,220 KB
testcase_27 AC 160 ms
57,272 KB
testcase_28 AC 159 ms
56,932 KB
testcase_29 AC 160 ms
56,896 KB
testcase_30 AC 158 ms
57,236 KB
testcase_31 AC 160 ms
56,852 KB
testcase_32 AC 160 ms
57,124 KB
testcase_33 AC 162 ms
57,104 KB
testcase_34 AC 161 ms
57,244 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import static java.lang.System.*;

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();
		
		//日本の時刻(分)
		int japan = h*60+m;
		
		//X国の時刻を求める
		//余計な部分を取り除く
		int dif = (int)(Double.parseDouble(s.replaceAll("[UTC+]",""))*60);
		
		//日本時間の9を引いてやることによって、
		//X国の現在時刻が日本とどれだけずれているかが求まる。
		dif = dif-540;
		
		//X国の時刻(分)
		int x = japan+(int)dif;
		
		//以下、これを時と分の表記に直す
		x %= 1440;
		if (x<0) {
			x += 1440;
		}
		int H = x/60;
		int M = x%60;
		
		//直せたので、あとは出力するだけ
		String ans = "";
		if (H < 10) {ans += "0";}
		ans += H + ":";
		if (M < 10) {ans += "0";}
		ans += M;
		out.println(ans);
	}
}
0