結果
問題 |
No.1183 コイン遊び
|
ユーザー |
![]() |
提出日時 | 2020-08-22 13:14:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 321 ms / 2,000 ms |
コード長 | 406 bytes |
コンパイル時間 | 1,785 ms |
コンパイル使用メモリ | 168,592 KB |
実行使用メモリ | 11,136 KB |
最終ジャッジ日時 | 2024-10-15 07:25:55 |
合計ジャッジ時間 | 10,671 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 32 |
ソースコード
#include<bits/stdc++.h> using namespace std; using ll = long long; int main() { int n; cin >> n; int cnt = 0; vector<int> a(n), b(n); for(int i = 0; i < n; i++)cin >> a[i]; for(int i = 0; i < n; i++)cin >> b[i]; for(int i = 0; i < n;) { int j = i; while(j < n && a[j] != b[j])j++; if(i != j)cnt++, i = j; else i++; } cout << cnt << endl; }