# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
56347 | soham1234 | Baloni (COCI15_baloni) | C++14 | 151 ms | 15212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define FORE(i,a,b) for(int i=a;i<=b;i++)
#define FOR(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define init(arr,val) memset(arr,val,sizeof(arr))
#define int long long int
using namespace std;
const int MOD=1e9+7;
const int INF=4000000000000000000ll;
int mul(int a,int b)
{
if(a>INF/b) return INF;
else return a*b;
}
#undef int
int main()
{
#define int long long int
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
//freopen("input.txt","r",stdin);
int n;
cin>>n;
int h[n];
FOR(i,n) cin>>h[i];
int found[1000002];
fill(found,found+1000002,0);
int ans=0;
FOR(i,n)
{
if(found[h[i]]==0)
{
ans++;
}
else
{
found[h[i]]-=1;
}
found[h[i]-1]+=1;
}
cout<<ans;
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |