結果
問題 | No.2962 Sum Bomb Bomber |
ユーザー | lif4635 |
提出日時 | 2024-11-16 16:15:58 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 201 ms / 2,000 ms |
コード長 | 1,725 bytes |
コンパイル時間 | 534 ms |
コンパイル使用メモリ | 82,328 KB |
実行使用メモリ | 75,428 KB |
平均クエリ数 | 169.66 |
最終ジャッジ日時 | 2024-11-16 16:17:03 |
合計ジャッジ時間 | 13,702 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 132 ms
74,800 KB |
testcase_01 | AC | 146 ms
75,428 KB |
testcase_02 | AC | 146 ms
73,360 KB |
testcase_03 | AC | 163 ms
72,936 KB |
testcase_04 | AC | 163 ms
73,432 KB |
testcase_05 | AC | 140 ms
73,064 KB |
testcase_06 | AC | 148 ms
73,704 KB |
testcase_07 | AC | 137 ms
73,432 KB |
testcase_08 | AC | 133 ms
73,320 KB |
testcase_09 | AC | 152 ms
73,448 KB |
testcase_10 | AC | 140 ms
73,320 KB |
testcase_11 | AC | 163 ms
73,376 KB |
testcase_12 | AC | 150 ms
73,576 KB |
testcase_13 | AC | 152 ms
73,576 KB |
testcase_14 | AC | 154 ms
73,760 KB |
testcase_15 | AC | 137 ms
73,064 KB |
testcase_16 | AC | 182 ms
73,704 KB |
testcase_17 | AC | 162 ms
73,192 KB |
testcase_18 | AC | 152 ms
72,936 KB |
testcase_19 | AC | 169 ms
73,704 KB |
testcase_20 | AC | 136 ms
74,216 KB |
testcase_21 | AC | 124 ms
74,088 KB |
testcase_22 | AC | 160 ms
73,448 KB |
testcase_23 | AC | 136 ms
73,448 KB |
testcase_24 | AC | 161 ms
73,064 KB |
testcase_25 | AC | 130 ms
73,704 KB |
testcase_26 | AC | 162 ms
73,704 KB |
testcase_27 | AC | 158 ms
73,704 KB |
testcase_28 | AC | 177 ms
73,064 KB |
testcase_29 | AC | 145 ms
73,960 KB |
testcase_30 | AC | 156 ms
73,576 KB |
testcase_31 | AC | 127 ms
73,320 KB |
testcase_32 | AC | 137 ms
73,576 KB |
testcase_33 | AC | 171 ms
73,808 KB |
testcase_34 | AC | 144 ms
73,440 KB |
testcase_35 | AC | 136 ms
72,936 KB |
testcase_36 | AC | 138 ms
73,576 KB |
testcase_37 | AC | 149 ms
73,356 KB |
testcase_38 | AC | 145 ms
74,472 KB |
testcase_39 | AC | 161 ms
73,576 KB |
testcase_40 | AC | 152 ms
73,904 KB |
testcase_41 | AC | 161 ms
73,356 KB |
testcase_42 | AC | 145 ms
73,832 KB |
testcase_43 | AC | 142 ms
73,192 KB |
testcase_44 | AC | 139 ms
73,448 KB |
testcase_45 | AC | 162 ms
73,448 KB |
testcase_46 | AC | 138 ms
72,808 KB |
testcase_47 | AC | 147 ms
73,192 KB |
testcase_48 | AC | 140 ms
73,500 KB |
testcase_49 | AC | 201 ms
73,704 KB |
testcase_50 | AC | 178 ms
73,448 KB |
testcase_51 | AC | 165 ms
73,696 KB |
testcase_52 | AC | 160 ms
73,184 KB |
testcase_53 | AC | 153 ms
73,696 KB |
testcase_54 | AC | 126 ms
73,304 KB |
testcase_55 | AC | 127 ms
74,384 KB |
testcase_56 | AC | 143 ms
73,700 KB |
testcase_57 | AC | 145 ms
73,944 KB |
testcase_58 | AC | 163 ms
73,536 KB |
testcase_59 | AC | 142 ms
73,676 KB |
testcase_60 | AC | 162 ms
73,312 KB |
testcase_61 | AC | 144 ms
73,312 KB |
testcase_62 | AC | 152 ms
73,184 KB |
testcase_63 | AC | 134 ms
73,848 KB |
testcase_64 | AC | 151 ms
73,696 KB |
ソースコード
"""input""" #int-input # input = sys.stdin.readline def II(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(MI()) #str-input def SI(): return input() def MSI(): return input().split() def SI_L(): return list(SI()) def SI_LI(): return list(map(int, SI())) #multiple-input def LLI(n): return [LI() for _ in range(n)] def LSI(n): return [SI() for _ in range(n)] #1-indexを0-indexでinput def MI_1(): return map(lambda x:int(x)-1, input().split()) def TI_1(): return tuple(MI_1()) def LI_1(): return list(MI_1()) from bisect import bisect_left,bisect_right inf = 1<<60 def tri_float(comparison, l = -10**8, r = 10**8): while abs(r - l)/abs(r) > error and abs(r - l) > error: l2 = (l*2+r)/3 r2 = (l+r*2)/3 if comparison(l2) > comparison(r2): l = l2 else: r = r2 return l2, comparison(l2) from functools import cache const = 10**8 n = II() @cache def solve(x): print(1,x,0) return II() l = -const r = const while abs(r - l) > 1: l2 = (l*2+r)//3 r2 = (l+r*2)//3 resl2 = solve(l2) resr2 = solve(r2) if resl2 > resr2: l = l2 + 1 elif resl2 < resr2: r = r2 - 1 else: l = l2 + 1 resl2 = solve(l) resr2 = solve(r) if resl2 < resr2: ansx = l else: ansx = r @cache def solve2(y): print(1,0,y) return II() l = -const r = const while abs(r - l) > 1: l2 = (l*2+r)//3 r2 = (l+r*2)//3 resl2 = solve2(l2) resr2 = solve2(r2) if resl2 > resr2: l = l2 + 1 elif resl2 < resr2: r = r2 - 1 else: l = l2 + 1 resl2 = solve2(l) resr2 = solve2(r) if resl2 < resr2: ansy = l else: ansy = r print(2,ansx,ansy)