Submission #895816

#TimeUsernameProblemLanguageResultExecution timeMemory
895816tvladm2009Exam (eJOI20_exam)C++17
0 / 100
3 ms592 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector<int> a(n + 1), b(n + 1); for (int i = 1; i <= n; ++i) { cin >> a[i]; } for (int i = 1; i <= n; ++i) { cin >> b[i]; } map<int, int> mp; int ans = 0; for (int i = n; i >= 1; --i) { ++mp[a[i]]; if (mp[b[i]] != 0) ++ans; } cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...