根据题意,简单列了一下演绎的情况,有三个人A B S, S为spectator,一下每行为每场比赛的参赛安排,可以看到每三场比赛,S会重新成为spectator
A 2 S
A S 2
2 S A
2 A S
S A 2
S 2 A
A 2 S
。。。
public class App {public static void main(String[] args) throws Exception {Scanner sc = new Scanner(System.in);int n = Integer.parseInt(sc.nextLine());for (int i = 0; i < n; ++i) {int k = sc.nextInt();System.out.println(k % 3 == 1 ? "YES" : "NO");sc.nextLine();}sc.close();}
}