Contest Duration: ~ (local time) (120 minutes) Back to Home

Submission #7477948

Source Code Expand

Copy
```from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor

INF = float('inf')
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

n = I()
ret = -INF
for i in range(2, n+1):
print("? {0} {1}".format(1, i))
sys.stdout.flush()
if I() > ret:
v = i

ret = -INF
for j in range(1, n+1):
if v != j:
print("? {0} {1}".format(v, j))
sys.stdout.flush()
if I() > ret:
ret = I()
w = j

print("! {0} {1}".format(v, w))```

#### Submission Info

Submission Time 2019-09-12 22:34:49+0900 D - 高橋くんと木の直径 ryuhei_py PyPy3 (2.4.0) 0 1354 Byte TLE 2107 ms 42056 KB

#### Judge Result

Set Name Score / Max Score Test Cases
Case Name Status Exec Time Memory