답안 #240837

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
240837 2020-06-21T09:27:44 Z bananamaths Baloni (COCI15_baloni) C++14
100 / 100
290 ms 7800 KB
#include<bits/stdc++.h>
using namespace std;
int main()
{ 
   int N;
   cin>>N;
   int V[N];
   for(int i = 0 ;i<N;i++)
   {
       cin>>V[i];
   }
   int  H[1000002];
   int conta = 0;
   for(int i = 1;i<=1000001;i++)
   {
      H[i] = 0;
   }
   for(int i = 0;i<N;i++)
   {
        int a = V[i];
	if(H[a+1]>0)
	{
           H[a+1] -= 1;
	   H[a] +=1;
	}
	else
	{
            conta++;
	    H[a]++;
	}
   }
   cout<<conta;


}


# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 4224 KB Output is correct
2 Correct 7 ms 4224 KB Output is correct
3 Correct 8 ms 4224 KB Output is correct
4 Correct 8 ms 4224 KB Output is correct
5 Correct 274 ms 7416 KB Output is correct
6 Correct 290 ms 7800 KB Output is correct
7 Correct 236 ms 7160 KB Output is correct
8 Correct 230 ms 7112 KB Output is correct
9 Correct 253 ms 7340 KB Output is correct
10 Correct 264 ms 7288 KB Output is correct