結果
問題 | No.1279 Array Battle |
ユーザー | akitsugu777 |
提出日時 | 2020-12-15 11:21:32 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 420 bytes |
コンパイル時間 | 478 ms |
コンパイル使用メモリ | 11,780 KB |
実行使用メモリ | 24,384 KB |
最終ジャッジ日時 | 2023-10-20 05:54:10 |
合計ジャッジ時間 | 10,697 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 29 ms
10,068 KB |
testcase_01 | AC | 28 ms
10,068 KB |
testcase_02 | AC | 33 ms
10,068 KB |
testcase_03 | AC | 28 ms
10,068 KB |
testcase_04 | AC | 29 ms
10,068 KB |
testcase_05 | AC | 28 ms
10,068 KB |
testcase_06 | AC | 29 ms
10,068 KB |
testcase_07 | AC | 29 ms
10,068 KB |
testcase_08 | AC | 28 ms
10,068 KB |
testcase_09 | AC | 28 ms
10,068 KB |
testcase_10 | AC | 30 ms
10,068 KB |
testcase_11 | AC | 34 ms
10,088 KB |
testcase_12 | AC | 60 ms
10,260 KB |
testcase_13 | AC | 312 ms
11,744 KB |
testcase_14 | AC | 311 ms
11,564 KB |
testcase_15 | TLE | - |
testcase_16 | TLE | - |
testcase_17 | TLE | - |
testcase_18 | TLE | - |
testcase_19 | TLE | - |
ソースコード
from itertools import permutations N = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) L = [] for b in permutations(B): TOTAL = 0 for i, j in zip(A, b): TOTAL += [0, i-j][i > j] L += [TOTAL] MAX = max(L) ANS = 0 for b in permutations(B): TOTAL = 0 for i, j in zip(A, b): TOTAL += [0, i-j][i > j] if TOTAL == MAX: ANS += 1 print(ANS)