Submission #379031

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3790312021-03-17 08:41:01leinad2Cake 3 (JOI19_cake3)C++17
100 / 100
1397 ms124268 KiB
#include<bits/stdc++.h>
using namespace std;
struct node
{
int l, r, v;
long long sum;
}nd;
node pst[5000010];
pair<int, int>A[200010];
map<int, int>x, y;
map<int, int>::iterator it;
int t, n, q, a, b, c, d, i, j, sz, m, rt, cnt, root[200010], opt[200010], X[200010], Y[200010];
long long dap=-1e18;
void make_node(){pst[sz++]={-1, -1, 0, 0};}
void init(int id, int s, int e)
{
if(s==e)return;
int m=s+e>>1;
if(pst[id].l==-1)
{
pst[id].l=sz;
make_node();
}
init(pst[id].l, s, m);
if(pst[id].r==-1)
{
pst[id].r=sz;
make_node();
}
init(pst[id].r, m+1, e);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cake3.cpp: In function 'void init(int, int, int)':
cake3.cpp:18:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   18 |     int m=s+e>>1;
      |           ~^~
cake3.cpp: In function 'void update(int, int, int, int, int)':
cake3.cpp:37:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   37 |     int m=s+e>>1;
      |           ~^~
cake3.cpp: In function 'long long int get(int, int, int, int, int)':
cake3.cpp:58:12: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   58 |     int m=s+e>>1;
      |           ~^~
cake3.cpp: In function 'void dnc(int, int, int, int)':
cake3.cpp:65:14: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   65 |     int mid=s+e>>1;
      |             ~^~
cake3.cpp: At global scope:
cake3.cpp:82:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   82 | main()
      |      ^
cake3.cpp: In function 'int main()':
cake3.cpp:92:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   92 |     for(it=x.begin();it!=x.end();it++)it->second=++cnt,X[cnt]=it->first;cnt=0;
      |     ^~~
cake3.cpp:92:73: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   92 |     for(it=x.begin();it!=x.end();it++)it->second=++cnt,X[cnt]=it->first;cnt=0;
      |                                                                         ^~~
cake3.cpp:84:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   84 |     for(scanf("%d %d", &n, &m);i++<n;)
      |         ~~~~~^~~~~~~~~~~~~~~~~
cake3.cpp:86:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   86 |         scanf("%d %d", &b, &a);
      |         ~~~~~^~~~~~~~~~~~~~~~~
cake3.cpp: In function 'void dnc(int, int, int, int)':
cake3.cpp:79:8: warning: 'pos' may be used uninitialized in this function [-Wmaybe-uninitialized]
   79 |     dnc(s, mid-1, l, pos);
      |     ~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...