結果

問題 No.1183 コイン遊び
ユーザー ecto0310ecto0310
提出日時 2020-08-22 13:06:33
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 493 bytes
コンパイル時間 2,182 ms
コンパイル使用メモリ 197,216 KB
実行使用メモリ 18,980 KB
最終ジャッジ日時 2024-04-23 07:23:21
合計ジャッジ時間 10,049 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,944 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 7 ms
6,948 KB
testcase_11 AC 19 ms
6,940 KB
testcase_12 AC 178 ms
13,036 KB
testcase_13 AC 158 ms
11,980 KB
testcase_14 AC 261 ms
17,808 KB
testcase_15 AC 277 ms
18,912 KB
testcase_16 AC 284 ms
18,808 KB
testcase_17 AC 278 ms
18,968 KB
testcase_18 AC 286 ms
18,832 KB
testcase_19 AC 282 ms
18,952 KB
testcase_20 AC 277 ms
18,896 KB
testcase_21 AC 263 ms
18,980 KB
testcase_22 AC 271 ms
18,944 KB
testcase_23 AC 284 ms
18,976 KB
testcase_24 AC 296 ms
18,952 KB
testcase_25 AC 285 ms
18,948 KB
testcase_26 AC 283 ms
18,816 KB
testcase_27 AC 280 ms
18,976 KB
testcase_28 AC 284 ms
18,900 KB
testcase_29 AC 283 ms
18,828 KB
testcase_30 AC 275 ms
18,816 KB
testcase_31 AC 290 ms
18,940 KB
testcase_32 AC 291 ms
18,904 KB
testcase_33 AC 287 ms
18,892 KB
testcase_34 AC 313 ms
18,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define endl "\n"

int main()
{
  i64 N;
  cin >> N;
  vector<i64> A(N), B(N);
  for (i64 i = 0; i < N; i++)
    cin >> A[i];
  for (i64 i = 0; i < N; i++)
    cin >> B[i];
  i64 ans = 0;
  bool diff = false;
  for (i64 i = 0; i < N; i++)
    if (A[i] == B[i])
    {
      if (diff)
        ans++;
      diff = false;
    }
    else
    {
      diff = true;
    }
  if (diff)
    ans++;
  cout << ans << endl;
  return 0;
}
0