Submission #659433

#TimeUsernameProblemLanguageResultExecution timeMemory
659433beaconmcZagrade (COI20_zagrade)Pypy 3
71 / 100
1607 ms29556 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) 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...