結果
| 問題 |
No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-09-06 18:58:12 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 262 bytes |
| コンパイル時間 | 327 ms |
| コンパイル使用メモリ | 11,904 KB |
| 実行使用メモリ | 10,368 KB |
| 最終ジャッジ日時 | 2025-09-06 18:58:17 |
| 合計ジャッジ時間 | 4,020 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 24 |
ソースコード
from itertools import permutations
N = int(input())
P = [tuple(map(int, input().split())) for _ in range(N)]
ans = N*~-N//2
for p in permutations(P):
ng = 0
for i in range(N-1):
if p[i][1] < p[-~i][0]:
ng |= 1
ans -= ng
print(ans)