Task: | Kolmijako |
Sender: | jubidubi |
Submission time: | 2025-09-06 18:39:41 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.00 s | 1, 2, 3 | details |
#2 | WRONG ANSWER | 0.01 s | 2, 3 | details |
#3 | WRONG ANSWER | 0.01 s | 3 | details |
Code
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int qqq; cin >> qqq; while (qqq--) { int n; cin >> n; if (n < 5) { cout << "NO" << endl; continue; } int sum = 0; vector<int> numbers; vector<bool> used; for (int i = 1; i <= n; ++i) { sum += i; numbers.push_back(i); used.push_back(0); } reverse(numbers.begin(), numbers.end()); if (sum % 3 != 0) { cout << "NO" << endl; continue; } int tmp = sum / 3; vector<int> a; for (int i = 0; i < n; ++i) { if (numbers[i] <= tmp) { a.push_back(numbers[i]); tmp -= numbers[i]; used[i] = 1; } } tmp = sum / 3; vector<int> b; for (int i = 0; i < n; ++i) { if (numbers[i] <= tmp && !used[i]) { b.push_back(numbers[i]); tmp -= numbers[i]; used[i] = 1; } } vector<int> c; for (int i = 0; i < n; ++i) { if (!used[i]) c.push_back(i); } cout << "YES" << endl; cout << a.size() << endl; for (int x : a) cout << x << " "; cout << endl; cout << b.size() << endl; for (int x : b) cout << x << " "; cout << endl; cout << c.size() << endl; for (int x : c) cout << x << " "; cout << endl; } }
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
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: WRONG ANSWER
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: WRONG ANSWER
input |
---|
100 564 895 546 980 ... |
correct output |
---|
YES 188 1 6 12 7 18 13 24 19 30 25 36 ... |
user output |
---|
YES 104 564 563 562 561 560 559 558 55... Truncated |