제출 #992593

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9925932024-06-04 18:32:08AbitoWeirdtree (RMI21_weirdtree)C++17
8 / 100
2052 ms94736 KiB
#include "weirdtree.h"
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define elif else if
#define ep insert
using namespace std;
struct node{
ll mx1,mx2,sum,f;
};
const int NN=3e5+5;
ll n,a[NN];
node seg[4*NN+5];
map<int,set<int>> mp;
node merge(node x,node y){
int a[4]={x.mx1,x.mx2,y.mx1,y.mx2};
sort(a,a+4);
node z;
z.mx1=a[3];
if (a[2]==a[3]) z.mx2=a[1];
else z.mx2=a[2];
z.sum=x.sum+y.sum;
if (a[2]==a[3]) z.f=x.f+y.f;
elif (x.mx1>y.mx1) z.f=x.f;
else z.f=y.f;
return z;
}
void build(int x,int l,int r){
if (l==r){
seg[x]={a[l],0,a[l],1};
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

weirdtree.cpp: In function 'node merge(node, node)':
weirdtree.cpp:16:17: warning: narrowing conversion of 'x.node::mx1' from 'long long int' to 'int' [-Wnarrowing]
   16 |     int a[4]={x.mx1,x.mx2,y.mx1,y.mx2};
      |               ~~^~~
weirdtree.cpp:16:23: warning: narrowing conversion of 'x.node::mx2' from 'long long int' to 'int' [-Wnarrowing]
   16 |     int a[4]={x.mx1,x.mx2,y.mx1,y.mx2};
      |                     ~~^~~
weirdtree.cpp:16:29: warning: narrowing conversion of 'y.node::mx1' from 'long long int' to 'int' [-Wnarrowing]
   16 |     int a[4]={x.mx1,x.mx2,y.mx1,y.mx2};
      |                           ~~^~~
weirdtree.cpp:16:35: warning: narrowing conversion of 'y.node::mx2' from 'long long int' to 'int' [-Wnarrowing]
   16 |     int a[4]={x.mx1,x.mx2,y.mx1,y.mx2};
      |                                 ~~^~~
#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...