# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
487560 |
2021-11-16T07:44:12 Z |
AmirElarbi |
Secret (JOI14_secret) |
C++14 |
|
20000 ms |
8228 KB |
#include <bits/stdc++.h>
#include "secret.h"
#define vi vector<int>
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define fi first
#define se second
#define INF 1e9
#define eps 1e-7
#define eps1 1e-25
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 1e5+5
#define V 450
using namespace std;
const int MOD = 1e9+7;
const int nax = 1005;
int n;
vi s;
int t[nax][nax];
void solve(int l, int r){
if(l >= r) return;
int md = (l+r)/2;
t[md][md] = s[md];
t[md+1][md+1] = s[md+1];
for (int i = md+1; i <= r; ++i)
{
t[md][i] = Secret(t[md][i-1],s[i]);
}
for (int i = md-1; i >= l; --i)
{
t[md][i] = Secret(t[i-1][md],s[i]);
}
solve(l,md),solve(md+1,r);
}
void Init(int N, int A[]){
n = N;
for (int i = 0; i < N; ++i)
{
s.pb(A[i]);
}
solve(0,n-1);
}
int Query(int L, int R){
int l = 0, r = n-1;
int md = (l+r)/2;
while(!(L <= md && md <= R)){
if(md > R)
r = md;
else
l = md+1;
}
return Secret(t[L][md],t[md][R]);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
20080 ms |
4420 KB |
Time limit exceeded |
2 |
Incorrect |
111 ms |
4292 KB |
Wrong Answer: Query(60, 375) - expected : 669221184, actual : 193042560. |
3 |
Incorrect |
113 ms |
4412 KB |
Wrong Answer: Query(211, 401) - expected : 674373968, actual : 967888976. |
4 |
Execution timed out |
20072 ms |
8176 KB |
Time limit exceeded |
5 |
Execution timed out |
20074 ms |
8132 KB |
Time limit exceeded |
6 |
Execution timed out |
20052 ms |
8224 KB |
Time limit exceeded |
7 |
Incorrect |
414 ms |
8228 KB |
Wrong Answer: Query(84, 976) - expected : 742463504, actual : 141133874. |
8 |
Incorrect |
412 ms |
8100 KB |
Wrong Answer: Query(58, 987) - expected : 20022464, actual : 470009216. |
9 |
Incorrect |
411 ms |
8132 KB |
Wrong Answer: Query(33, 967) - expected : 676869696, actual : 541073037. |
10 |
Incorrect |
412 ms |
8132 KB |
Wrong Answer: Query(116, 961) - expected : 68487362, actual : 340812928. |