Submission #916785

# Submission time Handle Problem Language Result Execution time Memory
916785 2024-01-26T14:14:13 Z Wansur Dancing Elephants (IOI11_elephants) C++14
26 / 100
9000 ms 12636 KB
#include <bits/stdc++.h>
#define f first
#define s second
#define ent '\n';

using namespace std;
typedef long long ll;
const int mx=2e5+12;

set<int> s;
int a[mx];
int n,k;

void init(int N, int L, int X[]){
	n=N,k=L;
	for(int i=0;i<n;i++){
		a[i]=X[i];
		s.insert(a[i]);
	}
	
}
int update(int i, int y){
	s.erase(a[i]);
	a[i]=y;
	s.insert(a[i]);
	int last=-1,ans=0;
	for(int x:s){
		if(x>last){
			last=x+k;
			ans++;
		}
	}
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 8536 KB Output is correct
2 Correct 2 ms 8536 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 8536 KB Output is correct
2 Correct 2 ms 8536 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 2 ms 8536 KB Output is correct
5 Correct 2 ms 8540 KB Output is correct
6 Correct 2 ms 8536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 8536 KB Output is correct
2 Correct 2 ms 8536 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 2 ms 8536 KB Output is correct
5 Correct 2 ms 8540 KB Output is correct
6 Correct 2 ms 8536 KB Output is correct
7 Correct 3989 ms 10160 KB Output is correct
8 Correct 6056 ms 10532 KB Output is correct
9 Execution timed out 9047 ms 12636 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 8536 KB Output is correct
2 Correct 2 ms 8536 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 2 ms 8536 KB Output is correct
5 Correct 2 ms 8540 KB Output is correct
6 Correct 2 ms 8536 KB Output is correct
7 Correct 3989 ms 10160 KB Output is correct
8 Correct 6056 ms 10532 KB Output is correct
9 Execution timed out 9047 ms 12636 KB Time limit exceeded
10 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 8536 KB Output is correct
2 Correct 2 ms 8536 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 2 ms 8536 KB Output is correct
5 Correct 2 ms 8540 KB Output is correct
6 Correct 2 ms 8536 KB Output is correct
7 Correct 3989 ms 10160 KB Output is correct
8 Correct 6056 ms 10532 KB Output is correct
9 Execution timed out 9047 ms 12636 KB Time limit exceeded
10 Halted 0 ms 0 KB -