QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#499377#6728. To the ParkUmokWA 0ms3548kbC++20979b2024-07-31 13:29:482024-07-31 13:29:48

Judging History

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

  • [2024-07-31 13:29:48]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3548kb
  • [2024-07-31 13:29:48]
  • 提交

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