Submission #541844

# Submission time Handle Problem Language Result Execution time Memory
541844 2022-03-24T14:32:21 Z tabr Dancing Elephants (IOI11_elephants) C++17
0 / 100
2 ms 468 KB
#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

const int N = 150015;
int B;
int n;
int l;
int x[N];
int cnt;

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

void build() {
}

int update(int i, int y) {
    if (cnt == 0) {
        build();
    }
    cnt++;
    if (cnt == n / B) {
        cnt = 0;
    }
}

#ifdef tabr
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    return 0;
}
#endif

Compilation message

elephants.cpp: In function 'int update(int, int)':
elephants.cpp:36:1: warning: no return statement in function returning non-void [-Wreturn-type]
   36 | }
      | ^
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -