Submission #6458374
Source Code Expand
Copy
#include<bits/stdc++.h> //Written by ThiDaiLoc
using namespace std; //Team Three Wolves
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<ll> vi;
typedef pair<ll,ll> pll;
typedef pair<ll,pll> triple;
#define fu(i,a,b) for(ll i=a;i<=b;i++)
#define f1(i,n) for(ll i=1;i<=n;i++)
#define fs(i,s) for(ll i=0;i+1<=s.length();i++)
#define fd(i,b,a) for(ll i=b;i>=a;i--)
#define fuv(i,a) for(ll i=0;i<a.size();i++)
#define fdv(i,a) for(ll i=(ll)a.size()-1;i>=0;i--)
#define ms(a,x) memset(a, x, sizeof a)
#define prec(n) fixed<<setprecision(n)
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define pb(i) push_back(i)
#define popb() pop_back()
#define sc(a) cin>>a
#define sc2(a,b) cin>>a>>b
#define pr(a) cout<<a<<endl
#define pr2(a,b) cout<<a<<" "<<b<<endl
#define rpr(a) return cout<<a<<endl,0
#define prY cout<<"YES"<<endl
#define prN cout<<"NO"<<endl
#define bit(n,i) (((n)>>(i))&1)
#define lowb(a,n,x) lower_bound(a,a+n,x) -a
#define lowb2(a,x) lower_bound(all(a),x) -a.begin()
#define all(x) (x).begin(), (x).end()
#define sz(a) (ll)a.size()
#define le(s) (ll)s.length()
#define ast(x,a,b) assert(x>=a and x<=b)
#define re return
#define mp(a,b) make_pair(a,b)
#define se second
#define fi first
#define debug(x) cerr << #x << " = " << x << endl
#define INPUT freopen("locin.txt", "r", stdin)
#define OUTPUT freopen("locout.txt", "w", stdout)
inline ll isqrt(ll k) {ll r = sqrt(k) + 1; while (r * r > k) r--; return r;}
inline ll icbrt(ll k) {ll r = cbrt(k) + 1; while (r * r * r > k) r--; return r;}
inline ll mnz(ll& a,ll b){return a=(a>b?b:a);}
inline ll mxz(ll& a,ll b){return a=(a<b?b:a);}
inline string toString(ll n) {stringstream ss; ss << n;return ss.str();}
double const eps = 1e-6;
ll const Base=1e9+7,oo=1e17,MAXN=1e6;
ll A[MAXN+5],B[MAXN+5];
ll Solves(){
ll n,m,k,cnt=0,ans=0,x,y,q,c,sum=0,v,t;
// PROCESS IN HERE
sc(n);
f1(i,n)sc(A[i]);
fd(i,n,1){
c=0;
for(ll j=i+i;j<=n;j++)c^=B[j];
if(c^A[i])B[i]=1,ans++;
}
pr(ans);
f1(i,n)if(B[i])cout<<i<<" ";
re 0;
// Hack it if you can :)
}
int main(){
//INPUT;
ll JUDGE_ONLINE = 1;
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
ll test=1;
// sc(test);
fu(T,1,test){
// cout<<"Case #"<<T<<": ";
Solves();
}
if (!JUDGE_ONLINE) cout << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
}
Submission Info
Submission Time |
|
Task |
D - Preparing Boxes |
User |
thidailoc |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
2602 Byte |
Status |
WA |
Exec Time |
2103 ms |
Memory |
5632 KB |
Judge Result
Set Name |
All |
Sample |
Score / Max Score |
0 / 400 |
0 / 0 |
Status |
|
|
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 |
2 ms |
2304 KB |
sample_02 |
AC |
2 ms |
2304 KB |
testcase_0 |
WA |
772 ms |
5120 KB |
testcase_1 |
TLE |
2103 ms |
5504 KB |
testcase_10 |
TLE |
2103 ms |
4736 KB |
testcase_11 |
AC |
1980 ms |
4352 KB |
testcase_12 |
WA |
38 ms |
2432 KB |
testcase_13 |
AC |
2 ms |
2304 KB |
testcase_14 |
AC |
2 ms |
2304 KB |
testcase_2 |
WA |
370 ms |
4864 KB |
testcase_3 |
WA |
1149 ms |
5376 KB |
testcase_4 |
WA |
1308 ms |
5376 KB |
testcase_5 |
TLE |
2103 ms |
5120 KB |
testcase_6 |
WA |
1410 ms |
5376 KB |
testcase_7 |
TLE |
2103 ms |
5504 KB |
testcase_8 |
TLE |
2103 ms |
4608 KB |
testcase_9 |
WA |
79 ms |
2432 KB |
testcase_add0 |
TLE |
2103 ms |
5632 KB |