結果
問題 | No.5004 Room Assignment |
ユーザー |
![]() |
提出日時 | 2021-12-01 00:23:49 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 501 ms / 5,000 ms |
コード長 | 505 bytes |
コンパイル時間 | 197 ms |
実行使用メモリ | 102,964 KB |
スコア | 7,304,446 |
平均クエリ数 | 6275.71 |
最終ジャッジ日時 | 2021-12-01 00:24:51 |
合計ジャッジ時間 | 48,460 ms |
ジャッジサーバーID (参考情報) |
judge10 / judge12 |
純コード判定しない問題か言語 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 100 |
ソースコード
t,r = map(int,input().split()) p = 1 for _ in range(t): n,*S = map(int,input().split()) L = [] stack = [] for _,i in sorted([(s,i) for i,s in enumerate(S,p)]): stack.append(i) if len(stack) == r: for j in range(len(stack)-1): L.append((stack[j],stack[j+1])) stack.clear() for j in range(len(stack)-1): L.append((stack[j],stack[j+1])) print(len(L),flush=True) for u,v in L: print(u,v,flush=True) p += n