結果
問題 | No.1306 Exactly 2 Digits |
ユーザー | vwxyz |
提出日時 | 2024-01-01 21:47:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 314 ms / 2,000 ms |
コード長 | 1,602 bytes |
コンパイル時間 | 325 ms |
コンパイル使用メモリ | 82,572 KB |
実行使用メモリ | 96,472 KB |
平均クエリ数 | 1236.78 |
最終ジャッジ日時 | 2024-09-27 17:33:54 |
合計ジャッジ時間 | 24,552 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 60 ms
71,056 KB |
testcase_01 | AC | 59 ms
71,720 KB |
testcase_02 | AC | 58 ms
72,440 KB |
testcase_03 | AC | 58 ms
72,180 KB |
testcase_04 | AC | 61 ms
71,252 KB |
testcase_05 | AC | 58 ms
70,920 KB |
testcase_06 | AC | 57 ms
71,600 KB |
testcase_07 | AC | 58 ms
72,044 KB |
testcase_08 | AC | 60 ms
71,220 KB |
testcase_09 | AC | 61 ms
70,700 KB |
testcase_10 | AC | 61 ms
70,544 KB |
testcase_11 | AC | 58 ms
71,372 KB |
testcase_12 | AC | 58 ms
71,136 KB |
testcase_13 | AC | 59 ms
71,652 KB |
testcase_14 | AC | 62 ms
71,376 KB |
testcase_15 | AC | 59 ms
71,548 KB |
testcase_16 | AC | 59 ms
70,528 KB |
testcase_17 | AC | 59 ms
71,120 KB |
testcase_18 | AC | 60 ms
72,520 KB |
testcase_19 | AC | 61 ms
72,648 KB |
testcase_20 | AC | 57 ms
71,484 KB |
testcase_21 | AC | 58 ms
72,212 KB |
testcase_22 | AC | 56 ms
71,732 KB |
testcase_23 | AC | 59 ms
71,344 KB |
testcase_24 | AC | 60 ms
71,756 KB |
testcase_25 | AC | 59 ms
71,180 KB |
testcase_26 | AC | 59 ms
71,088 KB |
testcase_27 | AC | 59 ms
73,036 KB |
testcase_28 | AC | 59 ms
71,956 KB |
testcase_29 | AC | 59 ms
73,220 KB |
testcase_30 | AC | 60 ms
72,976 KB |
testcase_31 | AC | 59 ms
72,088 KB |
testcase_32 | AC | 58 ms
71,696 KB |
testcase_33 | AC | 62 ms
71,964 KB |
testcase_34 | AC | 63 ms
71,980 KB |
testcase_35 | AC | 59 ms
71,736 KB |
testcase_36 | AC | 61 ms
71,972 KB |
testcase_37 | AC | 60 ms
71,648 KB |
testcase_38 | AC | 60 ms
71,676 KB |
testcase_39 | AC | 61 ms
71,700 KB |
testcase_40 | AC | 60 ms
72,028 KB |
testcase_41 | AC | 61 ms
72,620 KB |
testcase_42 | AC | 59 ms
71,912 KB |
testcase_43 | AC | 62 ms
72,644 KB |
testcase_44 | AC | 62 ms
72,900 KB |
testcase_45 | AC | 64 ms
73,112 KB |
testcase_46 | AC | 65 ms
73,224 KB |
testcase_47 | AC | 67 ms
72,860 KB |
testcase_48 | AC | 70 ms
72,888 KB |
testcase_49 | AC | 70 ms
78,484 KB |
testcase_50 | AC | 73 ms
79,820 KB |
testcase_51 | AC | 87 ms
83,824 KB |
testcase_52 | AC | 91 ms
82,216 KB |
testcase_53 | AC | 88 ms
83,168 KB |
testcase_54 | AC | 93 ms
90,096 KB |
testcase_55 | AC | 92 ms
84,104 KB |
testcase_56 | AC | 99 ms
89,880 KB |
testcase_57 | AC | 102 ms
85,964 KB |
testcase_58 | AC | 102 ms
87,844 KB |
testcase_59 | AC | 117 ms
93,224 KB |
testcase_60 | AC | 115 ms
88,840 KB |
testcase_61 | AC | 134 ms
93,676 KB |
testcase_62 | AC | 129 ms
93,288 KB |
testcase_63 | AC | 144 ms
93,344 KB |
testcase_64 | AC | 127 ms
90,384 KB |
testcase_65 | AC | 139 ms
92,924 KB |
testcase_66 | AC | 153 ms
93,528 KB |
testcase_67 | AC | 159 ms
93,384 KB |
testcase_68 | AC | 171 ms
93,592 KB |
testcase_69 | AC | 170 ms
93,724 KB |
testcase_70 | AC | 191 ms
94,016 KB |
testcase_71 | AC | 185 ms
94,336 KB |
testcase_72 | AC | 205 ms
95,008 KB |
testcase_73 | AC | 208 ms
94,904 KB |
testcase_74 | AC | 205 ms
95,168 KB |
testcase_75 | AC | 222 ms
94,672 KB |
testcase_76 | AC | 217 ms
95,084 KB |
testcase_77 | AC | 229 ms
94,484 KB |
testcase_78 | AC | 238 ms
94,816 KB |
testcase_79 | AC | 260 ms
95,328 KB |
testcase_80 | AC | 292 ms
95,076 KB |
testcase_81 | AC | 267 ms
95,076 KB |
testcase_82 | AC | 285 ms
95,056 KB |
testcase_83 | AC | 275 ms
94,892 KB |
testcase_84 | AC | 280 ms
96,472 KB |
testcase_85 | AC | 296 ms
95,212 KB |
testcase_86 | AC | 259 ms
94,588 KB |
testcase_87 | AC | 261 ms
96,008 KB |
testcase_88 | AC | 301 ms
96,228 KB |
testcase_89 | AC | 268 ms
94,696 KB |
testcase_90 | AC | 273 ms
95,300 KB |
testcase_91 | AC | 262 ms
95,016 KB |
testcase_92 | AC | 264 ms
94,280 KB |
testcase_93 | AC | 282 ms
95,408 KB |
testcase_94 | AC | 230 ms
94,996 KB |
testcase_95 | AC | 276 ms
94,496 KB |
testcase_96 | AC | 258 ms
95,092 KB |
testcase_97 | AC | 209 ms
94,632 KB |
testcase_98 | AC | 217 ms
94,292 KB |
testcase_99 | AC | 286 ms
95,328 KB |
testcase_100 | AC | 253 ms
94,272 KB |
testcase_101 | AC | 266 ms
94,860 KB |
testcase_102 | AC | 256 ms
95,032 KB |
testcase_103 | AC | 273 ms
94,804 KB |
testcase_104 | AC | 239 ms
94,808 KB |
testcase_105 | AC | 285 ms
95,780 KB |
testcase_106 | AC | 259 ms
95,008 KB |
testcase_107 | AC | 290 ms
96,100 KB |
testcase_108 | AC | 270 ms
94,760 KB |
testcase_109 | AC | 261 ms
94,804 KB |
testcase_110 | AC | 220 ms
94,940 KB |
testcase_111 | AC | 224 ms
95,020 KB |
testcase_112 | AC | 216 ms
94,720 KB |
testcase_113 | AC | 299 ms
95,232 KB |
testcase_114 | AC | 302 ms
95,284 KB |
testcase_115 | AC | 261 ms
95,140 KB |
testcase_116 | AC | 314 ms
95,072 KB |
testcase_117 | AC | 282 ms
94,940 KB |
testcase_118 | AC | 292 ms
94,976 KB |
testcase_119 | AC | 269 ms
95,020 KB |
testcase_120 | AC | 211 ms
94,808 KB |
testcase_121 | AC | 271 ms
95,328 KB |
testcase_122 | AC | 250 ms
95,216 KB |
ソースコード
from collections import defaultdict N=int(input()) i=0 dct=defaultdict(list) PQ=[] s=0 for j in range(1,N**2-N): print("?",i+1,j+1) p,q=map(int,input().split()) dct[(p,q)].append(j) PQ.append((p,q)) s+=p+q PQ.sort() X,Y=[None]*(N*N-N),[None]*(N*N-N) for x in range(1,N): for y in range(N): s+=x+y s//=N*(N-1) for x in range(1,N): for y in range(N): if x+y!=s: continue lst=[] for xx in range(1,N): for yy in range(N): if x==xx and y==yy: continue p,q=x-xx,y-yy if p>q: p,q=q,p lst.append((p,q)) lst.sort() if lst==PQ: X[i]=x Y[i]=y break else: continue break else: assert False for (p,q),lst in dct.items(): if len(lst)==1: j=lst[0] for xx,yy in ((x-p,y-q),(x-q,y-p)): if 1<=xx<N and 0<=yy<N: X[j]=xx Y[j]=yy for ii in range(N*N-N): if X[ii]!=None and X[ii]-Y[ii]!=X[i]-Y[i]: i=ii break else: assert False for (p,q),lst in dct.items(): if len(lst)==2: j=lst[0] print("?",i+1,j+1) pp,qq=map(int,input().split()) for xx,yy in ((x-p,y-q),(x-q,y-p)): if sorted([X[i]-xx,Y[i]-yy])==[pp,qq]: X[j]=xx Y[j]=yy break else: assert False jj=lst[1] X[jj]=2*x-p-q-xx Y[jj]=2*y-p-q-yy A=[x*N+y for x,y in zip(X,Y)] print("!",*A)