結果
問題 |
No.3262 水色コーダーさん、その問題d問題ですよ?(1<=d<=N)
|
ユーザー |
![]() |
提出日時 | 2025-09-06 13:35:29 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 79 ms / 2,000 ms |
コード長 | 600 bytes |
コンパイル時間 | 196 ms |
コンパイル使用メモリ | 82,104 KB |
実行使用メモリ | 72,284 KB |
最終ジャッジ日時 | 2025-09-06 13:35:33 |
合計ジャッジ時間 | 2,882 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 24 |
ソースコード
from collections import deque, defaultdict, Counter from bisect import bisect_left, bisect_right from itertools import permutations, combinations from heapq import heappop, heappush import math, sys # input = sys.stdin.readline _int = lambda x: int(x)-1 MOD = 998244353 #10**9+7 INF = 1<<60 Yes, No = "Yes", "No" N = int(input()) LR = [] for _ in range(N): l, r = map(int, input().split()) LR.append((l, r)) ans = 0 for p in permutations(range(N)): x = 0 for i in range(N): l, r = LR[p[i]] if x > r: break x = max(x, l) else: ans += 1 print(ans)