結果

問題 No.1183 コイン遊び
ユーザー okok
提出日時 2020-08-22 13:08:39
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 321 ms / 2,000 ms
コード長 451 bytes
コンパイル時間 615 ms
コンパイル使用メモリ 70,000 KB
実行使用メモリ 11,244 KB
最終ジャッジ日時 2024-04-23 07:27:24
合計ジャッジ時間 9,368 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 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 8 ms
5,376 KB
testcase_11 AC 21 ms
5,376 KB
testcase_12 AC 200 ms
8,192 KB
testcase_13 AC 180 ms
7,552 KB
testcase_14 AC 298 ms
10,624 KB
testcase_15 AC 317 ms
11,008 KB
testcase_16 AC 318 ms
11,008 KB
testcase_17 AC 316 ms
11,240 KB
testcase_18 AC 318 ms
11,008 KB
testcase_19 AC 320 ms
11,228 KB
testcase_20 AC 318 ms
11,008 KB
testcase_21 AC 296 ms
11,136 KB
testcase_22 AC 298 ms
11,136 KB
testcase_23 AC 316 ms
11,136 KB
testcase_24 AC 314 ms
11,244 KB
testcase_25 AC 318 ms
11,136 KB
testcase_26 AC 317 ms
11,136 KB
testcase_27 AC 321 ms
10,996 KB
testcase_28 AC 319 ms
11,136 KB
testcase_29 AC 298 ms
11,092 KB
testcase_30 AC 307 ms
11,008 KB
testcase_31 AC 318 ms
11,008 KB
testcase_32 AC 318 ms
11,136 KB
testcase_33 AC 318 ms
11,008 KB
testcase_34 AC 315 ms
11,136 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<vector>

using namespace std;

signed main(){
  int N;
  vector<int> A, B;

  cin>>N;

  A.resize(N);
  B.resize(N);

  for(int i = 0; i < N; i++){
    cin>>A[i];
  }

  for(int i = 0; i < N; i++){
    cin>>B[i];
  }

  int con = 0, con2 = 0;
  for(int i = 0; i < N; i++){

    if((A[i] + con2)%2 != B[i]) {
      if(con2 == 0)con++, con2++;
      else con2--;
    }
  }

  cout<<con<<endl;

  return 0;
}
0