結果
| 問題 | No.1279 Array Battle |
| コンテスト | |
| ユーザー |
harurun
|
| 提出日時 | 2021-02-05 01:09:10 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 348 ms / 2,000 ms |
| コード長 | 413 bytes |
| 記録 | |
| コンパイル時間 | 526 ms |
| コンパイル使用メモリ | 20,956 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-03-22 00:48:47 |
| 合計ジャッジ時間 | 4,810 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
from itertools import permutations
from sys import stdin
pin=stdin.readline
def main():
N=int(pin())
a=list(map(int,pin().split()))
b=list(map(int,pin().split()))
p=permutations(list(range(N)))
ans=0
cnt=0
for i in p:
sc=0
for j in range(N):
if a[i[j]]>b[j]:
sc+=a[i[j]]-b[j]
if sc==ans:
cnt+=1
elif sc>ans:
ans=sc
cnt=1
print(cnt)
return
main()
harurun