Submission #376156

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3761562021-03-11 02:13:54ijxjdjdSegments (IZhO18_segments)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#define FR(i, N) for (int i = 0; i < int(N); i++)
#define all(x) begin(x), end(x)
#define sz(x) int((x).size())
using namespace std;
using ll = long long;
const int MAXN = (int)(2e5) + 5;
const int K = 1000;
int curAdd = 0;
int sz = 0;
int e[MAXN][2];
int mnSz[MAXN];
int mxL[MAXN];
bool del[MAXN];
vector<int> L;
vector<int> Sz;
vector<int> curdel;
void rebuild() {
auto byL = [&] (const int& lhs, const int& rhs) {
return e[lhs][0] < e[rhs][0];
};
auto byR = [&] (const int& lhs, const int& rhs) {
return e[lhs][1] < e[rhs][1];
};
auto bySz = [&] (const int& lhs, const int& rhs) {
return (e[lhs][1] - e[lhs][0]) < (e[rhs][1] - e[rhs][0]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

segments.cpp: In function 'void rebuild()':
segments.cpp:44:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |     for (int i = 0; i < Sz.size(); i+=K) {
      |                     ~~^~~~~~~~~~~
segments.cpp:46:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |         if (i + K >= Sz.size()) {
      |             ~~~~~~^~~~~~~~~~~~
segments.cpp:55:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |     for (int i = 0; i < L.size(); i+=K) {
      |                     ~~^~~~~~~~~~
segments.cpp:56:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   56 |         if (i + K >= L.size()) {
      |             ~~~~~~^~~~~~~~~~~
segments.cpp: In function 'int getSz(int, int, int)':
segments.cpp:89:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   89 |                 for (int i = 0; j + i < Sz.size() && i < K; i++) {
      |                                 ~~~~~~^~~~~~~~~~~
segments.cpp: In function 'int getL(int, int)':
segments.cpp:138:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  138 |                 for (int i = 0; j + i < L.size() && i < K; i++) {
      |                                 ~~~~~~^~~~~~~~~~
segments.cpp: In function 'int main()':
segments.cpp:189:5: error: 'SZ' was not declared in this scope; did you mean 'Sz'?
  189 |     SZ.reserve(MAXN);
      |     ^~
      |     Sz