結果

問題 No.1183 コイン遊び
ユーザー ぷらぷら
提出日時 2020-08-22 13:14:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 602 bytes
コンパイル時間 1,723 ms
コンパイル使用メモリ 165,372 KB
実行使用メモリ 19,056 KB
最終ジャッジ日時 2024-04-23 07:35:41
合計ジャッジ時間 10,530 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 8 ms
5,376 KB
testcase_11 AC 21 ms
5,376 KB
testcase_12 AC 206 ms
13,056 KB
testcase_13 AC 178 ms
12,000 KB
testcase_14 AC 300 ms
18,048 KB
testcase_15 AC 322 ms
18,924 KB
testcase_16 AC 322 ms
18,816 KB
testcase_17 AC 324 ms
18,816 KB
testcase_18 AC 323 ms
18,816 KB
testcase_19 AC 321 ms
18,816 KB
testcase_20 AC 323 ms
18,916 KB
testcase_21 AC 302 ms
18,816 KB
testcase_22 AC 300 ms
18,816 KB
testcase_23 AC 317 ms
18,940 KB
testcase_24 AC 317 ms
18,912 KB
testcase_25 AC 323 ms
18,972 KB
testcase_26 AC 323 ms
19,056 KB
testcase_27 AC 325 ms
18,816 KB
testcase_28 AC 321 ms
18,920 KB
testcase_29 AC 298 ms
19,048 KB
testcase_30 AC 324 ms
18,896 KB
testcase_31 AC 319 ms
18,816 KB
testcase_32 AC 321 ms
18,816 KB
testcase_33 AC 320 ms
19,040 KB
testcase_34 AC 321 ms
18,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e16+7;
int mod = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int N;
    cin >> N;
    vector<int>A(N),B(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    int ans = 0;
    bool ok = false;
    for(int i = 0; i < N; i++) {
        cin >> B[i];
        if(A[i] != B[i] && ok == false) {
            ans++;
            ok = true;
        }
        if(A[i] == B[i] && ok == true) {
            ok = false;
        }
    }
    cout << ans << endl;
}
0