結果
問題 | No.5011 Better Mo's Algorithm is Needed!! (Weighted) |
ユーザー | titia |
提出日時 | 2022-12-17 02:52:41 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 1,013 ms / 5,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 64 ms |
実行使用メモリ | 66,160 KB |
スコア | 34,902,652,850 |
最終ジャッジ日時 | 2022-12-17 02:55:26 |
合計ジャッジ時間 | 158,366 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 953 ms
65,872 KB |
testcase_01 | AC | 974 ms
65,856 KB |
testcase_02 | AC | 954 ms
65,848 KB |
testcase_03 | AC | 957 ms
66,136 KB |
testcase_04 | AC | 957 ms
65,904 KB |
testcase_05 | AC | 921 ms
66,048 KB |
testcase_06 | AC | 978 ms
66,020 KB |
testcase_07 | AC | 940 ms
65,848 KB |
testcase_08 | AC | 958 ms
65,956 KB |
testcase_09 | AC | 941 ms
65,904 KB |
testcase_10 | AC | 957 ms
66,020 KB |
testcase_11 | AC | 959 ms
65,944 KB |
testcase_12 | AC | 924 ms
66,076 KB |
testcase_13 | AC | 960 ms
65,824 KB |
testcase_14 | AC | 962 ms
65,836 KB |
testcase_15 | AC | 921 ms
66,084 KB |
testcase_16 | AC | 950 ms
65,980 KB |
testcase_17 | AC | 928 ms
66,160 KB |
testcase_18 | AC | 941 ms
65,988 KB |
testcase_19 | AC | 974 ms
65,944 KB |
testcase_20 | AC | 939 ms
66,028 KB |
testcase_21 | AC | 957 ms
65,988 KB |
testcase_22 | AC | 957 ms
65,784 KB |
testcase_23 | AC | 953 ms
65,904 KB |
testcase_24 | AC | 940 ms
66,064 KB |
testcase_25 | AC | 964 ms
65,968 KB |
testcase_26 | AC | 962 ms
65,992 KB |
testcase_27 | AC | 978 ms
66,024 KB |
testcase_28 | AC | 951 ms
65,976 KB |
testcase_29 | AC | 955 ms
66,056 KB |
testcase_30 | AC | 958 ms
65,944 KB |
testcase_31 | AC | 952 ms
65,956 KB |
testcase_32 | AC | 951 ms
65,960 KB |
testcase_33 | AC | 962 ms
65,912 KB |
testcase_34 | AC | 960 ms
65,936 KB |
testcase_35 | AC | 984 ms
65,900 KB |
testcase_36 | AC | 972 ms
65,884 KB |
testcase_37 | AC | 960 ms
65,908 KB |
testcase_38 | AC | 1,013 ms
65,896 KB |
testcase_39 | AC | 953 ms
65,944 KB |
testcase_40 | AC | 939 ms
66,068 KB |
testcase_41 | AC | 977 ms
66,000 KB |
testcase_42 | AC | 950 ms
66,044 KB |
testcase_43 | AC | 965 ms
65,880 KB |
testcase_44 | AC | 963 ms
65,844 KB |
testcase_45 | AC | 943 ms
66,032 KB |
testcase_46 | AC | 993 ms
65,844 KB |
testcase_47 | AC | 954 ms
65,868 KB |
testcase_48 | AC | 960 ms
66,016 KB |
testcase_49 | AC | 973 ms
65,864 KB |
testcase_50 | AC | 931 ms
66,072 KB |
testcase_51 | AC | 974 ms
66,136 KB |
testcase_52 | AC | 960 ms
65,992 KB |
testcase_53 | AC | 951 ms
65,924 KB |
testcase_54 | AC | 993 ms
66,028 KB |
testcase_55 | AC | 933 ms
65,848 KB |
testcase_56 | AC | 950 ms
65,916 KB |
testcase_57 | AC | 971 ms
66,140 KB |
testcase_58 | AC | 948 ms
65,996 KB |
testcase_59 | AC | 990 ms
65,944 KB |
testcase_60 | AC | 950 ms
66,064 KB |
testcase_61 | AC | 978 ms
65,956 KB |
testcase_62 | AC | 987 ms
65,932 KB |
testcase_63 | AC | 953 ms
66,128 KB |
testcase_64 | AC | 991 ms
65,976 KB |
testcase_65 | AC | 940 ms
66,048 KB |
testcase_66 | AC | 977 ms
66,044 KB |
testcase_67 | AC | 967 ms
65,928 KB |
testcase_68 | AC | 960 ms
66,064 KB |
testcase_69 | AC | 972 ms
66,072 KB |
testcase_70 | AC | 991 ms
65,884 KB |
testcase_71 | AC | 965 ms
66,000 KB |
testcase_72 | AC | 983 ms
66,068 KB |
testcase_73 | AC | 961 ms
66,016 KB |
testcase_74 | AC | 939 ms
65,936 KB |
testcase_75 | AC | 987 ms
65,944 KB |
testcase_76 | AC | 964 ms
65,892 KB |
testcase_77 | AC | 943 ms
66,060 KB |
testcase_78 | AC | 965 ms
66,088 KB |
testcase_79 | AC | 943 ms
65,944 KB |
testcase_80 | AC | 958 ms
65,812 KB |
testcase_81 | AC | 949 ms
65,928 KB |
testcase_82 | AC | 957 ms
65,884 KB |
testcase_83 | AC | 957 ms
65,964 KB |
testcase_84 | AC | 967 ms
65,956 KB |
testcase_85 | AC | 970 ms
65,952 KB |
testcase_86 | AC | 968 ms
65,856 KB |
testcase_87 | AC | 938 ms
65,940 KB |
testcase_88 | AC | 930 ms
66,064 KB |
testcase_89 | AC | 945 ms
65,952 KB |
testcase_90 | AC | 944 ms
65,856 KB |
testcase_91 | AC | 948 ms
65,936 KB |
testcase_92 | AC | 955 ms
66,024 KB |
testcase_93 | AC | 964 ms
65,932 KB |
testcase_94 | AC | 941 ms
65,832 KB |
testcase_95 | AC | 958 ms
65,872 KB |
testcase_96 | AC | 946 ms
65,992 KB |
testcase_97 | AC | 940 ms
65,968 KB |
testcase_98 | AC | 952 ms
66,016 KB |
testcase_99 | AC | 945 ms
66,112 KB |
testcase_100 | AC | 961 ms
65,876 KB |
testcase_101 | AC | 966 ms
66,048 KB |
testcase_102 | AC | 931 ms
65,992 KB |
testcase_103 | AC | 935 ms
65,892 KB |
testcase_104 | AC | 992 ms
65,844 KB |
testcase_105 | AC | 944 ms
65,972 KB |
testcase_106 | AC | 960 ms
65,972 KB |
testcase_107 | AC | 942 ms
65,884 KB |
testcase_108 | AC | 967 ms
65,996 KB |
testcase_109 | AC | 936 ms
65,908 KB |
testcase_110 | AC | 921 ms
65,832 KB |
testcase_111 | AC | 970 ms
65,976 KB |
testcase_112 | AC | 953 ms
66,032 KB |
testcase_113 | AC | 966 ms
66,056 KB |
testcase_114 | AC | 955 ms
65,992 KB |
testcase_115 | AC | 938 ms
65,932 KB |
testcase_116 | AC | 951 ms
65,832 KB |
testcase_117 | AC | 932 ms
66,024 KB |
testcase_118 | AC | 952 ms
65,972 KB |
testcase_119 | AC | 989 ms
66,072 KB |
ソースコード
import sys input = sys.stdin.readline from operator import itemgetter 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)] LR.sort(key=itemgetter(0)) LIST=[[] for i in range(1000)] for x,y,ind in LR: LIST[x//447].append((y,ind)) ANS=[] count=0 for i in range(1000): if LIST[i]==[]: continue if count%2==0: LIST[i].sort(key=itemgetter(0)) else: LIST[i].sort(key=itemgetter(0),reverse=True) for _,ind in LIST[i]: ANS.append(ind) count+=1 print(*ANS)