結果
問題 | No.5011 Better Mo's Algorithm is Needed!! (Weighted) |
ユーザー | ansain |
提出日時 | 2022-12-17 15:42:25 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 647 ms / 5,000 ms |
コード長 | 1,622 bytes |
コンパイル時間 | 1,305 ms |
実行使用メモリ | 154,360 KB |
スコア | 22,016,410,312 |
最終ジャッジ日時 | 2022-12-17 15:44:26 |
合計ジャッジ時間 | 117,072 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 632 ms
153,256 KB |
testcase_01 | AC | 617 ms
152,884 KB |
testcase_02 | AC | 640 ms
154,084 KB |
testcase_03 | AC | 647 ms
153,212 KB |
testcase_04 | AC | 605 ms
153,032 KB |
testcase_05 | AC | 621 ms
153,240 KB |
testcase_06 | AC | 606 ms
153,036 KB |
testcase_07 | AC | 632 ms
153,148 KB |
testcase_08 | AC | 619 ms
153,284 KB |
testcase_09 | AC | 591 ms
153,180 KB |
testcase_10 | AC | 612 ms
153,156 KB |
testcase_11 | AC | 597 ms
153,188 KB |
testcase_12 | AC | 608 ms
153,012 KB |
testcase_13 | AC | 590 ms
153,188 KB |
testcase_14 | AC | 611 ms
152,896 KB |
testcase_15 | AC | 582 ms
153,292 KB |
testcase_16 | AC | 636 ms
153,332 KB |
testcase_17 | AC | 606 ms
152,920 KB |
testcase_18 | AC | 642 ms
153,088 KB |
testcase_19 | AC | 593 ms
153,076 KB |
testcase_20 | AC | 597 ms
153,412 KB |
testcase_21 | AC | 595 ms
153,120 KB |
testcase_22 | AC | 611 ms
153,212 KB |
testcase_23 | AC | 592 ms
153,084 KB |
testcase_24 | AC | 591 ms
153,188 KB |
testcase_25 | AC | 629 ms
152,896 KB |
testcase_26 | AC | 596 ms
153,132 KB |
testcase_27 | AC | 638 ms
152,900 KB |
testcase_28 | AC | 586 ms
153,096 KB |
testcase_29 | AC | 597 ms
153,116 KB |
testcase_30 | AC | 579 ms
153,060 KB |
testcase_31 | AC | 604 ms
153,248 KB |
testcase_32 | AC | 619 ms
153,292 KB |
testcase_33 | AC | 599 ms
153,104 KB |
testcase_34 | AC | 626 ms
153,048 KB |
testcase_35 | AC | 590 ms
153,144 KB |
testcase_36 | AC | 617 ms
154,220 KB |
testcase_37 | AC | 619 ms
154,184 KB |
testcase_38 | AC | 607 ms
153,152 KB |
testcase_39 | AC | 610 ms
153,256 KB |
testcase_40 | AC | 637 ms
152,924 KB |
testcase_41 | AC | 602 ms
153,288 KB |
testcase_42 | AC | 596 ms
153,232 KB |
testcase_43 | AC | 616 ms
153,064 KB |
testcase_44 | AC | 594 ms
153,244 KB |
testcase_45 | AC | 587 ms
153,080 KB |
testcase_46 | AC | 601 ms
153,184 KB |
testcase_47 | AC | 587 ms
153,108 KB |
testcase_48 | AC | 600 ms
153,260 KB |
testcase_49 | AC | 592 ms
153,108 KB |
testcase_50 | AC | 632 ms
153,132 KB |
testcase_51 | AC | 615 ms
152,940 KB |
testcase_52 | AC | 635 ms
153,136 KB |
testcase_53 | AC | 620 ms
153,268 KB |
testcase_54 | AC | 600 ms
154,164 KB |
testcase_55 | AC | 619 ms
153,112 KB |
testcase_56 | AC | 606 ms
153,012 KB |
testcase_57 | AC | 587 ms
152,904 KB |
testcase_58 | AC | 621 ms
153,124 KB |
testcase_59 | AC | 593 ms
152,924 KB |
testcase_60 | AC | 630 ms
153,208 KB |
testcase_61 | AC | 605 ms
153,172 KB |
testcase_62 | AC | 609 ms
153,108 KB |
testcase_63 | AC | 573 ms
153,088 KB |
testcase_64 | AC | 601 ms
152,820 KB |
testcase_65 | AC | 595 ms
153,156 KB |
testcase_66 | AC | 593 ms
153,148 KB |
testcase_67 | AC | 619 ms
153,244 KB |
testcase_68 | AC | 578 ms
153,076 KB |
testcase_69 | AC | 617 ms
153,236 KB |
testcase_70 | AC | 579 ms
153,128 KB |
testcase_71 | AC | 603 ms
153,156 KB |
testcase_72 | AC | 603 ms
152,928 KB |
testcase_73 | AC | 601 ms
153,176 KB |
testcase_74 | AC | 606 ms
152,924 KB |
testcase_75 | AC | 613 ms
153,060 KB |
testcase_76 | AC | 605 ms
154,180 KB |
testcase_77 | AC | 607 ms
153,140 KB |
testcase_78 | AC | 611 ms
153,400 KB |
testcase_79 | AC | 617 ms
153,204 KB |
testcase_80 | AC | 612 ms
153,268 KB |
testcase_81 | AC | 590 ms
153,116 KB |
testcase_82 | AC | 585 ms
153,132 KB |
testcase_83 | AC | 580 ms
153,104 KB |
testcase_84 | AC | 603 ms
153,068 KB |
testcase_85 | AC | 644 ms
153,164 KB |
testcase_86 | AC | 592 ms
152,924 KB |
testcase_87 | AC | 612 ms
153,152 KB |
testcase_88 | AC | 595 ms
153,152 KB |
testcase_89 | AC | 608 ms
152,884 KB |
testcase_90 | AC | 609 ms
153,092 KB |
testcase_91 | AC | 615 ms
153,132 KB |
testcase_92 | AC | 592 ms
152,872 KB |
testcase_93 | AC | 574 ms
153,240 KB |
testcase_94 | AC | 607 ms
153,140 KB |
testcase_95 | AC | 589 ms
153,236 KB |
testcase_96 | AC | 611 ms
152,912 KB |
testcase_97 | AC | 596 ms
153,116 KB |
testcase_98 | AC | 594 ms
153,096 KB |
testcase_99 | AC | 622 ms
153,132 KB |
testcase_100 | AC | 593 ms
153,144 KB |
testcase_101 | AC | 613 ms
152,972 KB |
testcase_102 | AC | 579 ms
153,232 KB |
testcase_103 | AC | 572 ms
152,984 KB |
testcase_104 | AC | 616 ms
153,300 KB |
testcase_105 | AC | 611 ms
153,272 KB |
testcase_106 | AC | 603 ms
153,344 KB |
testcase_107 | AC | 617 ms
154,360 KB |
testcase_108 | AC | 607 ms
153,088 KB |
testcase_109 | AC | 595 ms
153,280 KB |
testcase_110 | AC | 605 ms
152,992 KB |
testcase_111 | AC | 571 ms
153,172 KB |
testcase_112 | AC | 606 ms
153,204 KB |
testcase_113 | AC | 588 ms
153,020 KB |
testcase_114 | AC | 597 ms
153,260 KB |
testcase_115 | AC | 579 ms
153,268 KB |
testcase_116 | AC | 588 ms
153,228 KB |
testcase_117 | AC | 608 ms
153,156 KB |
testcase_118 | AC | 605 ms
154,304 KB |
testcase_119 | AC | 610 ms
153,056 KB |
ソースコード
import sys from collections import defaultdict, Counter, deque from itertools import permutations, combinations, product, combinations_with_replacement, groupby, accumulate import operator from math import sqrt, gcd, factorial, ceil #from math import isqrt, prod, comb #python3.8用(notpypy) #from bisect import bisect_left, bisect_right #from functools import lru_cache, reduce #from heapq import heappush, heappop, heapify, heappushpop, heapreplace #import numpy as np #import networkx as nx #from networkx.utils import UnionFind #from numba import njit, b1, i1, i4, i8, f8 #numba例 @njit(i1(i4[:], i8[:, :]),cache=True) 引数i4配列、i8 2次元配列,戻り値i1 #from scipy.sparse import csr_matrix #from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, NegativeCycleError, maximum_bipartite_matching, maximum_flow, minimum_spanning_tree def input(): return sys.stdin.readline().rstrip() def divceil(n, k): return 1+(n-1)//k # n/kの切り上げを返す def yn(hantei, yes='Yes', no='No'): print(yes if hantei else no) def main(): mod = 10**9+7 mod2 = 998244353 n,q,wt,st=map(int, input().split()) w=list(map(int, input().split())) lr=[list(map(int, input().split())) + [i+1] for i in range(q)] b = ceil(sqrt(q)) bucket = [list() for _ in range(b + 1)] for l,r,i in lr: bucket[l // b].append((l, r, i)) for i in range(len(bucket)): bucket[i].sort(key=operator.itemgetter(1)) ans=[] for b in bucket: for l,r,i in b: ans.append(i) print(*ans) if __name__ == '__main__': main()