Submission #64633

# Submission time Handle Problem Language Result Execution time Memory
64633 2018-08-05T08:26:48 Z zetapi Dancing Elephants (IOI11_elephants) C++14
0 / 100
9000 ms 376 KB
#include <elephants.h>

#include <bits/stdc++.h>
using namespace std;

#define pb  push_back
#define mp  make_pair
#define ll  long long
#define itr ::iterator 

typedef pair<int,int>  pii;

const int MAX=1e6;

multiset<int> st;

int N,L,arr[MAX];

void init(int n, int l, int X[])
{
  	N=n;
  	L=l;
  	for(int A=1;A<=N;A++)
  		arr[A]=X[A-1];
  	return ;
}

int update(int i, int y)
{
	i++;
  	st.erase(st.find(arr[i]));
  	arr[i]=y;
  	st.insert(arr[i]);
  	int res=1,cur=*st.begin();
  	for(auto A:st)
  	{
  		if(A-cur+1>L)
  		{
  			res++;
  			cur=A;
  		}
  	}
  	return res;
}

/*signed main()
{
	ios_base::sync_with_stdio(false);

	
	return 0;
}*/
# Verdict Execution time Memory Grader output
1 Execution timed out 9033 ms 376 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9033 ms 376 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9033 ms 376 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9033 ms 376 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 9033 ms 376 KB Time limit exceeded
2 Halted 0 ms 0 KB -