結果

問題 No.1570 Blocks
ユーザー MaboyMaboy
提出日時 2021-06-28 17:38:40
言語 Swift
(5.10.0)
結果
WA  
実行時間 -
コード長 371 bytes
コンパイル時間 8,242 ms
コンパイル使用メモリ 138,360 KB
実行使用メモリ 21,140 KB
最終ジャッジ日時 2023-09-07 18:45:55
合計ジャッジ時間 19,148 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
8,252 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 345 ms
17,200 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 267 ms
15,536 KB
testcase_07 WA -
testcase_08 AC 337 ms
16,984 KB
testcase_09 AC 395 ms
18,072 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 402 ms
18,268 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 167 ms
12,708 KB
testcase_18 WA -
testcase_19 AC 175 ms
12,560 KB
testcase_20 WA -
testcase_21 AC 305 ms
16,292 KB
testcase_22 WA -
testcase_23 AC 4 ms
8,220 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 3 ms
8,344 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 3 ms
8,212 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 412 ms
18,416 KB
testcase_34 WA -
testcase_35 AC 396 ms
18,436 KB
testcase_36 WA -
testcase_37 AC 388 ms
17,824 KB
testcase_38 AC 388 ms
18,020 KB
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 407 ms
18,248 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

let n = Int(readLine()!)!
var ab = [[Int]]()
for _ in 0..<n{
    ab += [readLine()!.split(separator: " ").map{Int($0)!}]
}
var d = [Int:[Int]]()
for i in ab{
    d[i[0] + i[1]] = i
}
var k : Array = Array(d.keys)
k.sort(){$0 < $1}

var s = 0
var t = ""
for i in k{
    if s > d[i]![1]{
        t = "No"
        break
    }else{
        s += d[i]![0]
    }
}
print("Yes")
0