結果

問題 No.652 E869120 and TimeZone
ユーザー tsuchinagatsuchinaga
提出日時 2019-04-15 16:29:36
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 613 bytes
コンパイル時間 11,524 ms
コンパイル使用メモリ 224,444 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-22 06:40:51
合計ジャッジ時間 14,466 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 1 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 1 ms
4,348 KB
testcase_23 AC 1 ms
4,348 KB
testcase_24 AC 1 ms
4,348 KB
testcase_25 AC 1 ms
4,348 KB
testcase_26 AC 2 ms
4,348 KB
testcase_27 WA -
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 1 ms
4,348 KB
testcase_30 AC 1 ms
4,348 KB
testcase_31 AC 1 ms
4,348 KB
testcase_32 AC 1 ms
4,348 KB
testcase_33 AC 2 ms
4,348 KB
testcase_34 AC 1 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	sc.Scan()
	a, _ := strconv.Atoi(sc.Text())

	sc.Scan()
	b, _ := strconv.Atoi(sc.Text())

	sc.Scan()
	s := sc.Text()
	tz, _ := strconv.ParseFloat(strings.Trim(s, "UTC"), 64)

	// まず9時間前にする
	a = (a + 24 - 9) % 24
	// fmt.Println(a, b, tz)

	// 別の国のtimezoneを反映
	b = b + int((tz-float64(int(tz)))*60)
	if b >= 60 {
		a, b = a+1, b-60
	} else if b < 0 {
		a, b = a-1, b+60
	}
	a = (a + int(tz) + 24) % 24

	fmt.Printf("%02d:%02d\n", a, b)
}
0