結果

問題 No.1183 コイン遊び
ユーザー kappybarkappybar
提出日時 2020-08-23 13:25:20
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 178 ms / 2,000 ms
コード長 743 bytes
コンパイル時間 1,498 ms
コンパイル使用メモリ 165,152 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-04-23 17:35:49
合計ジャッジ時間 6,744 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,248 KB
testcase_02 AC 1 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 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 5 ms
5,376 KB
testcase_11 AC 11 ms
5,376 KB
testcase_12 AC 104 ms
8,192 KB
testcase_13 AC 96 ms
7,680 KB
testcase_14 AC 158 ms
10,720 KB
testcase_15 AC 164 ms
11,136 KB
testcase_16 AC 173 ms
11,136 KB
testcase_17 AC 173 ms
11,128 KB
testcase_18 AC 173 ms
11,136 KB
testcase_19 AC 169 ms
11,136 KB
testcase_20 AC 168 ms
11,132 KB
testcase_21 AC 154 ms
11,264 KB
testcase_22 AC 154 ms
11,304 KB
testcase_23 AC 155 ms
11,148 KB
testcase_24 AC 157 ms
11,392 KB
testcase_25 AC 168 ms
11,236 KB
testcase_26 AC 173 ms
11,196 KB
testcase_27 AC 178 ms
11,136 KB
testcase_28 AC 173 ms
11,200 KB
testcase_29 AC 156 ms
11,116 KB
testcase_30 AC 151 ms
11,128 KB
testcase_31 AC 169 ms
11,348 KB
testcase_32 AC 168 ms
11,304 KB
testcase_33 AC 167 ms
11,132 KB
testcase_34 AC 168 ms
11,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long long,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;

int main(){
    int n;
    scanf("%d",&n);
    vector<int> a(n),b(n);
    rep(i,n) scanf("%d",&a[i]);
    rep(i,n) scanf("%d",&b[i]);
    int ans = 0;
    bool now = false;
    rep(i,n){
        if(a[i]!=b[i]){
            if(now) continue;
            else{
                now = true;
                ++ans;
            }
        }else{
            if(now) now = false;
        }
    }
    printf("%d\n",ans);
    return 0;
}
0