답안 #62169

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
62169 2018-07-27T16:30:29 Z reality 코끼리 (Dancing Elephants) (IOI11_elephants) C++17
26 / 100
9000 ms 1828 KB
#include "elephants.h"
#include "bits/stdc++.h"
using namespace std;
#define fi first
#define se second
#define ll long long
#define dbg(v) cerr<<#v<<" = "<<v<<'\n'
#define vi vector<int>
#define vl vector <ll>
#define pii pair<int,int>
#define mp make_pair
#define db long double
#define pb push_back
#define all(s) s.begin(),s.end()
template < class T > T smin(T &a,T b) {if (a > b) a = b;return a;}
template < class T > T smax(T &a,T b) {if (a < b) a = b;return a;}

int n,l;
vi s;

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

int update(int i, int y)
{
	s[i] = y;
	int ans = 0;
	set < int > ss(all(s));
	int prev = -(l + 1);
	for (auto it : ss) {
		if (it > prev) {
			++ans;
			prev = it + l;
		}
	}
 	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 3 ms 552 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 3 ms 552 KB Output is correct
4 Correct 5 ms 552 KB Output is correct
5 Correct 4 ms 552 KB Output is correct
6 Correct 3 ms 624 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 3 ms 552 KB Output is correct
4 Correct 5 ms 552 KB Output is correct
5 Correct 4 ms 552 KB Output is correct
6 Correct 3 ms 624 KB Output is correct
7 Execution timed out 9014 ms 1828 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 3 ms 552 KB Output is correct
4 Correct 5 ms 552 KB Output is correct
5 Correct 4 ms 552 KB Output is correct
6 Correct 3 ms 624 KB Output is correct
7 Execution timed out 9014 ms 1828 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 376 KB Output is correct
2 Correct 2 ms 492 KB Output is correct
3 Correct 3 ms 552 KB Output is correct
4 Correct 5 ms 552 KB Output is correct
5 Correct 4 ms 552 KB Output is correct
6 Correct 3 ms 624 KB Output is correct
7 Execution timed out 9014 ms 1828 KB Time limit exceeded
8 Halted 0 ms 0 KB -