Submission #290136

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2901362020-09-03 12:31:39TadijaSebezSweeping (JOI20_sweeping)C++11
100 / 100
4788 ms603636 KiB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
struct Query{
int type;
int idx,x,y;
int l;
Query(){}
Query(int t,int i,int X,int Y):type(t),idx(i),x(X),y(Y),l(-1){}
Query(int t,int i,int L):type(t),idx(i),l(L),x(-1),y(-1){}
};
const int N=1500050;
const int M=2*N;
pii ans[N];
int n,m,q;
int val[M],myc[N*2],tsz,rem[N];
vector<int> cmp[M];
int add(int i,int v){tsz++;val[tsz]=v;myc[i]=tsz;cmp[tsz]={i};return tsz;}
int mrg(int a,int b){
if(cmp[a].size()>cmp[b].size())swap(a,b);
for(int i:cmp[a]){
myc[i]=b;
cmp[b].pb(i);
}
cmp[a].clear();
return b;
}
void DNC(int l,int r,vector<Query> Qs){
if(Qs.empty())return;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

sweeping.cpp: In constructor 'Query::Query(int, int, int)':
sweeping.cpp:8:6: warning: 'Query::l' will be initialized after [-Wreorder]
    8 |  int l;
      |      ^
sweeping.cpp:7:10: warning:   'int Query::x' [-Wreorder]
    7 |  int idx,x,y;
      |          ^
sweeping.cpp:11:2: warning:   when initialized here [-Wreorder]
   11 |  Query(int t,int i,int L):type(t),idx(i),l(L),x(-1),y(-1){}
      |  ^~~~~
sweeping.cpp: In function 'void DNC(int, int, std::vector<Query>)':
sweeping.cpp:31:11: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   31 |  int mid=l+r>>1;
      |          ~^~
sweeping.cpp: In function 'int main()':
sweeping.cpp:104:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  104 |  scanf("%i %i %i",&n,&m,&q);
      |  ~~~~~^~~~~~~~~~~~~~~~~~~~~
sweeping.cpp:107:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  107 |   scanf("%i %i",&x,&y);
      |   ~~~~~^~~~~~~~~~~~~~~
sweeping.cpp:112:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  112 |   int t;scanf("%i",&t);
      |         ~~~~~^~~~~~~~~
sweeping.cpp:114:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  114 |    int idx;scanf("%i",&idx);
      |            ~~~~~^~~~~~~~~~~
sweeping.cpp:117:15: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  117 |    int l;scanf("%i",&l);
      |          ~~~~~^~~~~~~~~
sweeping.cpp:120:17: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  120 |    int x,y;scanf("%i %i",&x,&y);
      |            ~~~~~^~~~~~~~~~~~~~~
#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...