結果
問題 | No.5011 Better Mo's Algorithm is Needed!! (Weighted) |
ユーザー | titia |
提出日時 | 2022-12-17 02:44:46 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 1,024 ms / 5,000 ms |
コード長 | 595 bytes |
コンパイル時間 | 393 ms |
実行使用メモリ | 66,124 KB |
スコア | 33,973,858,051 |
最終ジャッジ日時 | 2022-12-17 02:49:45 |
合計ジャッジ時間 | 158,938 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge15 |
純コード判定しない問題か言語 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 946 ms
66,040 KB |
testcase_01 | AC | 950 ms
65,900 KB |
testcase_02 | AC | 954 ms
65,832 KB |
testcase_03 | AC | 930 ms
66,008 KB |
testcase_04 | AC | 961 ms
65,868 KB |
testcase_05 | AC | 947 ms
65,920 KB |
testcase_06 | AC | 950 ms
65,888 KB |
testcase_07 | AC | 960 ms
65,788 KB |
testcase_08 | AC | 936 ms
65,896 KB |
testcase_09 | AC | 993 ms
66,004 KB |
testcase_10 | AC | 958 ms
65,820 KB |
testcase_11 | AC | 946 ms
65,944 KB |
testcase_12 | AC | 995 ms
65,984 KB |
testcase_13 | AC | 931 ms
65,888 KB |
testcase_14 | AC | 967 ms
65,912 KB |
testcase_15 | AC | 1,000 ms
66,060 KB |
testcase_16 | AC | 958 ms
65,964 KB |
testcase_17 | AC | 969 ms
65,984 KB |
testcase_18 | AC | 983 ms
65,992 KB |
testcase_19 | AC | 975 ms
65,972 KB |
testcase_20 | AC | 955 ms
65,920 KB |
testcase_21 | AC | 998 ms
65,896 KB |
testcase_22 | AC | 962 ms
65,920 KB |
testcase_23 | AC | 960 ms
65,988 KB |
testcase_24 | AC | 984 ms
65,844 KB |
testcase_25 | AC | 979 ms
65,972 KB |
testcase_26 | AC | 964 ms
65,952 KB |
testcase_27 | AC | 1,002 ms
66,040 KB |
testcase_28 | AC | 977 ms
65,908 KB |
testcase_29 | AC | 951 ms
66,032 KB |
testcase_30 | AC | 985 ms
65,964 KB |
testcase_31 | AC | 943 ms
65,940 KB |
testcase_32 | AC | 1,005 ms
65,892 KB |
testcase_33 | AC | 973 ms
65,980 KB |
testcase_34 | AC | 951 ms
65,956 KB |
testcase_35 | AC | 976 ms
65,932 KB |
testcase_36 | AC | 979 ms
65,816 KB |
testcase_37 | AC | 971 ms
65,824 KB |
testcase_38 | AC | 1,024 ms
65,912 KB |
testcase_39 | AC | 972 ms
66,028 KB |
testcase_40 | AC | 961 ms
65,976 KB |
testcase_41 | AC | 1,005 ms
66,100 KB |
testcase_42 | AC | 976 ms
65,856 KB |
testcase_43 | AC | 966 ms
65,892 KB |
testcase_44 | AC | 966 ms
65,860 KB |
testcase_45 | AC | 950 ms
65,964 KB |
testcase_46 | AC | 1,001 ms
65,856 KB |
testcase_47 | AC | 956 ms
65,976 KB |
testcase_48 | AC | 968 ms
65,868 KB |
testcase_49 | AC | 981 ms
65,904 KB |
testcase_50 | AC | 948 ms
65,824 KB |
testcase_51 | AC | 969 ms
66,124 KB |
testcase_52 | AC | 963 ms
65,992 KB |
testcase_53 | AC | 946 ms
65,968 KB |
testcase_54 | AC | 983 ms
65,908 KB |
testcase_55 | AC | 955 ms
65,856 KB |
testcase_56 | AC | 924 ms
65,828 KB |
testcase_57 | AC | 984 ms
66,068 KB |
testcase_58 | AC | 970 ms
65,800 KB |
testcase_59 | AC | 978 ms
65,920 KB |
testcase_60 | AC | 994 ms
65,896 KB |
testcase_61 | AC | 962 ms
65,944 KB |
testcase_62 | AC | 997 ms
65,884 KB |
testcase_63 | AC | 970 ms
66,060 KB |
testcase_64 | AC | 961 ms
66,040 KB |
testcase_65 | AC | 993 ms
66,044 KB |
testcase_66 | AC | 955 ms
65,824 KB |
testcase_67 | AC | 977 ms
65,780 KB |
testcase_68 | AC | 976 ms
66,004 KB |
testcase_69 | AC | 964 ms
66,008 KB |
testcase_70 | AC | 984 ms
65,804 KB |
testcase_71 | AC | 955 ms
66,000 KB |
testcase_72 | AC | 958 ms
65,912 KB |
testcase_73 | AC | 989 ms
65,956 KB |
testcase_74 | AC | 943 ms
65,800 KB |
testcase_75 | AC | 957 ms
65,888 KB |
testcase_76 | AC | 970 ms
65,900 KB |
testcase_77 | AC | 939 ms
65,960 KB |
testcase_78 | AC | 1,001 ms
65,900 KB |
testcase_79 | AC | 954 ms
65,872 KB |
testcase_80 | AC | 941 ms
65,868 KB |
testcase_81 | AC | 989 ms
65,844 KB |
testcase_82 | AC | 938 ms
65,896 KB |
testcase_83 | AC | 965 ms
65,920 KB |
testcase_84 | AC | 982 ms
65,860 KB |
testcase_85 | AC | 929 ms
65,792 KB |
testcase_86 | AC | 969 ms
65,812 KB |
testcase_87 | AC | 961 ms
65,976 KB |
testcase_88 | AC | 933 ms
65,896 KB |
testcase_89 | AC | 970 ms
66,020 KB |
testcase_90 | AC | 964 ms
65,836 KB |
testcase_91 | AC | 951 ms
65,788 KB |
testcase_92 | AC | 982 ms
65,868 KB |
testcase_93 | AC | 986 ms
65,840 KB |
testcase_94 | AC | 971 ms
65,912 KB |
testcase_95 | AC | 975 ms
65,820 KB |
testcase_96 | AC | 945 ms
66,044 KB |
testcase_97 | AC | 972 ms
66,000 KB |
testcase_98 | AC | 957 ms
65,904 KB |
testcase_99 | AC | 971 ms
65,972 KB |
testcase_100 | AC | 988 ms
65,948 KB |
testcase_101 | AC | 983 ms
65,896 KB |
testcase_102 | AC | 966 ms
66,032 KB |
testcase_103 | AC | 964 ms
65,768 KB |
testcase_104 | AC | 956 ms
65,836 KB |
testcase_105 | AC | 984 ms
65,920 KB |
testcase_106 | AC | 958 ms
65,900 KB |
testcase_107 | AC | 958 ms
65,968 KB |
testcase_108 | AC | 955 ms
65,836 KB |
testcase_109 | AC | 948 ms
65,860 KB |
testcase_110 | AC | 971 ms
65,972 KB |
testcase_111 | AC | 934 ms
65,924 KB |
testcase_112 | AC | 957 ms
65,836 KB |
testcase_113 | AC | 966 ms
65,896 KB |
testcase_114 | AC | 931 ms
65,836 KB |
testcase_115 | AC | 965 ms
65,904 KB |
testcase_116 | AC | 945 ms
65,864 KB |
testcase_117 | AC | 918 ms
66,012 KB |
testcase_118 | AC | 1,001 ms
65,952 KB |
testcase_119 | AC | 955 ms
65,900 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//400].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)