Submission #538373

# Submission time Handle Problem Language Result Execution time Memory
538373 2022-03-16T17:07:46 Z tabr Dancing Elephants (IOI11_elephants) C++17
26 / 100
9000 ms 1880 KB
#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int n;
int l;
vector<int> x;

void init(int n_, int l_, int x_[]) {
    n = n_;
    l = l_;
    x = vector<int>(n);
    for (int i = 0; i < n; i++) {
        x[i] = x_[i];
    }
}

int update(int i, int y) {
    x[i] = y;
    auto a = x;
    sort(a.begin(), a.end());
    int ans = 1;
    int now = a[0];
    while (now + l < a[n - 1]) {
        now = *upper_bound(a.begin(), a.end(), now + l);
        ans++;
    }
    return ans;
}

#ifdef tabr
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    return 0;
}
#endif
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 308 KB Output is correct
3 Correct 0 ms 308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 308 KB Output is correct
3 Correct 0 ms 308 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 308 KB Output is correct
3 Correct 0 ms 308 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Execution timed out 9015 ms 1880 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 308 KB Output is correct
3 Correct 0 ms 308 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Execution timed out 9015 ms 1880 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 308 KB Output is correct
3 Correct 0 ms 308 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Execution timed out 9015 ms 1880 KB Time limit exceeded
8 Halted 0 ms 0 KB -