結果

問題 No.1183 コイン遊び
ユーザー cromcrom
提出日時 2020-08-22 13:04:29
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 1,436 bytes
コンパイル時間 1,978 ms
コンパイル使用メモリ 165,184 KB
実行使用メモリ 11,000 KB
最終ジャッジ日時 2024-04-23 07:17:27
合計ジャッジ時間 6,589 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 5 ms
6,940 KB
testcase_11 AC 10 ms
6,944 KB
testcase_12 AC 84 ms
7,936 KB
testcase_13 AC 79 ms
7,424 KB
testcase_14 AC 127 ms
10,344 KB
testcase_15 AC 138 ms
10,872 KB
testcase_16 AC 137 ms
10,928 KB
testcase_17 AC 135 ms
10,936 KB
testcase_18 AC 137 ms
10,916 KB
testcase_19 AC 135 ms
10,876 KB
testcase_20 AC 137 ms
10,920 KB
testcase_21 AC 122 ms
10,884 KB
testcase_22 AC 116 ms
10,908 KB
testcase_23 AC 119 ms
10,868 KB
testcase_24 AC 119 ms
10,980 KB
testcase_25 AC 137 ms
10,936 KB
testcase_26 AC 138 ms
10,924 KB
testcase_27 AC 136 ms
10,920 KB
testcase_28 AC 138 ms
11,000 KB
testcase_29 AC 122 ms
10,980 KB
testcase_30 AC 119 ms
10,980 KB
testcase_31 AC 139 ms
10,980 KB
testcase_32 AC 139 ms
10,984 KB
testcase_33 AC 138 ms
10,908 KB
testcase_34 AC 136 ms
10,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define log_2(a) (log((a)) / log(2))
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int N;
    cin >> N;
    vector<int> u(N), v(N);

    for(int i = 0; i < N; ++i) {
        cin >> u[i];
    }
    for(int i = 0; i < N; ++i) {
        cin >> v[i];
    }

    int c = 0;
    int res = 0;
    for(int i = 0; i < N; ++i) {
        if(u[i] == v[i] && c > 0) {
            ++res;
            c = 0;
        }
        if(u[i] != v[i]) {
            ++c;
        }
    }
    if(c > 0) ++res;
    cout << res << endl;
    return 0;
}

0