# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
712779 | 2023-03-19T22:05:32 Z | beaconmc | 질문 (CEOI14_question_grader) | C++14 | 0 ms | 0 KB |
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")