답안 #730975

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
730975 2023-04-26T17:23:55 Z alexdd 비밀 (JOI14_secret) C++17
0 / 100
454 ms 4460 KB
#include "secret.h"
#include<bits/stdc++.h>
using namespace std;
int bit[2][2];
int a[1005];
int n;
int op(int x, int y)
{
    int rez=0,a,b;
    for(int i=0;i<30;i++)
    {
        a = ((x&(1<<i))!=0);
        b = ((y&(1<<i))!=0);
        rez += (1<<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)
{
    int rez = a[L];
    for(int i=L+1;i<=R;i++)
    {
        rez = op(rez, a[L]);
    }
    return rez;
}


# 결과 실행 시간 메모리 Grader output
1 Incorrect 119 ms 2432 KB Wrong Answer: Query(222, 254) - expected : 34031541, actual : -2102542237.
2 Incorrect 116 ms 2488 KB Wrong Answer: Query(60, 375) - expected : 669221184, actual : 68490240.
3 Incorrect 118 ms 2368 KB Wrong Answer: Query(211, 401) - expected : 674373968, actual : -258783775.
4 Incorrect 432 ms 4356 KB Wrong Answer: Query(90, 497) - expected : 397934825, actual : -536870912.
5 Incorrect 454 ms 4344 KB Wrong Answer: Query(587, 915) - expected : 752404486, actual : -154898175.
6 Incorrect 435 ms 4460 KB Wrong Answer: Query(738, 741) - expected : 983692994, actual : 1157766377.
7 Incorrect 431 ms 4360 KB Wrong Answer: Query(84, 976) - expected : 742463504, actual : 522580392.
8 Incorrect 454 ms 4248 KB Wrong Answer: Query(58, 987) - expected : 20022464, actual : -214060436.
9 Incorrect 429 ms 4372 KB Wrong Answer: Query(33, 967) - expected : 676869696, actual : -142043354.
10 Incorrect 426 ms 4316 KB Wrong Answer: Query(116, 961) - expected : 68487362, actual : -1463121967.