Submission #1106041

# Submission time Handle Problem Language Result Execution time Memory
1106041 2024-10-29T03:10:15 Z hainam2k9 Secret (JOI14_secret) C++17
0 / 100
312 ms 11620 KB
#include <bits/stdc++.h>
#include <secret.h>
#define tt cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(0)
#define fo freopen((NAME+".INP").c_str(), "r", stdin), freopen((NAME+".OUT").c_str(), "w", stdout)
#define ll long long
#define ull unsigned long long
#define i128 __int128
#define db long double
#define sz(a) ((int)(a).size())
#define pb emplace_back
#define pf emplace_front
#define pob pop_back
#define pof pop_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define ins emplace
using namespace std;
const int MOD = 1e9+7, MAXN = 1e5+5;
const string NAME = "";
pair<int,bool> val[1005][1005];
void preprocess(int l, int r, int a[]){
    int mid=(l+r)>>1;
    val[mid][mid].fi=a[mid], val[mid][mid].se=1;
    if(l==r) return;
    preprocess(l,mid,a);
    preprocess(mid+1,r,a);
    for(int i = mid-1; i>=l; --i)
        if(!val[i][mid].se) val[i][mid].fi=Secret(val[i+1][mid].fi,a[i]), val[i][mid].se=1;
    for(int i = mid+1; i<=r; ++i)
        if(!val[mid][i].se) val[mid][i].fi=Secret(val[mid][i-1].fi,a[i]), val[mid][i].se=1;
}
void Init(int n, int a[]){
    for(int i = n; i>0; --i)
        swap(a[i],a[i-1]);
    preprocess(1,n,a);
}
int Query(int l, int r){
    for(int i = l; i<r; ++i)
        if(val[l][i].se&&val[i+1][r].se) return Secret(val[l][i].fi,val[i+1][r].fi);
    return val[l][l].fi;
}
# Verdict Execution time Memory Grader output
1 Incorrect 80 ms 8808 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : 22166791.
2 Incorrect 82 ms 8804 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 522222882.
3 Incorrect 82 ms 8808 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : 600596074.
4 Incorrect 300 ms 11620 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : 927591356.
5 Incorrect 310 ms 11592 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : 468323108.
6 Incorrect 312 ms 11604 KB Wrong Answer: Query(915, 915) - expected : 282904741, actual : 579799611.
7 Incorrect 306 ms 11592 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 110409123.
8 Incorrect 311 ms 11456 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : 122692867.
9 Incorrect 302 ms 11592 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : 85347971.
10 Incorrect 306 ms 11592 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : 981031810.