Submission #64635

# Submission time Handle Problem Language Result Execution time Memory
64635 2018-08-05T08:29:42 Z zetapi Dancing Elephants (IOI11_elephants) C++14
26 / 100
9000 ms 4164 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];
      	st.insert(arr[A]);
    }
  	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>L)
  		{
  			res++;
  			cur=A;
  		}
  	}
  	return res;
}

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

	
	return 0;
}*/
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 536 KB Output is correct
4 Correct 4 ms 616 KB Output is correct
5 Correct 4 ms 736 KB Output is correct
6 Correct 4 ms 736 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 536 KB Output is correct
4 Correct 4 ms 616 KB Output is correct
5 Correct 4 ms 736 KB Output is correct
6 Correct 4 ms 736 KB Output is correct
7 Correct 8571 ms 2896 KB Output is correct
8 Execution timed out 9032 ms 4164 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 536 KB Output is correct
4 Correct 4 ms 616 KB Output is correct
5 Correct 4 ms 736 KB Output is correct
6 Correct 4 ms 736 KB Output is correct
7 Correct 8571 ms 2896 KB Output is correct
8 Execution timed out 9032 ms 4164 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 2 ms 536 KB Output is correct
4 Correct 4 ms 616 KB Output is correct
5 Correct 4 ms 736 KB Output is correct
6 Correct 4 ms 736 KB Output is correct
7 Correct 8571 ms 2896 KB Output is correct
8 Execution timed out 9032 ms 4164 KB Time limit exceeded
9 Halted 0 ms 0 KB -