結果

問題 No.5004 Room Assignment
ユーザー Eki1009Eki1009
提出日時 2021-12-01 00:33:30
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 541 ms / 5,000 ms
コード長 561 bytes
コンパイル時間 244 ms
実行使用メモリ 104,280 KB
スコア 18,972,329
平均クエリ数 4974.23
最終ジャッジ日時 2021-12-01 00:34:26
合計ジャッジ時間 55,906 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
純コード判定しない問題か言語
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 519 ms
100,936 KB
testcase_01 AC 531 ms
100,576 KB
testcase_02 AC 477 ms
99,428 KB
testcase_03 AC 530 ms
101,268 KB
testcase_04 AC 498 ms
101,892 KB
testcase_05 AC 463 ms
100,148 KB
testcase_06 AC 502 ms
101,568 KB
testcase_07 AC 510 ms
99,512 KB
testcase_08 AC 504 ms
101,044 KB
testcase_09 AC 482 ms
99,720 KB
testcase_10 AC 499 ms
102,256 KB
testcase_11 AC 495 ms
99,684 KB
testcase_12 AC 533 ms
101,316 KB
testcase_13 AC 500 ms
100,820 KB
testcase_14 AC 504 ms
98,600 KB
testcase_15 AC 510 ms
98,284 KB
testcase_16 AC 541 ms
104,280 KB
testcase_17 AC 483 ms
99,408 KB
testcase_18 AC 498 ms
99,376 KB
testcase_19 AC 514 ms
103,720 KB
testcase_20 AC 503 ms
97,740 KB
testcase_21 AC 472 ms
99,548 KB
testcase_22 AC 510 ms
101,112 KB
testcase_23 AC 488 ms
100,332 KB
testcase_24 AC 518 ms
100,636 KB
testcase_25 AC 519 ms
99,032 KB
testcase_26 AC 479 ms
100,344 KB
testcase_27 AC 492 ms
98,708 KB
testcase_28 AC 502 ms
98,596 KB
testcase_29 AC 488 ms
99,864 KB
testcase_30 AC 475 ms
99,708 KB
testcase_31 AC 526 ms
101,948 KB
testcase_32 AC 463 ms
99,104 KB
testcase_33 AC 506 ms
99,940 KB
testcase_34 AC 505 ms
98,788 KB
testcase_35 AC 495 ms
99,548 KB
testcase_36 AC 484 ms
99,380 KB
testcase_37 AC 503 ms
100,172 KB
testcase_38 AC 522 ms
98,780 KB
testcase_39 AC 494 ms
98,980 KB
testcase_40 AC 486 ms
100,180 KB
testcase_41 AC 501 ms
100,068 KB
testcase_42 AC 447 ms
97,700 KB
testcase_43 AC 491 ms
100,488 KB
testcase_44 AC 508 ms
103,104 KB
testcase_45 AC 483 ms
100,680 KB
testcase_46 AC 510 ms
100,300 KB
testcase_47 AC 468 ms
97,856 KB
testcase_48 AC 474 ms
98,876 KB
testcase_49 AC 527 ms
99,076 KB
testcase_50 AC 504 ms
100,148 KB
testcase_51 AC 487 ms
99,404 KB
testcase_52 AC 513 ms
99,028 KB
testcase_53 AC 488 ms
99,460 KB
testcase_54 AC 493 ms
101,288 KB
testcase_55 AC 469 ms
99,464 KB
testcase_56 AC 497 ms
102,552 KB
testcase_57 AC 474 ms
100,156 KB
testcase_58 AC 491 ms
101,044 KB
testcase_59 AC 473 ms
98,912 KB
testcase_60 AC 501 ms
100,388 KB
testcase_61 AC 487 ms
100,272 KB
testcase_62 AC 464 ms
99,768 KB
testcase_63 AC 478 ms
100,084 KB
testcase_64 AC 482 ms
99,344 KB
testcase_65 AC 488 ms
98,848 KB
testcase_66 AC 470 ms
99,376 KB
testcase_67 AC 479 ms
99,276 KB
testcase_68 AC 475 ms
100,644 KB
testcase_69 AC 453 ms
99,112 KB
testcase_70 AC 499 ms
101,092 KB
testcase_71 AC 477 ms
98,964 KB
testcase_72 AC 503 ms
99,644 KB
testcase_73 AC 461 ms
98,800 KB
testcase_74 AC 431 ms
98,884 KB
testcase_75 AC 470 ms
100,012 KB
testcase_76 AC 489 ms
100,148 KB
testcase_77 AC 470 ms
97,808 KB
testcase_78 AC 454 ms
99,840 KB
testcase_79 AC 484 ms
100,676 KB
testcase_80 AC 506 ms
100,160 KB
testcase_81 AC 510 ms
102,304 KB
testcase_82 AC 494 ms
99,624 KB
testcase_83 AC 493 ms
97,792 KB
testcase_84 AC 501 ms
99,772 KB
testcase_85 AC 502 ms
100,864 KB
testcase_86 AC 473 ms
100,432 KB
testcase_87 AC 480 ms
100,396 KB
testcase_88 AC 482 ms
102,732 KB
testcase_89 AC 494 ms
99,568 KB
testcase_90 AC 495 ms
99,764 KB
testcase_91 AC 470 ms
99,444 KB
testcase_92 AC 486 ms
100,780 KB
testcase_93 AC 487 ms
100,940 KB
testcase_94 AC 476 ms
99,868 KB
testcase_95 AC 512 ms
102,444 KB
testcase_96 AC 489 ms
101,976 KB
testcase_97 AC 498 ms
100,184 KB
testcase_98 AC 471 ms
100,096 KB
testcase_99 AC 502 ms
97,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t,r = map(int,input().split())
p = 1
for _ in range(t):
    n,*S = map(int,input().split())
    L = []
    stack = []
    for s,i in sorted([(s,i) for i,s in enumerate(S,p)]):
        if (stack and abs(stack[0][1]-s) >= 15) or len(stack) == r:
            for j in range(len(stack)-1):
                L.append((stack[j][0],stack[j+1][0]))
            stack.clear()
        stack.append((i,s))
    for j in range(len(stack)-1):
        L.append((stack[j][0],stack[j+1][0]))
    print(len(L),flush=True)
    for u,v in L:
        print(u,v,flush=True)
    p += n
0