結果

問題 No.1183 コイン遊び
ユーザー chacoder1chacoder1
提出日時 2020-08-22 13:41:01
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 315 ms / 2,000 ms
コード長 536 bytes
コンパイル時間 2,048 ms
コンパイル使用メモリ 194,976 KB
実行使用メモリ 11,516 KB
最終ジャッジ日時 2024-04-23 08:07:36
合計ジャッジ時間 10,605 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 3 ms
6,944 KB
testcase_08 AC 3 ms
6,940 KB
testcase_09 AC 3 ms
6,940 KB
testcase_10 AC 8 ms
6,944 KB
testcase_11 AC 21 ms
6,944 KB
testcase_12 AC 194 ms
10,416 KB
testcase_13 AC 173 ms
10,456 KB
testcase_14 AC 290 ms
11,120 KB
testcase_15 AC 310 ms
11,396 KB
testcase_16 AC 315 ms
11,424 KB
testcase_17 AC 311 ms
11,340 KB
testcase_18 AC 311 ms
11,376 KB
testcase_19 AC 310 ms
11,504 KB
testcase_20 AC 312 ms
11,404 KB
testcase_21 AC 291 ms
11,276 KB
testcase_22 AC 296 ms
11,384 KB
testcase_23 AC 313 ms
11,224 KB
testcase_24 AC 307 ms
11,444 KB
testcase_25 AC 311 ms
11,224 KB
testcase_26 AC 309 ms
11,364 KB
testcase_27 AC 311 ms
11,236 KB
testcase_28 AC 312 ms
11,360 KB
testcase_29 AC 295 ms
11,516 KB
testcase_30 AC 304 ms
11,356 KB
testcase_31 AC 311 ms
11,416 KB
testcase_32 AC 312 ms
11,320 KB
testcase_33 AC 314 ms
11,368 KB
testcase_34 AC 310 ms
11,292 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main(){
  int N;
  cin>>N;
  int a[1001000];
  int b[1001000];
  for(int i=0;i<N;i++){
    cin>>a[i];
  }
  for(int i=0;i<N;i++){
    cin>>b[i];
    //cout<<i<<" "<<a[i]<<" "<<b[i]<<endl;
  }
  int cnt=0;
  int flag=1;
  for(int i=0;i<N;i++){
    //cout<<i<<" "<<flag<<" "<<a[i] <<" "<<b[i]   <<endl;
    if(flag == 1 && a[i]!=b[i]){
      flag=0;
      cnt++;
    }
    else if(flag==0 && a[i]==b[i]){
      flag=1;
    } 
  }  
  cout<<cnt<<endl;
  
  return 0;
}

  
       
       
0