結果
| 問題 | No.1183 コイン遊び |
| コンテスト | |
| ユーザー |
iqueue02
|
| 提出日時 | 2020-08-22 14:16:16 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 205 ms / 2,000 ms |
| コード長 | 593 bytes |
| 記録 | |
| コンパイル時間 | 1,211 ms |
| コンパイル使用メモリ | 213,404 KB |
| 実行使用メモリ | 19,300 KB |
| 最終ジャッジ日時 | 2026-06-12 16:55:48 |
| 合計ジャッジ時間 | 7,790 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
#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;
}
iqueue02