結果
問題 |
No.3161 Find Presents
|
ユーザー |
![]() |
提出日時 | 2025-05-23 23:06:01 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,106 bytes |
コンパイル時間 | 542 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 95,232 KB |
平均クエリ数 | 2919.41 |
最終ジャッジ日時 | 2025-05-23 23:06:25 |
合計ジャッジ時間 | 22,738 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 WA * 78 |
ソースコード
import sys, time, random, heapq, math, itertools from collections import deque, Counter, defaultdict #from sortedcontainers import SortedSet, SortedList from bisect import bisect, bisect_left, bisect_right import heapq as hq from functools import cache, cmp_to_key def debug(*x):print('debug:',*x, file=sys.stderr) sys.setrecursionlimit(300000) input = lambda: sys.stdin.readline().rstrip() ii = lambda: int(input()) mi = lambda: map(int, input().split()) li = lambda: list(mi()) inf = 2 ** 61 - 1 mod = 998244353 def dfs(xl,xr,yl,yr): global ans print("?" ,xl,xr,yl,yr, flush=True ) q = ii() if q == 0: return 0 else: if xl == xr and yl == yr: ans.add((xl,yl)) return 0 dx = (xr-xl)//2 dy = (yr-yl)//2 if dx > 0: if dy > 0: dfs(xl,xl+dx-1, yl,yl+dy-1) dfs(xl,xl+dx-1, yl+dy,yr-1) if dy > 0: dfs(xl+dx,xr-1, yl,yl+dy-1) dfs(xl+dx,xr-1, yl+dy,yr-1) ans = set() dfs(0,10**6, 0,10**6) print("!", len(ans)) for i in range(len(ans)): print(*ans.pop())