Submission #573814

# Submission time Handle Problem Language Result Execution time Memory
573814 2022-06-07T08:53:15 Z Sho10 Secret (JOI14_secret) C++17
0 / 100
452 ms 11284 KB
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho
#include "secret.h"
using ll=long long;
using ld=long double;
int const INF=1000000005;
ll const LINF=1000000000000000005;
ll const mod=6700417;
ld const PI=3.14159265359;
ll const MAX_N=3e5+5;
ld const EPS=0.00000001;
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define endl '\n'
#define sz(a) (int)a.size()
#define CODE_START  ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll pref[1005][1005],v[1005];
void add(ll l,ll r){
    if(l==r){
        return;
    }
ll mid=(l+r)/2;
for(ll i=mid-1;i>=l;i--)
{
pref[i][mid]=Secret(pref[i+1][mid],pref[i][i]);
}
for(ll i=mid+2;i<r;i++)
{
    pref[mid+1][i]=Secret(pref[mid+1][i-1],pref[i][i]);
}
add(l,mid);
add(mid+1,r);
}
void Init(int n,int a[]){
for(ll i=0;i<n;i++)
    for(ll j=i+1;j<n;j++)
{
    pref[i][j]=-1;
}
for(ll i=0;i<n;i++)
{
    pref[i][i]=a[i];
    v[i]=a[i];
}
add(0,n);
}
int Query(int l,int r){
if(pref[l][r]!=-1){
    return pref[l][r];
}
for(ll i=l;i<r;i++)
{
    if(pref[l][i]!=-1&&pref[i+1][r]!=-1){
        return Secret(pref[l][i],pref[i+1][r]);
    }
}
}

Compilation message

secret.cpp: In function 'int Query(int, int)':
secret.cpp:61:1: warning: control reaches end of non-void function [-Wreturn-type]
   61 | }
      | ^
# Verdict Execution time Memory Grader output
1 Incorrect 129 ms 5596 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 268854015.
2 Incorrect 115 ms 5456 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 747241792.
3 Incorrect 122 ms 5580 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 353554500.
4 Incorrect 446 ms 11244 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 343081568.
5 Incorrect 429 ms 11232 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : 497583184.
6 Incorrect 445 ms 11284 KB Wrong Answer: Query(738, 741) - expected : 983692994, actual : 993621889.
7 Incorrect 452 ms 11184 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 657493000.
8 Incorrect 424 ms 11276 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 764569728.
9 Incorrect 452 ms 11268 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 277877441.
10 Incorrect 442 ms 11268 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 69725386.