結果

問題 No.652 E869120 and TimeZone
ユーザー neko_the_shadowneko_the_shadow
提出日時 2019-06-05 23:18:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 132 ms / 1,000 ms
コード長 647 bytes
コンパイル時間 2,741 ms
コンパイル使用メモリ 78,832 KB
実行使用メモリ 56,544 KB
最終ジャッジ日時 2023-09-02 05:33:15
合計ジャッジ時間 8,435 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
55,868 KB
testcase_01 AC 121 ms
55,972 KB
testcase_02 AC 120 ms
55,804 KB
testcase_03 AC 120 ms
56,336 KB
testcase_04 AC 122 ms
56,188 KB
testcase_05 AC 122 ms
55,740 KB
testcase_06 AC 123 ms
56,284 KB
testcase_07 AC 126 ms
56,544 KB
testcase_08 AC 124 ms
56,204 KB
testcase_09 AC 124 ms
56,252 KB
testcase_10 AC 124 ms
55,864 KB
testcase_11 AC 125 ms
56,340 KB
testcase_12 AC 125 ms
56,136 KB
testcase_13 AC 127 ms
56,040 KB
testcase_14 AC 130 ms
55,928 KB
testcase_15 AC 122 ms
56,124 KB
testcase_16 AC 123 ms
56,172 KB
testcase_17 AC 128 ms
55,924 KB
testcase_18 AC 122 ms
56,016 KB
testcase_19 AC 123 ms
56,008 KB
testcase_20 AC 126 ms
56,192 KB
testcase_21 AC 123 ms
56,296 KB
testcase_22 AC 123 ms
56,068 KB
testcase_23 AC 124 ms
56,104 KB
testcase_24 AC 123 ms
55,932 KB
testcase_25 AC 123 ms
56,000 KB
testcase_26 AC 132 ms
55,768 KB
testcase_27 AC 123 ms
55,804 KB
testcase_28 AC 122 ms
55,936 KB
testcase_29 AC 123 ms
56,240 KB
testcase_30 AC 123 ms
56,368 KB
testcase_31 AC 123 ms
56,372 KB
testcase_32 AC 122 ms
55,804 KB
testcase_33 AC 124 ms
56,284 KB
testcase_34 AC 122 ms
56,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigDecimal;
import java.time.LocalTime;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int a = stdin.nextInt();
        int b = stdin.nextInt();
        String s = stdin.next();

        char op = s.charAt(3);
        BigDecimal hour = new BigDecimal(s.substring(4));
        
        long minute = hour.multiply(BigDecimal.valueOf(60)).longValue();
        if (op == '-') {
            minute *= -1;
        }
        LocalTime ans = LocalTime.of(a, b).plusMinutes(minute).minusHours(9);
        System.out.println(ans);
    }
}
0