結果
問題 |
No.1183 コイン遊び
|
ユーザー |
|
提出日時 | 2020-08-23 16:47:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 325 ms / 2,000 ms |
コード長 | 668 bytes |
コンパイル時間 | 765 ms |
コンパイル使用メモリ | 91,760 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-10-15 18:46:07 |
合計ジャッジ時間 | 9,826 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <iomanip> #include <cmath> #include <stdio.h> #include <queue> #include <deque> #include <cstdio> #include <set> #include <map> #include <bitset> #include <stack> #include <cctype> using namespace std; bool a[1000010], b[1000010]; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } for (int j = 0; j < n; j++) { cin >> b[j]; } int ans = 0; bool bo = false; for (int i = 0; i < n; i++) { if (a[i] != b[i]) { bo = true; } else { if (bo) { ans++; } bo = false; } } if (bo) { ans++; } cout << ans << endl; return 0; }