結果

問題 No.1183 コイン遊び
ユーザー KKT89KKT89
提出日時 2020-08-23 12:33:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 131 ms / 2,000 ms
コード長 892 bytes
コンパイル時間 966 ms
コンパイル使用メモリ 116,952 KB
実行使用メモリ 11,220 KB
最終ジャッジ日時 2024-04-23 17:33:40
合計ジャッジ時間 5,101 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,944 KB
testcase_04 AC 2 ms
6,944 KB
testcase_05 AC 1 ms
6,940 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,940 KB
testcase_08 AC 2 ms
6,940 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 4 ms
6,940 KB
testcase_11 AC 9 ms
6,944 KB
testcase_12 AC 75 ms
8,064 KB
testcase_13 AC 66 ms
7,680 KB
testcase_14 AC 111 ms
10,596 KB
testcase_15 AC 116 ms
11,000 KB
testcase_16 AC 117 ms
11,028 KB
testcase_17 AC 119 ms
11,120 KB
testcase_18 AC 118 ms
11,100 KB
testcase_19 AC 122 ms
11,032 KB
testcase_20 AC 120 ms
11,120 KB
testcase_21 AC 101 ms
11,044 KB
testcase_22 AC 101 ms
11,128 KB
testcase_23 AC 101 ms
11,040 KB
testcase_24 AC 103 ms
11,112 KB
testcase_25 AC 118 ms
11,024 KB
testcase_26 AC 131 ms
11,080 KB
testcase_27 AC 130 ms
11,132 KB
testcase_28 AC 122 ms
11,112 KB
testcase_29 AC 103 ms
11,220 KB
testcase_30 AC 104 ms
11,020 KB
testcase_31 AC 122 ms
11,120 KB
testcase_32 AC 123 ms
11,032 KB
testcase_33 AC 126 ms
11,112 KB
testcase_34 AC 120 ms
11,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

//#pragma GCC optimize ("O3")
//#pragma GCC target ("avx")
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> a(n),b(n);
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	for(int i=0;i<n;i++){
		cin >> b[i];
	}
	int cnt=0;
	int res=0;
	for(int i=0;i<n;i++){
		if(a[i]!=b[i]){
			cnt++;
		}
		else{
			if(cnt>0)res++;
			cnt=0;
		}
	}
	if(cnt)res++;
	cout << res << endl;
}
0