結果

問題 No.1183 コイン遊び
ユーザー kaede2020kaede2020
提出日時 2020-08-22 13:15:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 289 ms / 2,000 ms
コード長 606 bytes
コンパイル時間 5,831 ms
コンパイル使用メモリ 166,140 KB
実行使用メモリ 11,076 KB
最終ジャッジ日時 2023-08-05 10:05:03
合計ジャッジ時間 10,437 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 7 ms
4,376 KB
testcase_11 AC 19 ms
4,376 KB
testcase_12 AC 180 ms
7,724 KB
testcase_13 AC 162 ms
7,352 KB
testcase_14 AC 268 ms
10,408 KB
testcase_15 AC 285 ms
10,824 KB
testcase_16 AC 286 ms
10,776 KB
testcase_17 AC 285 ms
10,756 KB
testcase_18 AC 285 ms
10,800 KB
testcase_19 AC 284 ms
10,824 KB
testcase_20 AC 285 ms
10,908 KB
testcase_21 AC 267 ms
10,920 KB
testcase_22 AC 271 ms
10,748 KB
testcase_23 AC 289 ms
10,808 KB
testcase_24 AC 284 ms
10,872 KB
testcase_25 AC 281 ms
10,816 KB
testcase_26 AC 284 ms
10,840 KB
testcase_27 AC 289 ms
10,840 KB
testcase_28 AC 286 ms
10,800 KB
testcase_29 AC 268 ms
10,756 KB
testcase_30 AC 278 ms
10,808 KB
testcase_31 AC 286 ms
10,836 KB
testcase_32 AC 286 ms
10,884 KB
testcase_33 AC 285 ms
11,076 KB
testcase_34 AC 285 ms
10,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
template <typename T> bool chmax(T &u, const T z) { if (u < z) {u = z; return true;} else return false; }
template <typename T> bool chmin(T &u, const T z) { if (u > z) {u = z; return true;} else return false; }
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long 
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 cnt=0;
	bool hantei=false;
	rep(i,n){
		if(a[i]!=b[i]&&hantei==false){
			cnt++;
			hantei=true;
		}else if(a[i]==b[i]){
			hantei=false;
		}
	}
	cout<<cnt<<endl;
	return 0;
}
0