Submission #862609

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
8626092023-10-18 15:44:40HossamHero7Osumnjičeni (COCI21_osumnjiceni)C++14
110 / 110
566 ms77976 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
void compress(vector<int> &a){
int n = a.size();
vector<pair<int,int>> b(n);
for(int i=0;i<n;i++){
b[i].first = a[i];
b[i].second = i;
}
sort(b.begin(),b.end());
a[b[0].second] = 1;
int cnt = 1;
for(int i=1;i<n;i++){
if(b[i].first == b[i-1].first){
a[b[i].second] = a[b[i-1].second];
}
else a[b[i].second] = ++cnt;
}
}
struct segTree{
int n;
vector<int> tree;
vector<int> lazy;
segTree(int _n){
n = _n;
tree.resize(4*n+5,-1);
lazy.resize(4*n+5,-1);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In member function 'void segTree::update(int, int, int, int, int, int)':
Main.cpp:44:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   44 |         int md = l + r >> 1;
      |                  ~~^~~
Main.cpp: In member function 'int segTree::query(int, int, int, int, int)':
Main.cpp:56:20: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   56 |         int md = l + r >> 1;
      |                  ~~^~~
Main.cpp: In function 'void build(std::vector<int>&)':
Main.cpp:67:104: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   67 |     for(int k=1;k<30;k++) for(int i=0;i+(1<<k)-1<n;i++)sparse[i][k] = max(sparse[i][k-1],sparse[i+(1<<k-1)][k-1]);
      |                                                                                                       ~^~
Main.cpp: In function 'void solve()':
Main.cpp:79:15: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   79 |     for(auto &[l,r] : v) cin>>l>>r;
      |               ^
Main.cpp:81:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   81 |     for(auto [l,r] : v) tmp.push_back(l);
      |              ^
Main.cpp:82:14: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   82 |     for(auto [l,r] : v) tmp.push_back(r);
      |              ^
Main.cpp:97:24: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   97 |             int md = l + r >> 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...
#Verdict Execution timeMemoryGrader output
Fetching results...