結果

問題 No.2895 Zero XOR Subset
ユーザー daiota
提出日時 2024-09-20 21:54:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 1,502 ms
コンパイル使用メモリ 165,632 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-20 21:54:56
合計ジャッジ時間 6,235 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int,int> P;
#define REP(i,n) for(int i=0;i<int(n);i++)



ll a[200010];


int main(){
	cin.tie(nullptr);  ios_base::sync_with_stdio(false);
    ll i,j,k;

    ll N;
    cin >> N;

    ll x=0,p=-1;
    for(i=1;i<=N;i++){
    	cin >> a[i];
    	x^=a[i];

    	if(x==0){
    		p=i;
    	}

    }


    if(p==-1) cout << -1 << endl;
    else{

    		cout << p << endl;
    	    for(i=1;i<=p;i++) cout << i << ' ';
    	    cout << endl;

    }




	return 0;

}


0