結果

問題 No.1183 コイン遊び
ユーザー akaneakane
提出日時 2020-08-22 13:09:17
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 156 ms / 2,000 ms
コード長 547 bytes
コンパイル時間 1,853 ms
コンパイル使用メモリ 195,808 KB
実行使用メモリ 11,216 KB
最終ジャッジ日時 2024-04-23 07:28:58
合計ジャッジ時間 6,638 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 5 ms
5,376 KB
testcase_11 AC 10 ms
5,376 KB
testcase_12 AC 96 ms
8,064 KB
testcase_13 AC 81 ms
7,552 KB
testcase_14 AC 135 ms
10,624 KB
testcase_15 AC 156 ms
11,008 KB
testcase_16 AC 150 ms
11,132 KB
testcase_17 AC 145 ms
11,124 KB
testcase_18 AC 145 ms
11,008 KB
testcase_19 AC 152 ms
11,008 KB
testcase_20 AC 141 ms
11,132 KB
testcase_21 AC 124 ms
11,216 KB
testcase_22 AC 116 ms
11,136 KB
testcase_23 AC 131 ms
11,008 KB
testcase_24 AC 123 ms
11,116 KB
testcase_25 AC 148 ms
11,008 KB
testcase_26 AC 147 ms
11,040 KB
testcase_27 AC 145 ms
11,112 KB
testcase_28 AC 146 ms
11,020 KB
testcase_29 AC 121 ms
11,120 KB
testcase_30 AC 138 ms
11,100 KB
testcase_31 AC 148 ms
10,880 KB
testcase_32 AC 150 ms
11,008 KB
testcase_33 AC 149 ms
11,008 KB
testcase_34 AC 146 ms
11,028 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