結果

問題 No.1183 コイン遊び
ユーザー 沙耶花沙耶花
提出日時 2020-08-22 13:02:27
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 191 ms / 2,000 ms
コード長 461 bytes
コンパイル時間 2,447 ms
コンパイル使用メモリ 196,736 KB
実行使用メモリ 11,328 KB
最終ジャッジ日時 2024-04-23 07:13:05
合計ジャッジ時間 7,965 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,812 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 6 ms
6,944 KB
testcase_11 AC 13 ms
6,940 KB
testcase_12 AC 120 ms
8,320 KB
testcase_13 AC 105 ms
7,680 KB
testcase_14 AC 177 ms
10,708 KB
testcase_15 AC 188 ms
11,228 KB
testcase_16 AC 189 ms
11,128 KB
testcase_17 AC 187 ms
11,284 KB
testcase_18 AC 191 ms
11,144 KB
testcase_19 AC 189 ms
11,140 KB
testcase_20 AC 188 ms
11,296 KB
testcase_21 AC 170 ms
11,328 KB
testcase_22 AC 170 ms
11,188 KB
testcase_23 AC 171 ms
11,148 KB
testcase_24 AC 172 ms
11,256 KB
testcase_25 AC 190 ms
11,148 KB
testcase_26 AC 190 ms
11,304 KB
testcase_27 AC 190 ms
11,220 KB
testcase_28 AC 191 ms
11,164 KB
testcase_29 AC 173 ms
11,212 KB
testcase_30 AC 171 ms
11,184 KB
testcase_31 AC 188 ms
11,156 KB
testcase_32 AC 189 ms
11,144 KB
testcase_33 AC 188 ms
11,212 KB
testcase_34 AC 188 ms
11,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 2000000005


int main(){
	
	int N;
	cin>>N;
	
	vector<int> A(N),B(N);
	
	for(int i=0;i<N;i++)scanf("%d",&A[i]);
	for(int i=0;i<N;i++)scanf("%d",&B[i]);
	
	for(int i=0;i<N;i++){
		A[i] ^= B[i];
	}
	
	int ans = 0;
	for(int i=0;i<N;i++){
		if(A[i]==1){
			if(i==0||A[i-1]==0)ans++;
		}
	}
	
	cout<<ans<<endl;
	
	return 0;
}
0