# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
556097 |
2022-05-02T11:00:07 Z |
urosk |
Secret (JOI14_secret) |
C++14 |
|
522 ms |
8348 KB |
#include "secret.h"
#define here cerr<<"===========================================\n"
#include <bits/stdc++.h>
#define ld double
#define ll long long
#define ull unsigned long long
#define llinf 100000000000000000LL // 10^17
#define iinf 2000000000 // 2*10^9
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()
#define ceri(a,l,r) {for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
using namespace std;
#define maxn 1005
int a[maxn];
int c[maxn][maxn];
int n;
void init(int l,int r){
if(l>=r) return;
int mid = (l+r)/2;
for(int i = mid+1;i<=r;i++) c[mid][i] = Secret(c[mid][i-1],a[i]);
for(int i = mid-2;i>=l;i--) c[i][mid-1] = Secret(a[i],c[i+1][mid-1]);
init(l,mid-1);
init(mid+1,r);
}
void Init(int N, int A[]) {
n = N;
for(int i = 1;i<=n;i++) a[i] = A[i-1];
for(int i = 1;i<=n;i++) c[i][i] = a[i];
init(1,n);
}
int get(int tl,int tr,int l,int r){
if(l==r) return c[l][r];
int mid = (tl+tr)/2;
if(mid-1>=l&&mid<=r) return Secret(c[l][mid-1],c[mid][r]);
if(l>=mid) return get(mid+1,tr,l,r);
return get(tl,mid-2,l,r);
}
int Query(int L, int R) {
int ans = get(1,n,L+1,R+1);
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
144 ms |
4380 KB |
Wrong Answer: Query(222, 254) - expected : 34031541, actual : 269647265. |
2 |
Incorrect |
126 ms |
4476 KB |
Wrong Answer: Query(102, 157) - expected : 32612619, actual : 0. |
3 |
Incorrect |
134 ms |
4452 KB |
Wrong Answer: Query(334, 369) - expected : 363022362, actual : 536870912. |
4 |
Incorrect |
481 ms |
8300 KB |
Wrong Answer: Query(90, 497) - expected : 397934825, actual : 536870912. |
5 |
Incorrect |
500 ms |
8348 KB |
Wrong Answer: Query(263, 292) - expected : 653448456, actual : 536870912. |
6 |
Incorrect |
512 ms |
8264 KB |
Wrong Answer: Query(738, 741) - expected : 983692994, actual : 536870912. |
7 |
Correct |
490 ms |
8252 KB |
Output is correct - number of calls to Secret by Init = 7499, maximum number of calls to Secret by Query = 1 |
8 |
Correct |
522 ms |
8288 KB |
Output is correct - number of calls to Secret by Init = 7499, maximum number of calls to Secret by Query = 1 |
9 |
Correct |
483 ms |
8268 KB |
Output is correct - number of calls to Secret by Init = 7499, maximum number of calls to Secret by Query = 1 |
10 |
Correct |
510 ms |
8252 KB |
Output is correct - number of calls to Secret by Init = 7499, maximum number of calls to Secret by Query = 1 |