結果

問題 No.1183 コイン遊び
ユーザー maple116maple116
提出日時 2020-08-22 13:03:19
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 295 ms / 2,000 ms
コード長 1,011 bytes
コンパイル時間 2,357 ms
コンパイル使用メモリ 199,916 KB
実行使用メモリ 19,256 KB
最終ジャッジ日時 2023-08-05 09:41:12
合計ジャッジ時間 10,536 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
19,008 KB
testcase_01 AC 7 ms
19,256 KB
testcase_02 AC 6 ms
18,968 KB
testcase_03 AC 7 ms
19,016 KB
testcase_04 AC 6 ms
19,128 KB
testcase_05 AC 6 ms
18,992 KB
testcase_06 AC 7 ms
19,244 KB
testcase_07 AC 6 ms
19,016 KB
testcase_08 AC 6 ms
18,976 KB
testcase_09 AC 7 ms
19,024 KB
testcase_10 AC 11 ms
19,244 KB
testcase_11 AC 25 ms
19,012 KB
testcase_12 AC 185 ms
19,020 KB
testcase_13 AC 165 ms
18,968 KB
testcase_14 AC 272 ms
19,028 KB
testcase_15 AC 290 ms
18,968 KB
testcase_16 AC 292 ms
18,964 KB
testcase_17 AC 291 ms
18,972 KB
testcase_18 AC 291 ms
19,008 KB
testcase_19 AC 291 ms
18,976 KB
testcase_20 AC 289 ms
19,124 KB
testcase_21 AC 279 ms
18,964 KB
testcase_22 AC 275 ms
19,032 KB
testcase_23 AC 289 ms
18,964 KB
testcase_24 AC 285 ms
19,084 KB
testcase_25 AC 288 ms
18,960 KB
testcase_26 AC 290 ms
19,076 KB
testcase_27 AC 295 ms
18,964 KB
testcase_28 AC 290 ms
18,976 KB
testcase_29 AC 275 ms
19,248 KB
testcase_30 AC 284 ms
18,972 KB
testcase_31 AC 289 ms
19,124 KB
testcase_32 AC 291 ms
19,016 KB
testcase_33 AC 292 ms
19,028 KB
testcase_34 AC 292 ms
18,976 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