結果

問題 No.1183 コイン遊び
ユーザー Example0911Example0911
提出日時 2020-08-22 13:02:40
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 622 bytes
コンパイル時間 1,586 ms
コンパイル使用メモリ 165,768 KB
実行使用メモリ 18,984 KB
最終ジャッジ日時 2024-04-23 07:13:42
合計ジャッジ時間 6,141 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 2 ms
5,248 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 9 ms
5,376 KB
testcase_12 AC 76 ms
13,016 KB
testcase_13 AC 69 ms
11,888 KB
testcase_14 AC 113 ms
17,792 KB
testcase_15 AC 119 ms
18,984 KB
testcase_16 AC 120 ms
18,720 KB
testcase_17 AC 119 ms
18,816 KB
testcase_18 AC 121 ms
18,816 KB
testcase_19 AC 122 ms
18,816 KB
testcase_20 AC 121 ms
18,816 KB
testcase_21 AC 109 ms
18,796 KB
testcase_22 AC 106 ms
18,944 KB
testcase_23 AC 106 ms
18,816 KB
testcase_24 AC 110 ms
18,836 KB
testcase_25 AC 123 ms
18,816 KB
testcase_26 AC 126 ms
18,812 KB
testcase_27 AC 127 ms
18,812 KB
testcase_28 AC 125 ms
18,912 KB
testcase_29 AC 107 ms
18,732 KB
testcase_30 AC 103 ms
18,724 KB
testcase_31 AC 123 ms
18,944 KB
testcase_32 AC 121 ms
18,944 KB
testcase_33 AC 120 ms
18,888 KB
testcase_34 AC 125 ms
18,704 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;

// コンテスト中のみ
//#define int long long

#define ll long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define P pair<ll,ll>
#define ld long double
ll INF = (1LL << 60);
int MOD = 1000000007;


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	ll N; cin >> N;
	vector<ll>A(N), B(N); rep(i, N)cin >> A[i];
	rep(i, N)cin >> B[i];
	bool now = false;
	ll ans = 0;
	rep(i, N) {
		if (A[i] != B[i]) {
			now = true;
		}
		else {
			if (now) {
				ans++; now = false;
			}
		}
	}if (now) {
		ans++; now = false;
	}
	cout << ans << endl;
	return 0;
}
0