結果

問題 No.1183 コイン遊び
ユーザー 尻リハビリ尻リハビリ
提出日時 2020-09-08 04:34:49
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 257 ms / 2,000 ms
コード長 655 bytes
コンパイル時間 506 ms
コンパイル使用メモリ 73,496 KB
実行使用メモリ 11,076 KB
最終ジャッジ日時 2023-08-19 17:30:02
合計ジャッジ時間 8,288 ms
ジャッジサーバーID
(参考情報)
judge11 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 6 ms
4,380 KB
testcase_11 AC 17 ms
4,380 KB
testcase_12 AC 158 ms
7,920 KB
testcase_13 AC 141 ms
7,212 KB
testcase_14 AC 234 ms
10,304 KB
testcase_15 AC 254 ms
10,776 KB
testcase_16 AC 253 ms
10,816 KB
testcase_17 AC 252 ms
10,948 KB
testcase_18 AC 252 ms
10,828 KB
testcase_19 AC 253 ms
11,068 KB
testcase_20 AC 252 ms
10,896 KB
testcase_21 AC 235 ms
10,816 KB
testcase_22 AC 240 ms
10,768 KB
testcase_23 AC 257 ms
10,760 KB
testcase_24 AC 250 ms
10,808 KB
testcase_25 AC 253 ms
10,764 KB
testcase_26 AC 255 ms
10,808 KB
testcase_27 AC 257 ms
10,764 KB
testcase_28 AC 251 ms
10,872 KB
testcase_29 AC 238 ms
11,076 KB
testcase_30 AC 249 ms
10,808 KB
testcase_31 AC 252 ms
10,816 KB
testcase_32 AC 250 ms
10,948 KB
testcase_33 AC 252 ms
10,804 KB
testcase_34 AC 257 ms
10,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <utility>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>


using namespace std;

int main(){

    long long int n;
    cin>>n;
    vector<int> x(n);
    vector<int> y(n);
    for (int i=0;i<n;i++){
        cin>>x[i];
    }
    for (int i=0;i<n;i++){
        cin>>y[i];
    }

    long long int ans=0;
    bool s=0;
    
    for (int i=0;i<x.size();i++){
        if(!s&&x[i]!=y[i]){
            s=1;
            continue;
        }
        if(s&&x[i]==y[i]){
            s=0;
            ans++;
            continue;
        }
    }

    if (s)
        ans++;
    cout<<ans<<endl;

    
    

   
    
}
0