QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#724725#9541. Expanding ArraygzyWA 1ms3928kbC++14865b2024-11-08 14:45:422024-11-08 14:45:43

Judging History

你现在查看的是最新测评结果

  • [2024-11-08 14:45:43]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3928kb
  • [2024-11-08 14:45:42]
  • 提交

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: ''