답안 #411834

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
411834 2021-05-26T05:56:44 Z jeqcho 코끼리 (Dancing Elephants) (IOI11_elephants) C++17
26 / 100
9000 ms 2756 KB
#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vpi;

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

#define pb push_back
#define rsz resize
#define sz(x) int(x.size())
#define all(x) begin(x), end(x)
#define fi first
#define se second

int N;
int L;
int const n=5e4+3;
int X[n];
multiset<int> x;

// subtask 1,2

void init(int N1, int L1, int X1[])
{
	L=L1;
	N = N1;
	F0R(i,N)
	{
		X[i]=X1[i];
	  x.insert(X1[i]);
	}
}

int update(int idx, int y)
{
	x.erase(x.find(X[idx]));
	x.insert(y);
	X[idx]=y;
	int cnt=0;
	int b=-1;
	trav(e,x)
	{
		if(e>b)
		{
			++cnt;
			b = e+L;
		}
	}
	return cnt;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 6446 ms 1588 KB Output is correct
8 Execution timed out 9020 ms 2756 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 6446 ms 1588 KB Output is correct
8 Execution timed out 9020 ms 2756 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 332 KB Output is correct
2 Correct 1 ms 332 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 1 ms 332 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 6446 ms 1588 KB Output is correct
8 Execution timed out 9020 ms 2756 KB Time limit exceeded
9 Halted 0 ms 0 KB -