Submission #1045949

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10459492024-08-06 08:41:15vjudge1Rectangles (IOI19_rect)C++17
72 / 100
5067 ms1044024 KiB
#include "rect.h"
#include<bits/stdc++.h>
using namespace std;
set<int>pos[2501][2501],pos2[2501][2501],stb[2501][20];
set<int> operator & (const set<int>&a,const set<int>&b){
set<int>c;
if(a.size()<b.size()){
for(auto i:a)
if(b.count(i))
c.insert(i);
} else for(auto i:b)
if(a.count(i))
c.insert(i);
return c;
}
vector<array<int,4>> ops;
int CC;
vector<int>res;
int cnt(int l,int r,int col){
/*int x=31-__builtin_clz(r-l+1);
set<int>k=stb[l][x]&stb[r-(1<<x)+1][x];*/
set<int>k=stb[l][0];
for(int i=l;i++<r;)
k=k&stb[i][0];
return distance(k.begin(),k.upper_bound(res[CC++]));
}
int calc(int r1,int r2,int beg){
while(stb[++beg][0].count(r2));
return beg-1;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

rect.cpp: In function 'long long int count_rectangles(std::vector<std::vector<int> >)':
rect.cpp:78:50: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   78 |                 stb[i][j]=stb[i][j-1]&stb[i+(1<<j-1)][j-1];
      |                                                 ~^~
rect.cpp:88:46: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
   88 |             stb[i][j]=stb[i][j-1]&stb[i+(1<<j-1)][j-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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...