結果

問題 No.1183 コイン遊び
ユーザー mmn15277198mmn15277198
提出日時 2020-11-05 19:54:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 287 ms / 2,000 ms
コード長 712 bytes
コンパイル時間 894 ms
コンパイル使用メモリ 93,016 KB
実行使用メモリ 10,988 KB
最終ジャッジ日時 2023-09-29 17:32:35
合計ジャッジ時間 11,428 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 7 ms
4,376 KB
testcase_11 AC 18 ms
4,376 KB
testcase_12 AC 179 ms
7,840 KB
testcase_13 AC 160 ms
7,524 KB
testcase_14 AC 267 ms
10,420 KB
testcase_15 AC 284 ms
10,720 KB
testcase_16 AC 285 ms
10,952 KB
testcase_17 AC 284 ms
10,872 KB
testcase_18 AC 284 ms
10,792 KB
testcase_19 AC 286 ms
10,860 KB
testcase_20 AC 286 ms
10,928 KB
testcase_21 AC 267 ms
10,860 KB
testcase_22 AC 269 ms
10,816 KB
testcase_23 AC 285 ms
10,988 KB
testcase_24 AC 284 ms
10,824 KB
testcase_25 AC 285 ms
10,856 KB
testcase_26 AC 286 ms
10,796 KB
testcase_27 AC 285 ms
10,828 KB
testcase_28 AC 287 ms
10,792 KB
testcase_29 AC 268 ms
10,920 KB
testcase_30 AC 280 ms
10,752 KB
testcase_31 AC 284 ms
10,852 KB
testcase_32 AC 286 ms
10,820 KB
testcase_33 AC 285 ms
10,888 KB
testcase_34 AC 286 ms
10,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<algorithm>
#include<vector>
#include<string.h>
#include<math.h>
#include<map>
#include<iomanip>
#include<queue>
#include<set>

#define rep(i,n) for(int (i) = 0; i < (n); i++)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;

//const ll mod = 1e9 + 7;
const ll mod = 998244353;
const int inf = 123456;

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 += 1;
		if(cnt > 0 && a[i] == b[i]){
			ans += 1;
			cnt = 0;
		}
	}
	if(cnt > 0)ans += 1;
	cout << ans << endl;
	return 0;    
}

0