結果

問題 No.1183 コイン遊び
ユーザー tnakao0123tnakao0123
提出日時 2020-08-23 02:46:46
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 190 ms / 2,000 ms
コード長 895 bytes
コンパイル時間 745 ms
コンパイル使用メモリ 92,060 KB
実行使用メモリ 11,776 KB
最終ジャッジ日時 2024-04-23 13:53:12
合計ジャッジ時間 6,732 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 3 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 3 ms
5,376 KB
testcase_05 AC 3 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 4 ms
5,376 KB
testcase_08 AC 3 ms
5,376 KB
testcase_09 AC 3 ms
5,376 KB
testcase_10 AC 7 ms
5,376 KB
testcase_11 AC 15 ms
5,376 KB
testcase_12 AC 120 ms
8,576 KB
testcase_13 AC 106 ms
8,064 KB
testcase_14 AC 179 ms
11,136 KB
testcase_15 AC 188 ms
11,648 KB
testcase_16 AC 188 ms
11,520 KB
testcase_17 AC 188 ms
11,648 KB
testcase_18 AC 189 ms
11,520 KB
testcase_19 AC 188 ms
11,520 KB
testcase_20 AC 188 ms
11,520 KB
testcase_21 AC 171 ms
11,520 KB
testcase_22 AC 169 ms
11,648 KB
testcase_23 AC 170 ms
11,520 KB
testcase_24 AC 172 ms
11,520 KB
testcase_25 AC 188 ms
11,520 KB
testcase_26 AC 189 ms
11,520 KB
testcase_27 AC 190 ms
11,392 KB
testcase_28 AC 188 ms
11,520 KB
testcase_29 AC 171 ms
11,520 KB
testcase_30 AC 170 ms
11,520 KB
testcase_31 AC 189 ms
11,776 KB
testcase_32 AC 188 ms
11,520 KB
testcase_33 AC 187 ms
11,392 KB
testcase_34 AC 187 ms
11,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* -*- coding: utf-8 -*-
 *
 * 1183.cc:  No.1183 コイン遊び - yukicoder
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 1000000;

/* typedef */

/* global variables */

int as[MAX_N], bs[MAX_N];

/* subroutines */

/* main */

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d", as + i);
  for (int i = 0; i < n; i++) scanf("%d", bs + i);

  int c = 0;
  for (int i = 0; i < n;) {
    while (i < n && as[i] == bs[i]) i++;
    if (i >= n) break;

    while (i < n && as[i] != bs[i]) i++;
    c++;
  }

  printf("%d\n", c);
  return 0;
}
0