結果
| 問題 | No.188 HAPPY DAY |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-01-31 17:47:09 |
| 言語 | Swift (6.2.4) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 489 bytes |
| 記録 | |
| コンパイル時間 | 997 ms |
| コンパイル使用メモリ | 143,256 KB |
| 実行使用メモリ | 9,600 KB |
| 最終ジャッジ日時 | 2026-05-24 07:09:34 |
| 合計ジャッジ時間 | 1,721 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
コンパイルメッセージ
Main.swift:3:9: warning: immutable value 'd' was never used; consider replacing with '_' or removing it [#no-usage]
1 | func hoge(_ m: Int, _ dayCount: Int) -> Int {
2 | var count: Int = 0
3 | for d in 1...dayCount {
| `- warning: immutable value 'd' was never used; consider replacing with '_' or removing it [#no-usage]
4 | if dayCount < 10 { continue }
5 | let s = "\(dayCount)"
ソースコード
func hoge(_ m: Int, _ dayCount: Int) -> Int {
var count: Int = 0
for d in 1...dayCount {
if dayCount < 10 { continue }
let s = "\(dayCount)"
let former = Int(String(s[s.startIndex]))!
let latter = Int(String(s.suffix(1)))!
if m == former + latter { count += 1 }
}
return count
}
let eoms = [31,28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
var counts = 0
for (i, eom) in eoms.enumerated() {
counts += hoge(i, eom)
}
print(counts)