結果

問題 No.1183 コイン遊び
ユーザー kens
提出日時 2020-08-22 14:35:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 311 ms / 2,000 ms
コード長 399 bytes
コンパイル時間 1,483 ms
コンパイル使用メモリ 167,444 KB
実行使用メモリ 11,392 KB
最終ジャッジ日時 2024-10-15 08:51:27
合計ジャッジ時間 10,403 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

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