Submission #850715

#TimeUsernameProblemLanguageResultExecution timeMemory
850715raphaelpBaloni (COCI15_baloni)C++14
100 / 100
139 ms11292 KiB
#include <bits/stdc++.h> using namespace std; int main() { int N; cin >> N; vector<int> Tab(N); for (int i = 0; i < N; i++) { cin >> Tab[i]; } vector<int> arrows(1000001, 0); int tot = 0; for (int i = 0; i < N; i++) { if (arrows[Tab[i]] > 0) { arrows[Tab[i]]--; } else { tot++; } arrows[Tab[i] - 1]++; } cout << tot; }
#Verdict Execution timeMemoryGrader output
Fetching results...