結果
問題 |
No.216 FAC
|
ユーザー |
|
提出日時 | 2021-12-01 23:05:17 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 1,000 ms |
コード長 | 327 bytes |
コンパイル時間 | 183 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-05 00:54:30 |
合計ジャッジ時間 | 1,809 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
n=int(input()) sl=list(map(int,input().split())) tl=input().split() d={} for i in range(n): if tl[i] not in d: d[tl[i]]=sl[i] else: d[tl[i]]+=sl[i] dic2 = sorted(d.items(), key=lambda x:x[1], reverse=True) if '0' not in d: print("NO") elif d['0']==dic2[0][1]: print("YES") else: print("NO")