結果

問題 No.1183 コイン遊び
ユーザー poohbearpoohbear
提出日時 2020-08-22 13:15:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 852 bytes
コンパイル時間 2,573 ms
コンパイル使用メモリ 201,280 KB
実行使用メモリ 19,300 KB
最終ジャッジ日時 2024-04-23 07:37:32
合計ジャッジ時間 10,632 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 1 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 8 ms
6,944 KB
testcase_11 AC 20 ms
6,944 KB
testcase_12 AC 185 ms
13,236 KB
testcase_13 AC 164 ms
12,176 KB
testcase_14 AC 280 ms
18,004 KB
testcase_15 AC 286 ms
19,168 KB
testcase_16 AC 295 ms
19,236 KB
testcase_17 AC 285 ms
19,156 KB
testcase_18 AC 282 ms
19,136 KB
testcase_19 AC 290 ms
19,140 KB
testcase_20 AC 288 ms
19,084 KB
testcase_21 AC 262 ms
19,300 KB
testcase_22 AC 270 ms
19,028 KB
testcase_23 AC 280 ms
19,068 KB
testcase_24 AC 278 ms
19,068 KB
testcase_25 AC 286 ms
19,092 KB
testcase_26 AC 286 ms
19,076 KB
testcase_27 AC 288 ms
19,088 KB
testcase_28 AC 285 ms
19,064 KB
testcase_29 AC 265 ms
19,272 KB
testcase_30 AC 271 ms
19,164 KB
testcase_31 AC 286 ms
19,232 KB
testcase_32 AC 288 ms
19,244 KB
testcase_33 AC 288 ms
19,184 KB
testcase_34 AC 284 ms
19,076 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
using ll = long long;
typedef pair<ll,ll> P;
typedef pair<P,ll> PP;
typedef vector<vector<ll> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;



int main(){
    ll n;
    cin >> n;
    vector<ll>a(n),b(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    ll cnt = 0;
    vector<bool>same;
    same.push_back(true);
    rep(i,n){
        if(a[i]==b[i]){
            same.push_back(true);
        }
        else{
            same.push_back(false);
        }
    }
    same.push_back(true);
    rep(i,n+1){
        if(same[i]&&(!same[i+1]))cnt++;
    }
    cout << cnt << endl;
    return 0;
}
0