Submission #730977

# Submission time Handle Problem Language Result Execution time Memory
730977 2023-04-26T17:27:15 Z alexdd Secret (JOI14_secret) C++17
0 / 100
20000 ms 4280 KB
#include "secret.h"
#include<bits/stdc++.h>
using namespace std;
long long bit[2][2];
long long a[1005];
long long n;
long long op(long long x, long long y)
{
    long long rez=0,a,b;
    for(long long i=0;i<30;i++)
    {
        a = ((x&(1LL<<i))!=0);
        b = ((y&(1LL<<i))!=0);
        rez += (1LL<<i) * bit[a][b];
    }
    return rez;
}
void Init(int N, int A[])
{
    for(int i=0;i<2;i++)
        for(int j=0;j<2;j++)
            bit[i][j] = Secret(i,j);
    for(int i=0;i<2;i++)
        for(int j=0;j<2;j++)
    {
        if(bit[i][j]!=0 && bit[i][j]!=1)
        {
            while(1)
                bit[i][j]=0;
        }
    }
    n=N;
    for(int i=1;i<=n;i++)
        a[i]=A[i];
}

int Query(int L, int R)
{
    long long rez = a[L];
    for(int i=L+1;i<=R;i++)
    {
        rez = op(rez, a[L]);
    }
    return rez;
}


# Verdict Execution time Memory Grader output
1 Execution timed out 20075 ms 2260 KB Time limit exceeded
2 Execution timed out 20026 ms 2300 KB Time limit exceeded
3 Execution timed out 20092 ms 2288 KB Time limit exceeded
4 Execution timed out 20027 ms 4224 KB Time limit exceeded
5 Execution timed out 20044 ms 4204 KB Time limit exceeded
6 Execution timed out 20024 ms 4280 KB Time limit exceeded
7 Incorrect 430 ms 4256 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 522580392.
8 Execution timed out 20031 ms 4176 KB Time limit exceeded
9 Execution timed out 20047 ms 4232 KB Time limit exceeded
10 Execution timed out 20030 ms 4240 KB Time limit exceeded