結果

問題 No.1245 ANDORゲーム(calc)
ユーザー tailstails
提出日時 2020-10-02 22:16:43
言語 cLay
(20240104-1)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 362 bytes
コンパイル時間 2,408 ms
コンパイル使用メモリ 162,104 KB
実行使用メモリ 7,904 KB
最終ジャッジ日時 2023-09-19 01:26:59
合計ジャッジ時間 9,514 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,408 KB
testcase_01 AC 2 ms
5,420 KB
testcase_02 AC 2 ms
5,380 KB
testcase_03 AC 2 ms
5,552 KB
testcase_04 AC 2 ms
5,380 KB
testcase_05 AC 2 ms
5,444 KB
testcase_06 AC 2 ms
5,452 KB
testcase_07 AC 4 ms
5,620 KB
testcase_08 AC 2 ms
5,368 KB
testcase_09 AC 4 ms
5,624 KB
testcase_10 AC 3 ms
5,492 KB
testcase_11 AC 82 ms
7,828 KB
testcase_12 AC 82 ms
7,756 KB
testcase_13 AC 82 ms
7,760 KB
testcase_14 AC 82 ms
7,728 KB
testcase_15 AC 82 ms
7,768 KB
testcase_16 AC 82 ms
7,732 KB
testcase_17 AC 62 ms
7,876 KB
testcase_18 AC 56 ms
7,748 KB
testcase_19 AC 55 ms
7,712 KB
testcase_20 AC 64 ms
7,704 KB
testcase_21 AC 60 ms
7,712 KB
testcase_22 AC 56 ms
7,728 KB
testcase_23 AC 69 ms
7,904 KB
testcase_24 AC 66 ms
7,764 KB
testcase_25 AC 17 ms
6,944 KB
testcase_26 AC 21 ms
7,640 KB
testcase_27 AC 24 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int n,q,a[1d5],t[1d5];
string s;
ll y,z[30][2];

{
	rd(n,q,a(n),s,t(q));
	rep(i,30){
		rep(j,2){
			int v=j;
			rep(k,n){
				if( s[k]=='0' && !(a[k]&1<<i) && v ){
					v=0;
					z[i][j]+=1<<i;
				}
				if( s[k]=='1' && (a[k]&1<<i) && !v ){
					v=1;
					z[i][j]+=1<<i;
				}
			}
		}
	}
	rep(k,q){
		y=0;
		rep(i,30){
			y+=z[i][t[k]>>i&1];
		}
		wt(y);
	}
}
0