結果

問題 No.1183 コイン遊び
ユーザー Nzt3Nzt3
提出日時 2020-08-22 16:19:45
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 318 ms / 2,000 ms
コード長 544 bytes
コンパイル時間 1,809 ms
コンパイル使用メモリ 164,016 KB
実行使用メモリ 11,304 KB
最終ジャッジ日時 2024-04-23 10:30:08
合計ジャッジ時間 10,674 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 8 ms
6,940 KB
testcase_11 AC 21 ms
6,944 KB
testcase_12 AC 197 ms
8,124 KB
testcase_13 AC 177 ms
7,552 KB
testcase_14 AC 295 ms
10,572 KB
testcase_15 AC 314 ms
11,048 KB
testcase_16 AC 315 ms
11,064 KB
testcase_17 AC 315 ms
11,080 KB
testcase_18 AC 316 ms
11,000 KB
testcase_19 AC 314 ms
11,180 KB
testcase_20 AC 317 ms
11,156 KB
testcase_21 AC 293 ms
11,000 KB
testcase_22 AC 296 ms
11,076 KB
testcase_23 AC 316 ms
11,016 KB
testcase_24 AC 311 ms
11,020 KB
testcase_25 AC 316 ms
10,988 KB
testcase_26 AC 316 ms
11,060 KB
testcase_27 AC 318 ms
11,016 KB
testcase_28 AC 315 ms
10,992 KB
testcase_29 AC 295 ms
11,112 KB
testcase_30 AC 310 ms
11,152 KB
testcase_31 AC 315 ms
11,304 KB
testcase_32 AC 315 ms
11,076 KB
testcase_33 AC 315 ms
11,020 KB
testcase_34 AC 312 ms
11,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int>a(n);
    vector<int>b(n);
    for(int i=0;i<n;i++)
        cin >> a.at(i);
    for(int i=0;i<n;i++)
        cin >> b.at(i);
    int ans=0;
    bool che=false;
    for(int i=0;i<n;i++){
        if(che){
            if(a.at(i)==b.at(i)){
                che=false;
            }
        }else{
            if(a.at(i)!=b.at(i)){
                ans++;
                che=true;
            }
        }
    }
    cout << ans << endl;
    return 0;
}
0