Submission #104532

# Submission time Handle Problem Language Result Execution time Memory
104532 2019-04-07T16:00:11 Z figter001 Dancing Elephants (IOI11_elephants) C++17
0 / 100
2 ms 384 KB
// #include "grader.h"
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
const int N = 1e5+50;
const ll oo = 1e18;
const ll mod = 1e9+7;
const int nax = 1e5;

int n,l;
vector<int> a;
int p[nax];

void init(int N, int L, int X[]){
	n = N;
	l=L;
	for(int i=0;i<n;i++){
		a.push_back(X[i]);
		p[i] = X[i];
	}
}

int update(int x, int y){
	vector<int> tmp;
	for(int i=0;i<n;i++){
		if(a[i] == p[x])
			continue;
		if(a[i] >= y){
			tmp.push_back(y);
			y = 2e9;
		}
		tmp.push_back(a[i]);
	}
	p[x] = y;
	if(tmp.size() != a.size() && y != 2e9)
		tmp.push_back(y);
	a = tmp;
	int ans = 0;
	int to = -1;
	for(int it : a){
		if(it > to){
			to = it+l;
			ans++;
		}
	}
	return ans;
}

# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -