結果

問題 No.1183 コイン遊び
ユーザー wacchozwacchoz
提出日時 2020-08-22 16:42:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 308 ms / 2,000 ms
コード長 2,138 bytes
コンパイル時間 1,476 ms
コンパイル使用メモリ 167,244 KB
実行使用メモリ 19,012 KB
最終ジャッジ日時 2024-04-23 10:41:55
合計ジャッジ時間 9,560 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,948 KB
testcase_10 AC 8 ms
6,944 KB
testcase_11 AC 19 ms
6,944 KB
testcase_12 AC 181 ms
12,900 KB
testcase_13 AC 157 ms
12,044 KB
testcase_14 AC 270 ms
18,032 KB
testcase_15 AC 300 ms
18,816 KB
testcase_16 AC 283 ms
18,868 KB
testcase_17 AC 282 ms
18,984 KB
testcase_18 AC 292 ms
18,836 KB
testcase_19 AC 286 ms
18,984 KB
testcase_20 AC 287 ms
18,840 KB
testcase_21 AC 296 ms
18,816 KB
testcase_22 AC 308 ms
18,816 KB
testcase_23 AC 286 ms
18,944 KB
testcase_24 AC 285 ms
18,816 KB
testcase_25 AC 281 ms
18,980 KB
testcase_26 AC 278 ms
18,944 KB
testcase_27 AC 282 ms
18,808 KB
testcase_28 AC 285 ms
18,944 KB
testcase_29 AC 270 ms
18,976 KB
testcase_30 AC 281 ms
18,816 KB
testcase_31 AC 284 ms
18,816 KB
testcase_32 AC 279 ms
18,816 KB
testcase_33 AC 288 ms
18,816 KB
testcase_34 AC 277 ms
19,012 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#ifdef DEBUG
    #include "debug.h"
    #define dump(...)                                                              \
        DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
                << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
                << endl                                                            \
                << "    ",                                                         \
            dump_func(__VA_ARGS__)
#else
    #define dump(...)
#endif


// http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//////////////////

#define int long long
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
#define ALL(v) (v).begin(), (v).end()
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

/*
#define mod 1000000007 /*/
#define mod 998244353 //*/

typedef pair<int, int> P;
#define INF (1LL<<60)


void solve(){
    int N;
    cin >> N;
    vector<int> A(N), B(N);
    rep(i,N) cin >> A[i];
    rep(i,N) cin >> B[i];
    int ans = 0;
    bool same = true;
    rep(i,N){
        if(A[i]!=B[i]){
            if(same){ ans++; same=false;}
        }else{
            if(!same){ same=true;}
        }
    }
    cout << ans << endl;
}


signed main(){
    cout << fixed << setprecision(18);
//    cerr << fixed << setprecision(18);
    solve();
}
0