結果

問題 No.1183 コイン遊び
ユーザー nonpro3
提出日時 2020-08-22 17:35:43
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
AC  
実行時間 327 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 3,096 ms
コンパイル使用メモリ 134,460 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-10-15 11:23:27
合計ジャッジ時間 12,319 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>

using namespace std;

typedef long long ll;

int N;
bool a[1000000 + 100], b[1000000 + 100];

int main() {
	cin >> N;
	for (int i = 0; i < N; i++)cin >> a[i];
	for (int i = 0; i < N; i++)cin >> b[i];

	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (a[i] != b[i]) {
			if (i == 0)ans++;
			else {
				if (a[i - 1] == b[i - 1])
					ans++;
			}
		}
	}
	cout << ans << endl;

	return 0;
}
0