結果

問題 No.1183 コイン遊び
ユーザー _heck_ate_heck_ate
提出日時 2020-08-22 13:04:40
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 321 ms / 2,000 ms
コード長 600 bytes
コンパイル時間 2,188 ms
コンパイル使用メモリ 196,404 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2024-04-23 07:18:24
合計ジャッジ時間 10,851 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 1 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 196 ms
10,880 KB
testcase_13 AC 175 ms
10,080 KB
testcase_14 AC 295 ms
14,428 KB
testcase_15 AC 317 ms
15,360 KB
testcase_16 AC 321 ms
15,232 KB
testcase_17 AC 316 ms
15,368 KB
testcase_18 AC 316 ms
15,368 KB
testcase_19 AC 313 ms
15,360 KB
testcase_20 AC 317 ms
15,296 KB
testcase_21 AC 302 ms
15,360 KB
testcase_22 AC 299 ms
15,360 KB
testcase_23 AC 314 ms
15,360 KB
testcase_24 AC 313 ms
15,232 KB
testcase_25 AC 317 ms
15,372 KB
testcase_26 AC 317 ms
15,360 KB
testcase_27 AC 320 ms
15,384 KB
testcase_28 AC 316 ms
15,148 KB
testcase_29 AC 299 ms
15,368 KB
testcase_30 AC 307 ms
15,360 KB
testcase_31 AC 314 ms
15,488 KB
testcase_32 AC 317 ms
15,360 KB
testcase_33 AC 314 ms
15,360 KB
testcase_34 AC 317 ms
15,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
  int N;
  cin >> N;
  int A[N],B[N];
  int C[N];
  for (int i = 0; i < N; i++) cin >> A[i];
  for (int i = 0; i < N; i++) cin >> B[i];
  int ans = 0;
  for (int i = 0; i < N; i++) {
    if (A[i] == B[i]) {
      C[i] = 0;
    } else {
      C[i] = 1;
    }
  }
  int st = 0;
  for (int i = 1; i < N; i++) {
    if (C[i-1] == 1 && C[i] == 0) {
      ans++;
    }
  }
  if (C[N-1] == 1) {
    ans++;
  }
  cout << ans << endl;
  return 0;
}
0