-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathd.cpp
More file actions
36 lines (32 loc) · 736 Bytes
/
d.cpp
File metadata and controls
36 lines (32 loc) · 736 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
struct op{
int a, b, c;
};
int N, a[200000];
int32_t main(){
cin.tie(0) -> sync_with_stdio(0);
cin >> N;
int rxor = 0;
for(int i = 0; i < N; i++){
cin >> a[i];
rxor ^= a[i];
}
if(N % 2 || !rxor){
cout << "YES" << endl;
vector<op> ans;
for(int i = 0; i + 2 < N; i += 2){
ans.push_back({i+1, i+2, i+3});
}
for(int i = 0; i + 2 < N; i += 2){
ans.push_back({i+1, i+2, N});
}
cout << ans.size() << endl;
for(op i : ans){
cout << i.a << " " << i.b << " " << i.c << endl;
}
}else{
cout << "NO" << endl;
}
}