# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
15458 | myungwoo | 쿼터너리 컴퓨터 (kriii3_Z) | C++14 | 4000 ms | 1728 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.
#include <bits/stdc++.h>
using namespace std;
int N, M;
int F[18], A[18], B[18], ans[18];
struct Z{
int t, x, y, z;
} Q[401];
void dfs(int n)
{
if (n == N){
for (int i=0;i<N;i++) B[i] = A[i];
for (int i=1;i<=M;i++){
if (Q[i].t == 0){
B[Q[i].x] = (B[Q[i].y] + B[Q[i].z]) & 3;
}else if (Q[i].t == 1){
B[Q[i].x] = (B[Q[i].y] ^ B[Q[i].z]);
}else if (Q[i].t == 2){
B[Q[i].x] = (B[Q[i].y] + Q[i].z) & 3;
}else{
B[Q[i].x] = (B[Q[i].y] ^ Q[i].z);
}
}
for (int i=0;i<N;i++) ans[i] = (ans[i] + B[i]) & 3;
return;
}
for (int i=0;i<4;i++) if (i != F[n]){
A[n] = i;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |