結果

問題 No.1183 コイン遊び
ユーザー maple116maple116
提出日時 2020-08-22 13:03:19
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 320 ms / 2,000 ms
コード長 1,011 bytes
コンパイル時間 2,418 ms
コンパイル使用メモリ 197,468 KB
実行使用メモリ 19,320 KB
最終ジャッジ日時 2024-04-23 07:15:32
合計ジャッジ時間 9,923 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
19,208 KB
testcase_01 AC 6 ms
19,160 KB
testcase_02 AC 7 ms
19,044 KB
testcase_03 AC 6 ms
19,308 KB
testcase_04 AC 6 ms
19,156 KB
testcase_05 AC 5 ms
19,200 KB
testcase_06 AC 6 ms
19,320 KB
testcase_07 AC 7 ms
19,124 KB
testcase_08 AC 6 ms
19,244 KB
testcase_09 AC 7 ms
19,220 KB
testcase_10 AC 12 ms
19,148 KB
testcase_11 AC 23 ms
19,108 KB
testcase_12 AC 179 ms
19,156 KB
testcase_13 AC 159 ms
19,156 KB
testcase_14 AC 264 ms
19,188 KB
testcase_15 AC 290 ms
19,256 KB
testcase_16 AC 284 ms
19,164 KB
testcase_17 AC 296 ms
19,204 KB
testcase_18 AC 291 ms
19,296 KB
testcase_19 AC 280 ms
19,108 KB
testcase_20 AC 275 ms
19,060 KB
testcase_21 AC 272 ms
19,304 KB
testcase_22 AC 267 ms
19,148 KB
testcase_23 AC 275 ms
19,308 KB
testcase_24 AC 277 ms
19,128 KB
testcase_25 AC 278 ms
19,048 KB
testcase_26 AC 298 ms
19,204 KB
testcase_27 AC 279 ms
19,048 KB
testcase_28 AC 285 ms
19,208 KB
testcase_29 AC 281 ms
19,220 KB
testcase_30 AC 273 ms
19,192 KB
testcase_31 AC 288 ms
19,276 KB
testcase_32 AC 303 ms
19,252 KB
testcase_33 AC 309 ms
19,044 KB
testcase_34 AC 320 ms
19,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
typedef long long ll;
typedef pair<ll,ll> prl;
typedef vector<ll> vcl;
typedef map<ll,ll> mapl;
typedef unordered_map<ll,ll> umap;
#define pb push_back
#define all(v) v.begin(), v.end()
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define repi(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(ll i=a;i>=b;i--)
#define reps(i,v) for(ll i=0;i<v.size();i++)
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
const ll mod = 1e9+7;

int main() {
    // your code goes here
    ll n,a[1000005]={0},b[1000005]={0},ans=0;
    bool ch=false;
    cin >> n;
    rep(i,1,n){
    	cin >> a[i];
    }
    rep(i,1,n){
    	cin >> b[i];
    }
    rep(i,1,n+1){
    	if(a[i]==b[i]){
    		if(ch) ans++;
    		ch = false;
    	} else {
    		ch = true;
    	}
    }
    cout << ans << endl;
    return 0;
}
0