結果

問題 No.1183 コイン遊び
ユーザー koutykkkkoutykkk
提出日時 2020-08-22 13:57:37
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 873 bytes
コンパイル時間 1,633 ms
コンパイル使用メモリ 165,564 KB
実行使用メモリ 19,116 KB
最終ジャッジ日時 2024-04-23 08:23:51
合計ジャッジ時間 10,345 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 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 8 ms
6,940 KB
testcase_11 AC 21 ms
6,940 KB
testcase_12 AC 196 ms
12,912 KB
testcase_13 AC 176 ms
12,004 KB
testcase_14 AC 292 ms
17,956 KB
testcase_15 AC 312 ms
18,872 KB
testcase_16 AC 314 ms
18,812 KB
testcase_17 AC 312 ms
18,940 KB
testcase_18 AC 313 ms
19,116 KB
testcase_19 AC 311 ms
18,904 KB
testcase_20 AC 314 ms
18,884 KB
testcase_21 AC 296 ms
18,932 KB
testcase_22 AC 299 ms
18,972 KB
testcase_23 AC 320 ms
18,812 KB
testcase_24 AC 312 ms
19,036 KB
testcase_25 AC 313 ms
18,988 KB
testcase_26 AC 313 ms
18,936 KB
testcase_27 AC 313 ms
18,900 KB
testcase_28 AC 312 ms
18,936 KB
testcase_29 AC 300 ms
18,820 KB
testcase_30 AC 305 ms
18,836 KB
testcase_31 AC 314 ms
18,920 KB
testcase_32 AC 314 ms
18,908 KB
testcase_33 AC 314 ms
18,960 KB
testcase_34 AC 312 ms
18,856 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