Submission #568390

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5683902022-05-25 11:07:15Ooops_sorryNew Home (APIO18_new_home)C++14
57 / 100
5098 ms736980 KiB
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ld double
#define ll __int128
mt19937 rnd(51);
const int INF = 1e9;
struct st{
vector<int> t_min, t_max;
vector<multiset<int>> t;
void build(int n) {
t_min.clear(), t_max.clear(), t.clear();
t_min.resize(4 * n, INF);
t_max.resize(4 * n, -INF);
t.resize(4 * n);
}
void upd(int v) {
if (t[v].size() == 0) {
t_min[v] = INF;
t_max[v] = -INF;
return;
}
t_min[v] = *t[v].begin();
t_max[v] = *t[v].rbegin();
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

new_home.cpp: In function 'void add(int, int)':
new_home.cpp:77:9: warning: unused variable 'I' [-Wunused-variable]
   77 |     int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
      |         ^
new_home.cpp:77:64: warning: unused variable 'J' [-Wunused-variable]
   77 |     int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
      |                                                                ^
new_home.cpp: In function 'void del(int, int)':
new_home.cpp:85:9: warning: unused variable 'I' [-Wunused-variable]
   85 |     int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
      |         ^
new_home.cpp:85:64: warning: unused variable 'J' [-Wunused-variable]
   85 |     int I = lower_bound(u2.begin(), u2.end(), a) - u2.begin(), J = lower_bound(u2.begin(), u2.end(), b) - u2.begin();
      |                                                                ^
new_home.cpp: In function 'std::vector<int> solve(int, int, int, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
new_home.cpp:129:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  129 |         for (int j = 0; j + 1 < ind[i].size(); j++) {
      |                         ~~~~~~^~~~~~~~~~~~~~~
new_home.cpp:159:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::vector<int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  159 |     for (int i = 0; i < qu.size(); i++) {
      |                     ~~^~~~~~~~~~~
new_home.cpp:147:10: warning: variable 'bad' set but not used [-Wunused-but-set-variable]
  147 |     bool bad = 0;
      |          ^~~
#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...