QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#724725 | #9541. Expanding Array | gzy | WA | 1ms | 3928kb | C++14 | 865b | 2024-11-08 14:45:42 | 2024-11-08 14:45:43 |
Judging History
answer
#include<bits/stdc++.h>
#define pb push_back
#define vector basic_string
using namespace std;
using ll = long long;
const int N = 2e5 + 7, M = 30000;
int i, j, k, n, m, x, y, z;
vector<int> t, h, u;
int main() {
// freopen(".in", "r", stdin);
// freopen(".out", "w", stdout);
scanf("%d", &n);
for(i = 2; i <= M; i += 2) if(i % 6) t += i;
for(i = 3; i <= M; i += 3) if(i % 6) h += i;
for(i = 6; i <= M; i += 6) if(!(i % 6)) u += i;
if(n == 3) return puts("2 5 63"),0;
if(n == 4) return puts("2 5 20 63"),0;
for(x = 3; x <= min(n, (int)t.size()); x += 3) {
y = min((int)h.size() / 2 * 2, (n - x) / 2 * 2);
z = n - x - y;
if(u.size() >= z) {
for(i = 0; i < x; i++) printf("%d ", t[i]);
for(i = 0; i < y; i++) printf("%d ", h[i]);
for(i = 0; i < z; i++) printf("%d ", u[i]);
return 0;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3928kb
input:
2 2 3
output:
result:
wrong answer 1st lines differ - expected: '4', found: ''