# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
286161 |
2020-08-30T07:39:30 Z |
YJU |
Secret (JOI14_secret) |
C++14 |
|
507 ms |
12552 KB |
#include<bits/stdc++.h>
#include "secret.h"
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
const ll MOD=1e9+7;
const ll MOD2=998244353;
const ll N=2e3+5;
const ld pi=3.14159265359;
const ll INF=(1LL<<60);
#define SQ(i) ((i)*(i))
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define setp setprecision
#define lwb lower_bound
#define SZ(_a) (ll)_a.size()
ll pre[N][N],suf[N][N],n;
void Init(int N,int a[]){
n=N;
function<void(ll,ll)> build = [&](ll l,ll r){
if(l>=r)return ;
ll mid=(l+r)/2;
build(l,mid);build(mid+1,r);
pre[mid][mid+1]=a[mid];
suf[mid][mid-1]=a[mid-1];
for(int i=mid+2;i<=r;i++)pre[mid][i]=Secret(pre[mid][i-1],a[i-1]);
for(int i=mid-2;i>=l;i--)suf[mid][i]=Secret(suf[mid][i+1],a[i]);
};
build(0,n);
}
ll q(ll l,ll r,ll ql,ll qr){
ll mid=(l+r)/2;
if(ql<=mid&&mid<qr){
if(mid==ql)return pre[mid][qr];
if(mid==qr-1)return suf[mid][ql];
return Secret(pre[mid][qr],suf[mid][ql]);
}else{
if(qr<=mid){
return q(l,mid,ql,qr);
}else{
return q(mid+1,r,ql,qr);
}
}
}
int Query(int L,int R){
return q(0,n,L,R+1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
135 ms |
6520 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 38820468. |
2 |
Incorrect |
136 ms |
6520 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 755105792. |
3 |
Incorrect |
135 ms |
6520 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 362156408. |
4 |
Incorrect |
496 ms |
12536 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 108544080. |
5 |
Incorrect |
507 ms |
12524 KB |
Wrong Answer: Query(587, 915) - expected : 752404486, actual : 659085336. |
6 |
Incorrect |
500 ms |
12536 KB |
Wrong Answer: Query(738, 741) - expected : 983692994, actual : 438989368. |
7 |
Incorrect |
502 ms |
12552 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 773554242. |
8 |
Incorrect |
500 ms |
12536 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 490922392. |
9 |
Incorrect |
507 ms |
12536 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 939919433. |
10 |
Incorrect |
502 ms |
12536 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 274803083. |