제출 #674946

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
6749462022-12-26 16:36:18bashkort벽 (IOI14_wall)C++17
100 / 100
711 ms69492 KiB
#include "wall.h"
#include <bits/stdc++.h>
using namespace std;
constexpr int inf = 1e9 + 7;
struct Info {
int L = 0, R = inf;
Info(int x, int y) : L(x), R(y) {}
Info() = default;
};
void apply(Info &a, Info b) {
if (a.L >= b.R) {
a.L = a.R = b.R;
} else if (a.R <= b.L) {
a.L = a.R = b.L;
} else {
a.L = max(a.L, b.L);
a.R = min(a.R, b.R);
}
}
vector<Info> t;
int sz = 1;
void init(int n) {
sz = 1 << __lg(n) + bool(n & (n - 1));
t.assign(sz << 1, {});
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

wall.cpp: In function 'void init(int)':
wall.cpp:29:23: warning: suggest parentheses around '+' inside '<<' [-Wparentheses]
   29 |     sz = 1 << __lg(n) + bool(n & (n - 1));
      |               ~~~~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...