結果

問題 No.1183 コイン遊び
ユーザー IKyoproIKyopro
提出日時 2020-08-22 13:20:59
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 576 bytes
コンパイル時間 2,300 ms
コンパイル使用メモリ 196,672 KB
実行使用メモリ 11,188 KB
最終ジャッジ日時 2024-04-23 07:44:19
合計ジャッジ時間 7,273 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 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,940 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 5 ms
6,944 KB
testcase_11 AC 10 ms
6,944 KB
testcase_12 AC 84 ms
8,064 KB
testcase_13 AC 76 ms
7,680 KB
testcase_14 AC 122 ms
10,508 KB
testcase_15 AC 132 ms
11,076 KB
testcase_16 AC 132 ms
10,996 KB
testcase_17 AC 135 ms
11,124 KB
testcase_18 AC 133 ms
11,020 KB
testcase_19 AC 134 ms
11,048 KB
testcase_20 AC 133 ms
11,128 KB
testcase_21 AC 116 ms
11,104 KB
testcase_22 AC 117 ms
11,116 KB
testcase_23 AC 115 ms
10,992 KB
testcase_24 AC 114 ms
11,132 KB
testcase_25 AC 133 ms
11,036 KB
testcase_26 AC 134 ms
11,080 KB
testcase_27 AC 133 ms
11,156 KB
testcase_28 AC 131 ms
11,016 KB
testcase_29 AC 118 ms
11,052 KB
testcase_30 AC 115 ms
11,084 KB
testcase_31 AC 132 ms
11,188 KB
testcase_32 AC 133 ms
11,004 KB
testcase_33 AC 132 ms
10,972 KB
testcase_34 AC 132 ms
11,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template <class T> using vvvec = vector<vvec<T>>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vec<int> A(N),B(N);
    for(auto& x:A) cin >> x;
    for(auto& x:B) cin >> x;
    int ans = 0;
    for(int l=0;l<N;l++){
        if(A[l]==B[l]) continue;
        int r = l+1;
        while(r<N && A[r]!=B[r]) r++;
        ans++;
        l = r-1;
    }
    cout << ans << "\n";
}
0