結果
問題 | No.652 E869120 and TimeZone |
ユーザー |
![]() |
提出日時 | 2019-04-15 16:32:22 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 700 bytes |
コンパイル時間 | 9,977 ms |
コンパイル使用メモリ | 233,416 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-11 12:29:34 |
合計ジャッジ時間 | 10,895 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 30 |
ソースコード
package mainimport ("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*10-float64(int(tz))*10)*60)/10// fmt.Println(tz, float64(int(tz)), int((tz*10-float64(int(tz))*10)*60)/10)if b >= 60 {a, b = a+1, b-60} else if b < 0 {a, b = a-1, b+60}a = (a + int(tz) + 24) % 24fmt.Printf("%02d:%02d\n", a, b)}