結果

問題 No.1183 コイン遊び
ユーザー maple116
提出日時 2020-08-22 13:03:19
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 389 ms / 2,000 ms
コード長 1,011 bytes
コンパイル時間 2,179 ms
コンパイル使用メモリ 194,996 KB
最終ジャッジ日時 2025-01-13 07:01:41
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
typedef pair<ll,ll> prl;
typedef vector<ll> vcl;
typedef map<ll,ll> mapl;
typedef unordered_map<ll,ll> umap;
#define pb push_back
#define all(v) v.begin(), v.end()
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define repi(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(ll i=a;i>=b;i--)
#define reps(i,v) for(ll i=0;i<v.size();i++)
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
const ll mod = 1e9+7;

int main() {
    // your code goes here
    ll n,a[1000005]={0},b[1000005]={0},ans=0;
    bool ch=false;
    cin >> n;
    rep(i,1,n){
    	cin >> a[i];
    }
    rep(i,1,n){
    	cin >> b[i];
    }
    rep(i,1,n+1){
    	if(a[i]==b[i]){
    		if(ch) ans++;
    		ch = false;
    	} else {
    		ch = true;
    	}
    }
    cout << ans << endl;
    return 0;
}
0