結果

問題 No.1183 コイン遊び
ユーザー cpcznksutbeoacpcznksutbeoa
提出日時 2020-08-22 13:05:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 1,797 ms
コンパイル使用メモリ 166,284 KB
実行使用メモリ 11,432 KB
最終ジャッジ日時 2024-04-23 07:20:54
合計ジャッジ時間 10,707 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 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,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 9 ms
6,944 KB
testcase_11 AC 21 ms
6,944 KB
testcase_12 AC 203 ms
8,320 KB
testcase_13 AC 182 ms
7,936 KB
testcase_14 AC 304 ms
10,692 KB
testcase_15 AC 325 ms
11,136 KB
testcase_16 AC 325 ms
11,308 KB
testcase_17 AC 322 ms
11,188 KB
testcase_18 AC 322 ms
11,152 KB
testcase_19 AC 324 ms
11,224 KB
testcase_20 AC 324 ms
11,136 KB
testcase_21 AC 298 ms
11,120 KB
testcase_22 AC 298 ms
11,368 KB
testcase_23 AC 315 ms
11,120 KB
testcase_24 AC 316 ms
11,364 KB
testcase_25 AC 324 ms
11,120 KB
testcase_26 AC 330 ms
11,124 KB
testcase_27 AC 329 ms
11,152 KB
testcase_28 AC 323 ms
11,184 KB
testcase_29 AC 295 ms
11,196 KB
testcase_30 AC 319 ms
11,212 KB
testcase_31 AC 325 ms
11,144 KB
testcase_32 AC 327 ms
11,212 KB
testcase_33 AC 327 ms
11,432 KB
testcase_34 AC 325 ms
11,272 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main(){
    int N; cin>>N;
    vector<int>A(N);
    vector<int>B(N);
    vector<bool>C(N,true);
    for(int i=0;i<N;i++)cin>>A[i];
    for(int i=0;i<N;i++){
        cin>>B[i];
        if(A[i]!=B[i])C[i]=false;
    }
    int ans=0;
    bool count=true;
    for(int i=0;i<N;i++){
        if(C[i]==false){
            if(i==0)ans++;
            else if(C[i]!=C[i-1])ans++;
        }
    }
    cout<<ans<<endl;
}
0