結果
問題 | No.188 HAPPY DAY |
ユーザー | ゆうP |
提出日時 | 2024-03-09 12:09:43 |
言語 | Go (1.22.1) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 409 bytes |
コンパイル時間 | 14,295 ms |
コンパイル使用メモリ | 221,396 KB |
実行使用メモリ | 6,676 KB |
最終ジャッジ日時 | 2024-03-09 12:09:59 |
合計ジャッジ時間 | 14,941 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
ソースコード
// No.188 HAPPY DAY package main import ( "fmt" "strconv" "time" ) func main() { start := time.Date(2015, 1, 1, 0, 0, 0, 0, time.UTC) var ans int = 0 for i := 0; i < 365; i++ { _, m, d := start.AddDate(0, 0, i).Date() d1, _ := strconv.Atoi(string(fmt.Sprintf("%02d", d)[0])) d2, _ := strconv.Atoi(string(fmt.Sprintf("%02d", d)[1])) if int(m) == (d1 + d2) { ans++ } } fmt.Println(ans) }