Submission #730976

# Submission time Handle Problem Language Result Execution time Memory
730976 2023-04-26T17:25:50 Z alexdd Secret (JOI14_secret) C++17
0 / 100
469 ms 4320 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);
    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 Incorrect 118 ms 2332 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : -2102542237.
2 Incorrect 118 ms 2508 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 68490240.
3 Incorrect 114 ms 2404 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : -258783775.
4 Incorrect 468 ms 4320 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : -536870912.
5 Incorrect 449 ms 4284 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : -154898175.
6 Incorrect 452 ms 4284 KB Wrong Answer: Query(738, 741) - expected : 983692994, actual : 1157766377.
7 Incorrect 469 ms 4164 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 522580392.
8 Incorrect 449 ms 4248 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : -214060436.
9 Incorrect 441 ms 4216 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : -142043354.
10 Incorrect 459 ms 4172 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : -1463121967.