結果

問題 No.1183 コイン遊び
ユーザー Shiro_SShiro_S
提出日時 2020-08-22 13:12:04
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 188 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 986 ms
コンパイル使用メモリ 29,696 KB
実行使用メモリ 9,728 KB
最終ジャッジ日時 2024-04-23 07:32:34
合計ジャッジ時間 6,366 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,248 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 12 ms
5,376 KB
testcase_12 AC 116 ms
6,656 KB
testcase_13 AC 105 ms
6,144 KB
testcase_14 AC 174 ms
9,088 KB
testcase_15 AC 187 ms
9,600 KB
testcase_16 AC 187 ms
9,472 KB
testcase_17 AC 187 ms
9,600 KB
testcase_18 AC 186 ms
9,600 KB
testcase_19 AC 186 ms
9,600 KB
testcase_20 AC 186 ms
9,600 KB
testcase_21 AC 174 ms
9,600 KB
testcase_22 AC 170 ms
9,728 KB
testcase_23 AC 171 ms
9,600 KB
testcase_24 AC 170 ms
9,600 KB
testcase_25 AC 188 ms
9,728 KB
testcase_26 AC 186 ms
9,600 KB
testcase_27 AC 186 ms
9,600 KB
testcase_28 AC 186 ms
9,600 KB
testcase_29 AC 170 ms
9,728 KB
testcase_30 AC 169 ms
9,728 KB
testcase_31 AC 187 ms
9,728 KB
testcase_32 AC 188 ms
9,600 KB
testcase_33 AC 186 ms
9,600 KB
testcase_34 AC 188 ms
9,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>
int N, A[1<<20], B[1<<20];
int main(){
	scanf("%d", &N);
	for(int i=0; i<N; i++)scanf("%d", A+i);
	for(int i=0; i<N; i++)scanf("%d", B+i);
	int ans = 0;
	for(int i=0; i<N; i++){
		ans += A[i] ^ B[i];
		if(i){
			if(A[i]^B[i] && A[i-1]^B[i-1])ans--;
		}
	}
	printf("%d\n", ans);
	return 0;
}
0