結果

問題 No.1183 コイン遊び
ユーザー ぷらぷら
提出日時 2020-08-22 13:14:11
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 602 bytes
コンパイル時間 1,497 ms
コンパイル使用メモリ 166,632 KB
実行使用メモリ 18,992 KB
最終ジャッジ日時 2023-08-05 10:03:24
合計ジャッジ時間 10,099 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 8 ms
4,376 KB
testcase_11 AC 20 ms
4,376 KB
testcase_12 AC 185 ms
12,980 KB
testcase_13 AC 165 ms
11,620 KB
testcase_14 AC 278 ms
17,860 KB
testcase_15 AC 294 ms
18,500 KB
testcase_16 AC 294 ms
18,592 KB
testcase_17 AC 294 ms
18,740 KB
testcase_18 AC 295 ms
18,988 KB
testcase_19 AC 298 ms
18,784 KB
testcase_20 AC 294 ms
18,848 KB
testcase_21 AC 276 ms
18,660 KB
testcase_22 AC 276 ms
18,656 KB
testcase_23 AC 292 ms
18,672 KB
testcase_24 AC 290 ms
18,788 KB
testcase_25 AC 297 ms
18,736 KB
testcase_26 AC 296 ms
18,484 KB
testcase_27 AC 295 ms
18,792 KB
testcase_28 AC 298 ms
18,604 KB
testcase_29 AC 275 ms
18,992 KB
testcase_30 AC 295 ms
18,844 KB
testcase_31 AC 296 ms
18,840 KB
testcase_32 AC 292 ms
18,732 KB
testcase_33 AC 293 ms
18,700 KB
testcase_34 AC 294 ms
18,580 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