結果

問題 No.652 E869120 and TimeZone
ユーザー 37zigen
提出日時 2020-03-19 01:34:12
言語 Java
(openjdk 23)
結果
AC  
実行時間 158 ms / 1,000 ms
コード長 629 bytes
コンパイル時間 2,452 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 42,660 KB
最終ジャッジ日時 2024-06-11 12:32:33
合計ジャッジ時間 8,122 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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(String.format("%02d",h)+":"+String.format("%02d", m));
	}

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