結果
問題 | No.3161 Find Presents |
ユーザー |
![]() |
提出日時 | 2025-05-23 23:14:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 367 ms / 4,000 ms |
コード長 | 1,102 bytes |
コンパイル時間 | 541 ms |
コンパイル使用メモリ | 82,588 KB |
実行使用メモリ | 95,260 KB |
平均クエリ数 | 3352.21 |
最終ジャッジ日時 | 2025-05-23 23:14:37 |
合計ジャッジ時間 | 23,111 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 80 |
ソースコード
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+1)//2 dy = (yr-yl+1)//2 if dx > 0: if dy > 0: dfs(xl,xl+dx-1, yl,yl+dy-1) dfs(xl,xl+dx-1, yl+dy,yr) if dy > 0: dfs(xl+dx,xr, yl,yl+dy-1) dfs(xl+dx,xr, yl+dy,yr) ans = set() dfs(0,10**6, 0,10**6) print("!", len(ans)) for i in range(len(ans)): print(*ans.pop())