# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
231576 |
2020-05-14T03:48:58 Z |
huangqr |
Baloni (COCI15_baloni) |
C++14 |
|
287 ms |
7800 KB |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll asize=1e6+5;
int h[asize];
bool y[asize];
int main(){
int n,k,ans;
cin>>n;
ans=n;
for(int i=0;i<asize;i++)h[i]=1e9;
for(int i=0;i<n;i++){
cin>>k;
if(!y[k])h[k]=i;
else ans--;
y[k]=1;
}
for(int i=1;i<asize;i++){
if(y[i]&&y[i-1]&&h[i]<h[i-1])ans--;
}
cout<<ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
4224 KB |
Output isn't correct |
2 |
Incorrect |
8 ms |
4224 KB |
Output isn't correct |
3 |
Incorrect |
9 ms |
4224 KB |
Output isn't correct |
4 |
Incorrect |
9 ms |
4276 KB |
Output isn't correct |
5 |
Incorrect |
279 ms |
7800 KB |
Output isn't correct |
6 |
Incorrect |
287 ms |
7724 KB |
Output isn't correct |
7 |
Incorrect |
235 ms |
7080 KB |
Output isn't correct |
8 |
Incorrect |
240 ms |
7032 KB |
Output isn't correct |
9 |
Incorrect |
276 ms |
7416 KB |
Output isn't correct |
10 |
Incorrect |
253 ms |
7416 KB |
Output isn't correct |