結果
| 問題 |
No.1279 Array Battle
|
| コンテスト | |
| ユーザー |
tamato
|
| 提出日時 | 2020-11-06 21:24:06 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 92 ms / 2,000 ms |
| コード長 | 554 bytes |
| コンパイル時間 | 365 ms |
| コンパイル使用メモリ | 82,540 KB |
| 実行使用メモリ | 75,980 KB |
| 最終ジャッジ日時 | 2024-07-22 12:02:31 |
| 合計ジャッジ時間 | 2,036 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
mod = 1000000007
eps = 10**-9
def main():
import sys
from itertools import permutations
input = sys.stdin.readline
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ma = 0
cnt = 0
for P in permutations(A):
tmp = 0
for i, a in enumerate(P):
if a > B[i]:
tmp += a - B[i]
if tmp == ma:
cnt += 1
elif tmp > ma:
ma = tmp
cnt = 1
print(cnt)
if __name__ == '__main__':
main()
tamato