結果

問題 No.1183 コイン遊び
ユーザー iqueue02iqueue02
提出日時 2020-08-22 14:16:16
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 298 ms / 2,000 ms
コード長 593 bytes
コンパイル時間 2,255 ms
コンパイル使用メモリ 197,512 KB
実行使用メモリ 19,504 KB
最終ジャッジ日時 2024-04-23 08:37:56
合計ジャッジ時間 10,374 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 1 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 1 ms
6,944 KB
testcase_10 AC 7 ms
6,944 KB
testcase_11 AC 19 ms
6,940 KB
testcase_12 AC 181 ms
11,896 KB
testcase_13 AC 160 ms
11,984 KB
testcase_14 AC 270 ms
14,588 KB
testcase_15 AC 288 ms
15,772 KB
testcase_16 AC 284 ms
15,416 KB
testcase_17 AC 294 ms
15,820 KB
testcase_18 AC 298 ms
15,300 KB
testcase_19 AC 289 ms
16,220 KB
testcase_20 AC 289 ms
16,892 KB
testcase_21 AC 266 ms
15,480 KB
testcase_22 AC 264 ms
15,664 KB
testcase_23 AC 279 ms
15,920 KB
testcase_24 AC 288 ms
15,852 KB
testcase_25 AC 286 ms
16,908 KB
testcase_26 AC 291 ms
15,348 KB
testcase_27 AC 285 ms
15,580 KB
testcase_28 AC 291 ms
15,940 KB
testcase_29 AC 271 ms
15,516 KB
testcase_30 AC 284 ms
19,504 KB
testcase_31 AC 289 ms
15,668 KB
testcase_32 AC 295 ms
15,296 KB
testcase_33 AC 285 ms
15,392 KB
testcase_34 AC 289 ms
15,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
constexpr int INF = 1e9;

int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n);
  int res = 0;
  rep(i,n) cin >> a[i];
  rep(i,n) cin >> b[i], a[i] ^= b[i];
  vector<int> v;
  a.emplace_back(10);

  int prev = 0;
  for (int i = 0; i <= n; i++) {
    if (a[i] != a[prev]) {
      v.emplace_back(a[prev]);
      prev = i;
    }
  }

  for (auto e : v) res += e;

  cout << res << endl;
  return 0;
}
0