Submission #659434

#TimeUsernameProblemLanguageResultExecution timeMemory
659434beaconmcZagrade (COI20_zagrade)Pypy 3
100 / 100
1694 ms32132 KiB
import sys n,q = map(int, input().split()) a = [] sussies = [0 for i in range(n+1)] for i in range(1, n+1): if len(a)==0: a.append(i) continue print("?",a[-1],i),sys.stdout.flush() if int(input()): sussies[a.pop()-1] = 1 sussies[i-1] = 0 else: a.append(i) for i in range(len(a)): if i < len(a)//2: sussies[a[i]-1] = 0 else: sussies[a[i]-1] = 1 print("! ",end="") for i in range(n): print("(" if sussies[i] else ")", end="")
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...