結果

問題 No.1183 コイン遊び
ユーザー furafura
提出日時 2020-09-06 18:34:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 162 ms / 2,000 ms
コード長 350 bytes
コンパイル時間 2,845 ms
コンパイル使用メモリ 200,680 KB
実行使用メモリ 10,960 KB
最終ジャッジ日時 2023-08-19 14:13:25
合計ジャッジ時間 10,745 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 5 ms
4,376 KB
testcase_11 AC 11 ms
4,380 KB
testcase_12 AC 101 ms
7,816 KB
testcase_13 AC 91 ms
7,268 KB
testcase_14 AC 149 ms
10,532 KB
testcase_15 AC 160 ms
10,804 KB
testcase_16 AC 160 ms
10,848 KB
testcase_17 AC 162 ms
10,704 KB
testcase_18 AC 159 ms
10,696 KB
testcase_19 AC 159 ms
10,736 KB
testcase_20 AC 159 ms
10,960 KB
testcase_21 AC 148 ms
10,708 KB
testcase_22 AC 148 ms
10,808 KB
testcase_23 AC 149 ms
10,880 KB
testcase_24 AC 146 ms
10,848 KB
testcase_25 AC 159 ms
10,708 KB
testcase_26 AC 160 ms
10,832 KB
testcase_27 AC 159 ms
10,640 KB
testcase_28 AC 159 ms
10,940 KB
testcase_29 AC 149 ms
10,856 KB
testcase_30 AC 147 ms
10,940 KB
testcase_31 AC 162 ms
10,784 KB
testcase_32 AC 159 ms
10,708 KB
testcase_33 AC 161 ms
10,952 KB
testcase_34 AC 158 ms
10,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int n; scanf("%d",&n);
	vector<int> a(n),b(n);
	rep(i,n) scanf("%d",&a[i]);
	rep(i,n) scanf("%d",&b[i]);

	rep(i,n) b[i]=(b[i]+a[i])%2;
	for(int i=n-1;i>0;i--) b[i]=(b[i-1]+b[i])%2;

	printf("%ld\n",(count(b.begin(),b.end(),1)+1)/2);

	return 0;
}
0