結果

問題 No.1183 コイン遊び
ユーザー Osmium_1008Osmium_1008
提出日時 2020-08-22 13:04:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 145 ms / 2,000 ms
コード長 1,076 bytes
コンパイル時間 5,798 ms
コンパイル使用メモリ 379,316 KB
実行使用メモリ 18,944 KB
最終ジャッジ日時 2024-04-23 07:17:48
合計ジャッジ時間 10,640 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 6 ms
5,376 KB
testcase_11 AC 12 ms
5,376 KB
testcase_12 AC 92 ms
12,984 KB
testcase_13 AC 81 ms
12,004 KB
testcase_14 AC 133 ms
17,908 KB
testcase_15 AC 141 ms
18,924 KB
testcase_16 AC 140 ms
18,944 KB
testcase_17 AC 141 ms
18,852 KB
testcase_18 AC 143 ms
18,836 KB
testcase_19 AC 143 ms
18,816 KB
testcase_20 AC 140 ms
18,944 KB
testcase_21 AC 127 ms
18,944 KB
testcase_22 AC 119 ms
18,944 KB
testcase_23 AC 122 ms
18,816 KB
testcase_24 AC 125 ms
18,940 KB
testcase_25 AC 142 ms
18,944 KB
testcase_26 AC 141 ms
18,944 KB
testcase_27 AC 143 ms
18,816 KB
testcase_28 AC 141 ms
18,844 KB
testcase_29 AC 126 ms
18,944 KB
testcase_30 AC 123 ms
18,944 KB
testcase_31 AC 140 ms
18,816 KB
testcase_32 AC 145 ms
18,816 KB
testcase_33 AC 140 ms
18,944 KB
testcase_34 AC 140 ms
18,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define int long long

#define override_rep(i, l, r, mes, ...) mes
#define rep1(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = l; i < r; i++)
#define rep(...) override_rep(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)

using namespace std;
using P = pair<int, int>;
using ll = long long;
using ld = double;

using bint = boost::multiprecision::cpp_int;

constexpr int MOD = 1e9 + 7;

template<typename T, typename U>
istream& operator>>(istream& in, pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}

// https://twitter.com/vane11ope ←フォローしましょう
// (ノ)>◡<(ヾ)モチモチ
signed main(signed argc, char* argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n;
    cin>>n;
    vector<int> a(n),b(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    bool bo=true;
    int ans=0;
    rep(i,n){
        if(bo && a[i]!=b[i]){
            bo=false;
            ans++;
        }
        if(a[i]==b[i])bo=true;
    }
    cout<<ans<<endl;
}
0