結果

問題 No.3090 Knapsack Function
ユーザー jakuwtnbjakuwtnb
提出日時 2022-04-01 22:19:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 216 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 289 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 90,208 KB
最終ジャッジ日時 2023-08-12 19:21:27
合計ジャッジ時間 3,762 ms
ジャッジサーバーID
(参考情報)
judge7 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,332 KB
testcase_01 AC 70 ms
71,420 KB
testcase_02 AC 68 ms
70,932 KB
testcase_03 AC 69 ms
70,936 KB
testcase_04 AC 69 ms
71,184 KB
testcase_05 AC 68 ms
71,192 KB
testcase_06 AC 70 ms
70,940 KB
testcase_07 AC 72 ms
71,332 KB
testcase_08 AC 73 ms
71,368 KB
testcase_09 AC 72 ms
71,292 KB
testcase_10 AC 74 ms
71,372 KB
testcase_11 AC 73 ms
70,936 KB
testcase_12 AC 73 ms
71,300 KB
testcase_13 AC 72 ms
71,032 KB
testcase_14 AC 72 ms
71,368 KB
testcase_15 AC 71 ms
71,372 KB
testcase_16 AC 216 ms
89,632 KB
testcase_17 AC 183 ms
89,932 KB
testcase_18 AC 203 ms
90,208 KB
testcase_19 AC 209 ms
89,628 KB
testcase_20 AC 207 ms
90,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
L=[[] for i in range(N)]
V=0
for i in range(N):
    L[i]=list(map(int,input().split()))
    if L[i][1]==1:
        V=max(L[i][0],V)
flag=1
if V==0:
    flag=0
for i in range(N):
    if L[i][0]<V*L[i][1]+V:
        flag=1
    else:
        flag=0
if flag:
    print("Yes")
else:
    print("No")
0