結果

問題 No.231 めぐるはめぐる (1)
ユーザー バカらっくバカらっく
提出日時 2018-03-02 15:49:43
言語 Swift
(5.10.0)
結果
AC  
実行時間 10 ms / 1,000 ms
コード長 469 bytes
コンパイル時間 2,053 ms
コンパイル使用メモリ 131,232 KB
実行使用メモリ 9,344 KB
最終ジャッジ日時 2024-05-07 17:24:02
合計ジャッジ時間 2,371 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
9,344 KB
testcase_01 AC 8 ms
8,960 KB
testcase_02 AC 8 ms
8,832 KB
testcase_03 AC 10 ms
9,344 KB
testcase_04 AC 10 ms
9,216 KB
testcase_05 AC 9 ms
8,832 KB
testcase_06 AC 10 ms
9,088 KB
testcase_07 AC 8 ms
9,216 KB
testcase_08 AC 8 ms
9,216 KB
testcase_09 AC 9 ms
9,216 KB
testcase_10 AC 8 ms
9,216 KB
testcase_11 AC 8 ms
8,960 KB
testcase_12 AC 9 ms
9,216 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.swift:18:9: warning: immutable value 'i' was never used; consider replacing with '_' or removing it
    for i in 0..<6 {
        ^
        _

ソースコード

diff #

let dungeonCount = Int(readLine()!)!
let dethpena = 30000

var maxKouritu = 0
var maxKourituIdx = -1

for i in 1...dungeonCount {
    let inpt = readLine()!.split(separator: " ").map{Int($0)!}
    let kouritu = inpt[0] - (dethpena * inpt[1])
    if(kouritu > maxKouritu) {
        maxKouritu = kouritu
        maxKourituIdx = i
    }
}

if(maxKouritu*6>=dethpena*100) {
    print("YES")
    for i in 0..<6 {
        print(maxKourituIdx)
    }
} else {
    print("NO")
}
0