結果

問題 No.1183 コイン遊び
ユーザー koutykkkkoutykkk
提出日時 2020-08-22 13:57:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 290 ms / 2,000 ms
コード長 873 bytes
コンパイル時間 2,003 ms
コンパイル使用メモリ 167,268 KB
実行使用メモリ 19,032 KB
最終ジャッジ日時 2023-08-05 11:07:49
合計ジャッジ時間 10,345 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 7 ms
4,376 KB
testcase_11 AC 18 ms
4,376 KB
testcase_12 AC 179 ms
12,896 KB
testcase_13 AC 156 ms
11,736 KB
testcase_14 AC 262 ms
17,668 KB
testcase_15 AC 273 ms
18,820 KB
testcase_16 AC 276 ms
19,004 KB
testcase_17 AC 277 ms
18,756 KB
testcase_18 AC 282 ms
19,020 KB
testcase_19 AC 282 ms
18,544 KB
testcase_20 AC 284 ms
18,664 KB
testcase_21 AC 264 ms
18,740 KB
testcase_22 AC 269 ms
18,472 KB
testcase_23 AC 280 ms
18,856 KB
testcase_24 AC 279 ms
18,756 KB
testcase_25 AC 276 ms
18,756 KB
testcase_26 AC 278 ms
18,760 KB
testcase_27 AC 280 ms
18,528 KB
testcase_28 AC 290 ms
19,032 KB
testcase_29 AC 273 ms
18,756 KB
testcase_30 AC 271 ms
18,664 KB
testcase_31 AC 281 ms
18,528 KB
testcase_32 AC 284 ms
18,836 KB
testcase_33 AC 281 ms
18,484 KB
testcase_34 AC 288 ms
18,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//(a+b-1)/b
//priority_queue<ll, vector<ll>, greater<ll>> q;


signed main(){
	//cout << fixed << setprecision(10);
	ll n; cin >> n;
	vl a(n),b(n);
	rep(i,0,n)cin >>a[i];
	rep(i,0,n)cin >> b[i];
	ll ans = 0, cnt = 0;
	rep(i,0,n){
		if(a[i] != b[i])cnt++;
		else{
			ans += (cnt != 0);
			cnt = 0;
		}
	}
	ans += (cnt != 0);
	cout << ans << endl;


	return 0;
}
0