답안 #946645

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
946645 2024-03-14T20:55:12 Z OAleksa 코끼리 (Dancing Elephants) (IOI11_elephants) C++14
26 / 100
9000 ms 9044 KB
#include "elephants.h"
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
const int N = 150069;
int n, a[N], d;

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

int update(int j, int y) {
   vector<int> x;
   a[j] = y;
   for (int i = 0;i < n;i++)
      x.push_back(a[i]);
   sort(x.begin(), x.end());
   int ans = 0;
   int i = 0, lst = -1;
   while (i < n) {
      if (i > lst) {
         ++ans;
         lst = upper_bound(x.begin(), x.end(), x[i] + d) - x.begin() - 1;
      }
      else
         ++i;
   }
   return ans;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8636 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8636 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8540 KB Output is correct
5 Correct 2 ms 8540 KB Output is correct
6 Correct 1 ms 8540 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8636 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8540 KB Output is correct
5 Correct 2 ms 8540 KB Output is correct
6 Correct 1 ms 8540 KB Output is correct
7 Execution timed out 9051 ms 9044 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8636 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8540 KB Output is correct
5 Correct 2 ms 8540 KB Output is correct
6 Correct 1 ms 8540 KB Output is correct
7 Execution timed out 9051 ms 9044 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 8540 KB Output is correct
2 Correct 1 ms 8636 KB Output is correct
3 Correct 1 ms 8540 KB Output is correct
4 Correct 1 ms 8540 KB Output is correct
5 Correct 2 ms 8540 KB Output is correct
6 Correct 1 ms 8540 KB Output is correct
7 Execution timed out 9051 ms 9044 KB Time limit exceeded
8 Halted 0 ms 0 KB -