結果

問題 No.1183 コイン遊び
ユーザー akaneakane
提出日時 2020-08-22 13:09:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 547 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 200,724 KB
実行使用メモリ 11,104 KB
最終ジャッジ日時 2023-08-05 09:56:00
合計ジャッジ時間 7,717 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 5 ms
4,380 KB
testcase_11 AC 12 ms
4,380 KB
testcase_12 AC 103 ms
7,920 KB
testcase_13 AC 93 ms
7,204 KB
testcase_14 AC 153 ms
10,300 KB
testcase_15 AC 165 ms
10,808 KB
testcase_16 AC 162 ms
10,796 KB
testcase_17 AC 163 ms
10,768 KB
testcase_18 AC 163 ms
10,748 KB
testcase_19 AC 163 ms
10,764 KB
testcase_20 AC 164 ms
10,804 KB
testcase_21 AC 140 ms
10,896 KB
testcase_22 AC 138 ms
10,824 KB
testcase_23 AC 141 ms
10,804 KB
testcase_24 AC 139 ms
10,940 KB
testcase_25 AC 163 ms
10,760 KB
testcase_26 AC 163 ms
10,888 KB
testcase_27 AC 164 ms
10,808 KB
testcase_28 AC 165 ms
10,944 KB
testcase_29 AC 139 ms
10,752 KB
testcase_30 AC 147 ms
10,824 KB
testcase_31 AC 165 ms
10,740 KB
testcase_32 AC 163 ms
10,796 KB
testcase_33 AC 164 ms
10,812 KB
testcase_34 AC 162 ms
11,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i < (n); i++)
using namespace std;
using ll = long long;

int main(){
    ios::sync_with_stdio(false);
    int N; cin>>N;
    vector<int> A(N),B(N);
    rep(i,N) cin>>A[i];
    rep(i,N) cin>>B[i];

    string flg="same"; // same or dif
    int ans = 0;
    rep(i,N){
        if(A[i]!=B[i]){
            flg = "dif";
        }else if(A[i]==B[i] && flg=="dif"){
            ans++;
            flg = "same";
        }

        if(i == N-1 && flg=="dif") ans++;
    }
    cout << ans << endl;
}
0