Submission #15458

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
154582015-07-12 08:02:17myungwoo쿼터너리 컴퓨터 (kriii3_Z)C++14
31 / 126
4000 ms1728 KiB
#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;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...