結果

問題 No.1183 コイン遊び
ユーザー oliverx3oliverx3
提出日時 2020-08-22 13:04:12
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 288 ms / 2,000 ms
コード長 2,415 bytes
コンパイル時間 1,735 ms
コンパイル使用メモリ 166,704 KB
実行使用メモリ 18,956 KB
最終ジャッジ日時 2023-08-05 09:42:48
合計ジャッジ時間 9,945 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 7 ms
4,380 KB
testcase_11 AC 19 ms
4,380 KB
testcase_12 AC 179 ms
12,916 KB
testcase_13 AC 156 ms
11,568 KB
testcase_14 AC 263 ms
17,796 KB
testcase_15 AC 277 ms
18,720 KB
testcase_16 AC 288 ms
18,760 KB
testcase_17 AC 282 ms
18,528 KB
testcase_18 AC 282 ms
18,692 KB
testcase_19 AC 282 ms
18,740 KB
testcase_20 AC 283 ms
18,816 KB
testcase_21 AC 268 ms
18,560 KB
testcase_22 AC 270 ms
18,496 KB
testcase_23 AC 286 ms
18,728 KB
testcase_24 AC 281 ms
18,716 KB
testcase_25 AC 280 ms
18,596 KB
testcase_26 AC 284 ms
18,764 KB
testcase_27 AC 285 ms
18,584 KB
testcase_28 AC 279 ms
18,724 KB
testcase_29 AC 273 ms
18,956 KB
testcase_30 AC 275 ms
18,624 KB
testcase_31 AC 280 ms
18,688 KB
testcase_32 AC 280 ms
18,688 KB
testcase_33 AC 282 ms
18,564 KB
testcase_34 AC 279 ms
18,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma region header
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr int inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
signed main() {
    int n;cin >> n;
    vi a(n),b(n);
    rep(i, n)cin >> a[i];
    rep(i, n)cin >> b[i];
    int count=0;
    int flag=0;
    rep(i, n){
        if(a[i]!=b[i]&&flag==0) {
            count++;
            flag=1;
        }
        else if(a[i]==b[i]&&flag==1) flag=0;
    }
    cout << count << endl;
    return 0;
}
0