結果

問題 No.1183 コイン遊び
ユーザー tkmst201tkmst201
提出日時 2021-01-09 11:51:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 186 ms / 2,000 ms
コード長 870 bytes
コンパイル時間 2,851 ms
コンパイル使用メモリ 202,252 KB
実行使用メモリ 15,224 KB
最終ジャッジ日時 2024-04-28 19:12:43
合計ジャッジ時間 8,271 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,812 KB
testcase_02 AC 2 ms
6,812 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,940 KB
testcase_05 AC 2 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,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 6 ms
6,940 KB
testcase_11 AC 13 ms
6,940 KB
testcase_12 AC 119 ms
10,752 KB
testcase_13 AC 107 ms
9,856 KB
testcase_14 AC 174 ms
14,296 KB
testcase_15 AC 186 ms
15,012 KB
testcase_16 AC 185 ms
14,944 KB
testcase_17 AC 184 ms
15,012 KB
testcase_18 AC 184 ms
15,044 KB
testcase_19 AC 184 ms
15,072 KB
testcase_20 AC 184 ms
15,176 KB
testcase_21 AC 173 ms
15,120 KB
testcase_22 AC 173 ms
15,012 KB
testcase_23 AC 173 ms
15,224 KB
testcase_24 AC 170 ms
14,884 KB
testcase_25 AC 184 ms
15,032 KB
testcase_26 AC 185 ms
15,008 KB
testcase_27 AC 184 ms
15,056 KB
testcase_28 AC 184 ms
15,016 KB
testcase_29 AC 173 ms
15,008 KB
testcase_30 AC 172 ms
15,072 KB
testcase_31 AC 185 ms
14,948 KB
testcase_32 AC 185 ms
15,060 KB
testcase_33 AC 186 ms
15,048 KB
testcase_34 AC 184 ms
14,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
template<typename A, typename B> inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; }
template<typename A, typename B> inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = false;
//---------------------------------//

int main() {
	int N;
	cin >> N;
	vector<int> A(N), B(N);
	REP(i, N) scanf("%d", &A[i]);
	REP(i, N) scanf("%d", &B[i]);
	int ans = 0;
	vector<int> C(N);
	REP(i, N) C[i] = A[i] ^ B[i];
	FOR(i, 1, N) ans += C[i - 1] & !C[i];
	ans += C[N - 1];
	cout << ans << endl;
}
0