結果

問題 No.652 E869120 and TimeZone
ユーザー 37zigen
提出日時 2020-03-19 01:32:17
言語 Java
(openjdk 23)
結果
AC  
実行時間 165 ms / 1,000 ms
コード長 612 bytes
コンパイル時間 2,527 ms
コンパイル使用メモリ 80,456 KB
実行使用メモリ 43,240 KB
最終ジャッジ日時 2024-06-11 12:32:05
合計ジャッジ時間 7,887 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		new Main().run();
	}
	
	void run() {
		Scanner sc = new Scanner(System.in);
		int h=sc.nextInt();
		int m=sc.nextInt();
		String str=sc.next();
		str=str.substring(3, str.length());
		int add_m=(int)(Math.round(Double.valueOf(str)*60));
		m+=add_m;
		h=(h+m/60-9+24)%24;
		m%=60;
		if(m<0) {
			m+=60;
			h=(h-1+24)%24;
		}
		System.out.println((h<10?"0":"")+h+":"+(m<10?"0":"")+m);
	}

	void tr(Object... objects) {
		System.out.println(Arrays.deepToString(objects));
	}
}
0