#include "secret.h"
#include <bits/stdc++.h>
#define fast ios::sync_with_stdio(0); cin.tie(NULL);cout.tie(NULL)
#define sz(x) (int)((x).size())
#define pb push_back
#define vi vector<int>
#define vb vector<bool>
#define vvb vector<vb>
#define pi pair<int,int>
#define vpi vector<pi>
#define vvi vector<vi>
#define vc vector<char>
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pbb() pop_back()
#define f first
#define s second
#define ll long long
//#define int long long
#define ull unsigned long long
#define line cout<<"_____________________________"<<endl;
#define hash cout<<"################"<<endl;
#define forr(i, a, b) for(int i=a; i<b; i++)
using namespace std;
const int N=1e5+1, mod=1e9+7, inf=1e18+1;
vi a;
int n;
void Set(int x, int v, int i , int l, int r)
{
if(r-l==1)
{
a[x]=v;
return;
}
int m= (l+r)/2;
if(i<m) Set(2*x+1, v, i, l , m);
else Set(2*x+2, v, i, m , r);
a[x]= Secret(a[2*x+1], a[2*x+2]);
}
void Init(int m, int A[])
{
n=1;
while(n<m) n*=2;
a.resize(2*n-1, -1);
forr(i, 0, n) Set(0, A[i], i, 0, n);
}
int query(int x, int lx, int rx, int l, int r)
{
if(l>=rx or lx>=r) return -1;
if(l>=lx and r<=rx) return a[x];
int mx= (lx+rx)/2;
int v1= query(2*x+1, lx, mx, l, r), v2= query(2*x+2, mx, rx, l, r);
if(v1!=-1 and v2!=-1) return Secret(v1, v2);
if(v1==-1) return v2;
return v1;
}
int Query(int l, int r)
{
return query(0, 0, n, l, r+1);
}
Compilation message
secret.cpp:25:39: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
25 | const int N=1e5+1, mod=1e9+7, inf=1e18+1;
| ~~~~^~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
106 ms |
2380 KB |
Wrong Answer [1] |
2 |
Incorrect |
108 ms |
2432 KB |
Wrong Answer [1] |
3 |
Incorrect |
112 ms |
2364 KB |
Wrong Answer [1] |
4 |
Incorrect |
410 ms |
4344 KB |
Wrong Answer [1] |
5 |
Incorrect |
407 ms |
4320 KB |
Wrong Answer [1] |
6 |
Incorrect |
399 ms |
4260 KB |
Wrong Answer [1] |
7 |
Incorrect |
399 ms |
4360 KB |
Wrong Answer [1] |
8 |
Incorrect |
393 ms |
4316 KB |
Wrong Answer [1] |
9 |
Incorrect |
397 ms |
4316 KB |
Wrong Answer [1] |
10 |
Incorrect |
400 ms |
4388 KB |
Wrong Answer [1] |