結果

問題 No.1183 コイン遊び
ユーザー chocoruskchocorusk
提出日時 2020-08-22 13:03:10
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 892 bytes
コンパイル時間 1,231 ms
コンパイル使用メモリ 124,964 KB
実行使用メモリ 11,600 KB
最終ジャッジ日時 2024-04-23 07:15:20
合計ジャッジ時間 9,903 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 293 ms
11,392 KB
testcase_22 AC 297 ms
11,264 KB
testcase_23 WA -
testcase_24 AC 320 ms
11,264 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 294 ms
11,392 KB
testcase_30 AC 305 ms
11,392 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#include <array>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int a[1000010], b[1000010];
int main()
{
    int n; cin>>n;
    for(int i=0; i<n; i++){
        cin>>a[i];
    }
    for(int i=0; i<n; i++){
        cin>>b[i];
    }
    int pr=-1, ans=0;
    for(int i=0; i<n; i++){
        if(a[i]==b[i]){
            ans+=i-pr-1;
            pr=i;
        }
    }
    ans+=n-pr-1;
    cout<<ans<<endl;
    return 0;
}
0