제출 #1022175

#제출 시각아이디문제언어결과실행 시간메모리
1022175amine_aroua웜뱃 (IOI13_wombats)C++17
0 / 100
5 ms8796 KiB
#include "wombats.h" #include<bits/stdc++.h> using namespace std; struct segTree { int BASE; vector<int> tree; void build(int n) { BASE = n; while(__builtin_popcount(BASE) != 1) BASE++; tree.assign(2*BASE , 0); } void upd(int i , int x) { tree[i + BASE] = x; for(int j = (i + BASE)/2 ; j >= 1 ; j/=2) { tree[j] = tree[2*j] + tree[2*j + 1]; } } int query(int l , int r) { l+=BASE; r+=BASE; if(l == r) return tree[l]; int lt = 0 , rt = 0; while(l + 1 < r) { if(l %2 == 0) { lt = lt + tree[l + 1]; } if(r%2 == 1) { rt = tree[r - 1] + rt; } l>>=1; r>>=1; } return lt + rt; } }; vector<vector<int>> h , v; segTree tree[2]; int r , c; void init(int R, int C, int H[5000][200], int V[5000][200]) { r = R; c = C; h.assign(R , vector<int>(C)); v = h; for(int i = 0 ; i < R ; i++) { for(int j = 0; j < C - 1 ; j++) { h[i][j] = H[i][j]; } } for(int i = 0 ; i < R-1 ; i++) { for(int j = 0; j < C ; j++) { v[i][j] = V[i][j]; } } for(int j = 0 ; j < 2 ; j++) { tree[j].build(R - 1); for(int i = 0 ; i < R - 1 ; i++) { tree[j].upd(i , V[i][j]); } } } void changeH(int P, int Q, int W) { h[P][Q] = W; } void changeV(int P, int Q, int W) { tree[Q].upd(P , W); } int escape(int V1, int V2) { if(V1 == V2) { return min(tree[V1].query(0 , r - 1) , tree[1 - V1].query(0 , r - 1) + h[0][0] + h[r-1][0]); } else { return min(tree[V1].query(0 , r - 1) + h[r - 1][0] , tree[V2].query(0 , r - 1) + h[0][0]); } }

컴파일 시 표준 에러 (stderr) 메시지

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...