結果
| 問題 |
No.133 カードゲーム
|
| コンテスト | |
| ユーザー |
ディグ田
|
| 提出日時 | 2020-04-16 14:00:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 55 ms / 5,000 ms |
| コード長 | 435 bytes |
| コンパイル時間 | 309 ms |
| コンパイル使用メモリ | 82,304 KB |
| 実行使用メモリ | 60,544 KB |
| 最終ジャッジ日時 | 2024-10-01 19:16:35 |
| 合計ジャッジ時間 | 2,309 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 19 |
ソースコード
import itertools n = int(input()) A = list(map(int, input().split())) B = list(map(int, input().split())) a_rate_numerator = 0 count = 0 for a in itertools.permutations(A, n): for b in itertools.permutations(B, n): count += 1 a_score = 0 b_score = 0 for i in range(n): if a[i] > b[i]: a_score += 1 elif b[i] > a[i]: b_score += 1 if a_score > b_score: a_rate_numerator += 1 print(a_rate_numerator / count)
ディグ田