답안 #115168

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
115168 2019-06-05T14:57:04 Z songc 코끼리 (Dancing Elephants) (IOI11_elephants) C++14
26 / 100
9000 ms 2944 KB
#include "elephants.h"
#include <bits/stdc++.h>
using namespace std;

int N, L;
int A[101010];
multiset<int> S;

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

int update(int i, int y)
{
    S.erase(S.find(A[i]));
    A[i] = y;
    S.insert(y);
    int ans=0, k=-1234567890;
    for (int it : S) if (k+L < it) ans++, k=it;
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 512 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 512 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 512 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 7269 ms 2768 KB Output is correct
8 Execution timed out 9044 ms 2944 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 512 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 7269 ms 2768 KB Output is correct
8 Execution timed out 9044 ms 2944 KB Time limit exceeded
9 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 512 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 2 ms 384 KB Output is correct
6 Correct 2 ms 384 KB Output is correct
7 Correct 7269 ms 2768 KB Output is correct
8 Execution timed out 9044 ms 2944 KB Time limit exceeded
9 Halted 0 ms 0 KB -