Submission #1144109

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11441092025-02-02 12:25:09dpsaveslivesCake (CEOI14_cake)C++20
0 / 100
319 ms10096 KiB
#include<bits/stdc++.h>
using namespace std;
const int Len = 2.5e5 + 5;
struct node
{
int val,idx;
}d[Len];
bool cmp(node x,node y){return x.val > y.val;}
int Id[Len],n,a,q,ans[Len << 2][2],rk[Len];
int ls(int x){return x << 1;}
int rs(int x){return x << 1 | 1;}
void push_up(int x,int t){ans[x][t] = min(ans[ls(x)][t] , ans[rs(x)][t]);}
void build(int p,int l,int r,int t)
{
if(l == r)
{
ans[p][t] = d[l].val;
return;
}
int mid = (l + r) >> 1;
build(ls(p) , l , mid , t);
build(rs(p) , mid + 1 , r , t);
push_up(p , t);
}
void update(int p,int l,int r,int idx,int w,int t)
{
if(l == r)
{
ans[p][t] = w;
return;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

cake.cpp: In function 'int main()':
cake.cpp:64:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   64 |         scanf("%d %d",&n,&a);
      |         ~~~~~^~~~~~~~~~~~~~~
cake.cpp:67:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   67 |                 scanf("%d",&d[i].val);
      |                 ~~~~~^~~~~~~~~~~~~~~~
cake.cpp:75:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   75 |         scanf("%d",&q);
      |         ~~~~~^~~~~~~~~
cake.cpp:79:22: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   79 |                 scanf("%s",s + 1);
      |                 ~~~~~^~~~~~~~~~~~
cake.cpp:82:36: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   82 |                         int x;scanf("%d",&x);
      |                               ~~~~~^~~~~~~~~
cake.cpp:101:57: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
  101 |                         int x,y,nowp = min(n , 10);scanf("%d %d",&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...