# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
712779 | beaconmc | Question (Grader is different from the original contest) (CEOI14_question_grader) | C++14 | 0 ms | 0 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
sus = [set() for i in range(12)]
cur = 0
for a in range(12):
for b in range(a+1, 12):
for c in range(b+1, 12):
for d in range(c+1, 12):
for e in range(d+1, 12):
for f in range(e+1, 12):
sus[a].add(cur)
sus[b].add(cur)
sus[c].add(cur)
sus[d].add(cur)
sus[e].add(cur)
sus[f].add(cur)
cur += 1
t = int(input())
n,q = map(int, input().split())
for i in range(q):
a,b = map(int, input().split())
if t==1:
for k in range(12):
if a in sus[k] and b not in sus[k]:
print(k+1)
break
else:
if a in sus[b-1]:
print("yes")
else:
print("no")