Task: | Kolmijako |
Sender: | Gomhog |
Submission time: | 2025-09-05 21:58:51 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 23 |
#2 | ACCEPTED | 42 |
#3 | ACCEPTED | 35 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.00 s | 1, 2, 3 | details |
#2 | ACCEPTED | 0.00 s | 2, 3 | details |
#3 | ACCEPTED | 0.01 s | 3 | details |
Code
#include <bits/stdc++.h> #define F first #define S second #define X real() #define Y imag() using namespace std; typedef long long ll; typedef long double ld; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int tcs; cin>>tcs; for (int tc=0;tc<tcs;tc++) { int n; cin>>n; if (n<5 || n%3 == 1) { cout << "NO\n"; continue; } cout << "YES\n"; vector<int> s1,s2,s3; int bas = n%6; if (bas < 5) bas +=6; if (bas == 5) { s1.push_back(5); s2.push_back(1); s2.push_back(4); s3.push_back(2); s3.push_back(3); } else if (bas == 6) { s1.push_back(1); s1.push_back(6); s2.push_back(2); s2.push_back(5); s3.push_back(3); s3.push_back(4); } else if (bas == 8) { s1.push_back(1); s1.push_back(5); s1.push_back(6); s2.push_back(2); s2.push_back(3); s2.push_back(7); s3.push_back(4); s3.push_back(8); } else if (bas == 9) { s1.push_back(1); s1.push_back(2); s1.push_back(3); s1.push_back(4); s1.push_back(5); s2.push_back(6); s2.push_back(9); s3.push_back(7); s3.push_back(8); } for (int k = bas; k<n; k+=6) { s1.push_back(k+1); s2.push_back(k+2); s3.push_back(k+3); s3.push_back(k+4); s2.push_back(k+5); s1.push_back(k+6); } cout<<s1.size()<<"\n"; for (int i : s1) cout<<i<<" "; cout<<"\n"<<s2.size()<<"\n"; for (int i : s2) cout<<i<<" "; cout<<"\n"<<s3.size()<<"\n"; for (int i : s3) cout<<i<<" "; cout<<"\n"; } }
Test details
Test 1
Group: 1, 2, 3
Verdict: ACCEPTED
input |
---|
15 1 2 3 4 ... |
correct output |
---|
NO NO NO NO YES ... |
user output |
---|
NO NO NO NO YES ... Truncated |
Test 2
Group: 2, 3
Verdict: ACCEPTED
input |
---|
100 1 2 3 4 ... |
correct output |
---|
NO NO NO NO YES ... |
user output |
---|
NO NO NO NO YES ... Truncated |
Test 3
Group: 3
Verdict: ACCEPTED
input |
---|
100 564 895 546 980 ... |
correct output |
---|
YES 188 1 6 12 7 18 13 24 19 30 25 36 ... |
user output |
---|
YES 188 1 6 7 12 13 18 19 24 25 30 31 ... Truncated |