結果
| 問題 |
No.1183 コイン遊び
|
| コンテスト | |
| ユーザー |
hayaten
|
| 提出日時 | 2020-08-22 15:07:38 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 511 ms / 2,000 ms |
| コード長 | 540 bytes |
| コンパイル時間 | 2,258 ms |
| コンパイル使用メモリ | 193,888 KB |
| 最終ジャッジ日時 | 2025-01-13 09:10:47 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n - 1); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
using namespace std;
using P = pair<int, int>;
typedef long long ll;
int main() {
int n;
cin >> n;
vector<int> A(n), B(n);
rep(i, n) cin >> A[i];
rep(i, n) cin >> B[i];
int ans = 0;
int cnt = 0;
rep(i, n) {
if(A[i] == B[i]){
cnt = 0;
continue;
}
if(cnt == 0 && A[i] != B[i]){
ans++;
cnt = 1;
}
}
cout << ans << endl;
}
hayaten