QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#499377 | #6728. To the Park | Umok | WA | 0ms | 3548kb | C++20 | 979b | 2024-07-31 13:29:48 | 2024-07-31 13:29:48 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
const int N = 1e5 + 5;
#define int long long
#define MAX LONG_LONG_MAX
int ar[N];
void solve()
{
int n;
cin >> n;
for (int i = 1; i <= n + 1; i++)
ar[i] = 0;
queue<int> q;
for (int i = 2; i <= n / 2; i++)
{
int x = i;
for (int j = 2; j <= n / 2; j++)
{
if(i%j)
continue;
if(j*i<=n)
{
ar[i] = 1;
ar[j * i] = 1;
q.push(i);
q.push(i * j);
break;
}
}
}
cout << q.size() / 2 << " ";
while (!q.empty())
{
cout << q.front() << " ";
q.pop();
}
cout << endl;
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
int tcase;
cin >> tcase;
while (tcase--)
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3548kb
input:
3 1 4 6
output:
0 1 2 4 1 2 4
result:
wrong answer Case #3: Participant has a worse answer