Submission #728426

# Submission time Handle Problem Language Result Execution time Memory
728426 2023-04-22T11:27:03 Z NeroZein Wombats (IOI13_wombats) C++17
0 / 100
32 ms 32420 KB
#include "wombats.h"
#include <bits/stdc++.h>
using namespace std; 

const int M = 202;
const int N = 5005;

int seg[N << 2]; 

void upd (int nd, int l, int r, int p, int val) {
  if (l == r) return void (seg[nd] = val); 
  int mid = (l + r) >> 1;
  int rs = nd + ((mid - l + 1) << 1);
  if (p <= mid) {
    upd(nd + 1, l, mid, p, val); 
  } else {
    upd(rs, mid + 1, r, p, val); 
  } 
  seg[nd] = seg[nd + 1] + seg[rs]; 
}

int qry (int nd, int l, int r, int s, int e) {
  if (l >= s && r <= e) return seg[nd];
  int mid = (l + r) >> 1;
  int rs = nd + ((mid - l + 1) << 1); 
  if (mid >= e) return qry(nd + 1, l, mid, s, e);
  if (mid < s) return qry(rs, mid + 1, r, s, e);
  return qry(nd + 1, l, mid, s, e) + qry(rs, mid + 1, r, s, e); 
}

int r, c;
int h[N][M], v[N][M];

void init(int R_, int C_, int H[5000][200], int V[5000][200]) {
  r = R_, c = C_;
  for (int i = 0; i < r; ++i) {
    for (int j = 0; j < c - 1; ++j) {
      h[i][j] = H[i][j];
    }
  }//usless
  for (int i = 0; i < r - 1; ++i) {
    for (int j = 0; j < c; ++j) {
      v[i][j] = V[i][j];
    }
  }
}

void changeH(int P, int Q, int W) {
    /* ... */
}

void changeV(int P, int Q, int W) {
  assert(Q == 1);
  upd(0, 0, r - 1, P, W); 
}

int escape(int V1, int V2) {
  assert(V1 == 1); 
  assert(V2 == 1); 
  return seg[0]; 
}

Compilation message

grader.c: In function 'int main()':
grader.c:15:6: warning: variable 'res' set but not used [-Wunused-but-set-variable]
   15 |  int res;
      |      ^~~
# Verdict Execution time Memory Grader output
1 Runtime error 12 ms 16340 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 440 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 1224 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 32 ms 32420 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 4 ms 1220 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 3 ms 1196 KB Execution killed with signal 6
2 Halted 0 ms 0 KB -