結果

問題 No.1741 Arrays and XOR Procedure
ユーザー ytftytft
提出日時 2021-12-27 18:37:32
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 593 bytes
コンパイル時間 1,606 ms
コンパイル使用メモリ 167,336 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-08 10:54:17
合計ジャッジ時間 5,416 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 41 ms
6,676 KB
testcase_04 AC 1 ms
6,676 KB
testcase_05 AC 34 ms
6,676 KB
testcase_06 AC 39 ms
6,676 KB
testcase_07 AC 39 ms
6,676 KB
testcase_08 AC 35 ms
6,676 KB
testcase_09 AC 34 ms
6,676 KB
testcase_10 AC 35 ms
6,676 KB
testcase_11 AC 27 ms
6,676 KB
testcase_12 AC 22 ms
6,676 KB
testcase_13 AC 33 ms
6,676 KB
testcase_14 AC 24 ms
6,676 KB
testcase_15 AC 32 ms
6,676 KB
testcase_16 AC 4 ms
6,676 KB
testcase_17 AC 13 ms
6,676 KB
testcase_18 AC 26 ms
6,676 KB
testcase_19 AC 3 ms
6,676 KB
testcase_20 AC 38 ms
6,676 KB
testcase_21 AC 30 ms
6,676 KB
testcase_22 AC 27 ms
6,676 KB
testcase_23 AC 12 ms
6,676 KB
testcase_24 AC 4 ms
6,676 KB
testcase_25 AC 37 ms
6,676 KB
testcase_26 AC 17 ms
6,676 KB
testcase_27 WA -
testcase_28 AC 29 ms
6,676 KB
testcase_29 AC 32 ms
6,676 KB
testcase_30 AC 28 ms
6,676 KB
testcase_31 WA -
testcase_32 AC 17 ms
6,676 KB
testcase_33 AC 20 ms
6,676 KB
testcase_34 AC 9 ms
6,676 KB
testcase_35 WA -
testcase_36 AC 5 ms
6,676 KB
testcase_37 AC 16 ms
6,676 KB
testcase_38 AC 36 ms
6,676 KB
testcase_39 AC 14 ms
6,676 KB
testcase_40 AC 2 ms
6,676 KB
testcase_41 AC 8 ms
6,676 KB
testcase_42 AC 6 ms
6,676 KB
testcase_43 AC 2 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,mod=998244353,count=0,temp,ans=mod/2+1,flg=1,B,cur=0;
    cin>>N;
    for(int i=0;i<N;++i){
        cin>>B;
        if(B==-1){
            ans=(ans<<1)%mod;
            flg&=count;
        }else if(!count){
        	cur^=B;
        }
        temp=max(1,N-i-1);
        while(temp%2==0){
            temp>>=1;
            ++count;
        }
        temp=i+1;
        while(temp%2==0){
            temp>>=1;
            --count;
        }
    }
    if(flg){
        ans=(ans<<1)%mod;
    }
    cout<<(flg&&!cur?0:ans)<<endl;
}
0