Submission #6454572


Source Code Expand

Copy
#include<bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    
    int n;
    cin >> n;
    int arr[n];
    for (int i = 0; i != n; ++i)
        cin >> arr[i];
    
    int ans[n];
    int m = 0;
    for (int i = n - 1; i != -1; --i)
    {
        ans[i] = arr[i];
        for (int j = 2 * i + 1; j < n; j += (i + 1))
            ans[i] ^= ans[j];
        m += ans[i];
    }
    
    cout << m << '\n';
    for (int i = 0; i != n; ++i)
        if (ans[i])
            cout << i + 1 << '\n';
    
    return 0;
}

Submission Info

Submission Time
Task D - Preparing Boxes
User keima915
Language C++14 (GCC 5.4.1)
Score 400
Code Size 592 Byte
Status AC
Exec Time 25 ms
Memory 2560 KB

Judge Result

Set Name All Sample
Score / Max Score 400 / 400 0 / 0
Status
AC × 18
AC × 2
Set Name Test Cases
All sample_01, sample_02, testcase_0, testcase_1, testcase_10, testcase_11, testcase_12, testcase_13, testcase_14, testcase_2, testcase_3, testcase_4, testcase_5, testcase_6, testcase_7, testcase_8, testcase_9, testcase_add0
Sample sample_01, sample_02
Case Name Status Exec Time Memory
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
testcase_0 AC 10 ms 1024 KB
testcase_1 AC 20 ms 1920 KB
testcase_10 AC 16 ms 1792 KB
testcase_11 AC 11 ms 1280 KB
testcase_12 AC 3 ms 512 KB
testcase_13 AC 1 ms 256 KB
testcase_14 AC 1 ms 256 KB
testcase_2 AC 7 ms 768 KB
testcase_3 AC 12 ms 1280 KB
testcase_4 AC 13 ms 1280 KB
testcase_5 AC 23 ms 2304 KB
testcase_6 AC 14 ms 1536 KB
testcase_7 AC 24 ms 2560 KB
testcase_8 AC 17 ms 1792 KB
testcase_9 AC 3 ms 512 KB
testcase_add0 AC 25 ms 2432 KB