# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15761 | myungwoo | 쿼터너리 컴퓨터 (kriii3_Z) | C++14 | 363 ms | 1088 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
int D[30];
int ord[400][4];
ll ans[30];
int main()
{
int N, M;
scanf("%d%d", &N, &M);
for(int i = 0; i < N; i++) scanf("%d", D+i);
for(int i = 0; i < M; i++) scanf("%d%d%d%d", ord[i], ord[i]+1, ord[i]+2, ord[i]+3);
for(int i = 0; i < 1<<N; i++){
pii mem[30] = {};
ll mul = 1;
for(int j = 1, k = 0; j < 1<<N; j*=2, k++){
int p = !!(i&j), q = 1 - D[k] / 2;
mem[k].first = p;
if( p ^ (D[k]%2 == 0) ) mem[k].second = q;
else mem[k].second = 1<<k+1, mul = mul * 2;
}
for(int j = 0; j < M; j++){
int o = ord[j][0], x = ord[j][1], y = ord[j][2], z = ord[j][3];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |