結果

問題 No.1183 コイン遊び
ユーザー kenskens
提出日時 2020-08-22 14:35:38
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 313 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 1,589 ms
コンパイル使用メモリ 163,844 KB
実行使用メモリ 11,468 KB
最終ジャッジ日時 2024-04-23 08:56:32
合計ジャッジ時間 10,335 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 2 ms
6,940 KB
testcase_06 AC 2 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 8 ms
6,940 KB
testcase_11 AC 20 ms
6,940 KB
testcase_12 AC 194 ms
8,396 KB
testcase_13 AC 174 ms
7,760 KB
testcase_14 AC 290 ms
10,828 KB
testcase_15 AC 313 ms
11,456 KB
testcase_16 AC 313 ms
11,336 KB
testcase_17 AC 312 ms
11,336 KB
testcase_18 AC 311 ms
11,468 KB
testcase_19 AC 313 ms
11,460 KB
testcase_20 AC 311 ms
11,336 KB
testcase_21 AC 293 ms
11,340 KB
testcase_22 AC 293 ms
11,464 KB
testcase_23 AC 309 ms
11,464 KB
testcase_24 AC 308 ms
11,332 KB
testcase_25 AC 308 ms
11,332 KB
testcase_26 AC 311 ms
11,336 KB
testcase_27 AC 311 ms
11,460 KB
testcase_28 AC 312 ms
11,468 KB
testcase_29 AC 292 ms
11,336 KB
testcase_30 AC 304 ms
11,336 KB
testcase_31 AC 311 ms
11,460 KB
testcase_32 AC 313 ms
11,468 KB
testcase_33 AC 312 ms
11,332 KB
testcase_34 AC 313 ms
11,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)n; i++)
using ll = long long;

int main(){
  int n;
  cin >> n;
  int a[n], b[n];
  rep(i,n) cin >> a[i];
  rep(i,n) cin >> b[i];
  int ans = 0;
  int p = 0;
  while(p < n) {
    if(a[p] == b[p]) p++;
    else {
      while(p < n && a[p] != b[p]) p++;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
0