# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
713837 |
2023-03-23T05:59:46 Z |
ALTAKEXE |
Baloni (COCI15_baloni) |
C++14 |
|
345 ms |
3876 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
//freopen("input.txt","r",stdin);
ll n; cin >> n;
int a[n];
for (int i = 1;i <= n;i++) cin >> a[i];
ll ans = 0;
multiset<ll> st;
for (int i = 1;i <= n;i++) {
auto to = st.find(a[i] + 1);
if (to == st.end()) {
ans++;
} else {
st.erase(to);
}
st.insert(a[i]);
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
340 KB |
Output is correct |
3 |
Incorrect |
3 ms |
340 KB |
Output isn't correct |
4 |
Correct |
2 ms |
340 KB |
Output is correct |
5 |
Incorrect |
294 ms |
3364 KB |
Output isn't correct |
6 |
Correct |
345 ms |
3876 KB |
Output is correct |
7 |
Incorrect |
264 ms |
3284 KB |
Output isn't correct |
8 |
Correct |
298 ms |
3276 KB |
Output is correct |
9 |
Correct |
284 ms |
3348 KB |
Output is correct |
10 |
Correct |
299 ms |
3504 KB |
Output is correct |