Submission #730976

#TimeUsernameProblemLanguageResultExecution timeMemory
730976alexddSecret (JOI14_secret)C++17
0 / 100
469 ms4320 KiB
#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 timeMemoryGrader output
Fetching results...