結果

問題 No.1183 コイン遊び
ユーザー kaede2020
提出日時 2020-08-22 13:15:28
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 310 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 1,653 ms
コンパイル使用メモリ 167,684 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-10-15 07:27:14
合計ジャッジ時間 9,989 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; }
template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; }
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long 
int main(){
	int n;
	cin>>n;
	vector<int >a(n),b(n);
	rep(i,n)cin>>a[i];
	rep(i,n)cin>>b[i];
	int cnt=0;
	bool hantei=false;
	rep(i,n){
		if(a[i]!=b[i]&&hantei==false){
			cnt++;
			hantei=true;
		}else if(a[i]==b[i]){
			hantei=false;
		}
	}
	cout<<cnt<<endl;
	return 0;
}
0