# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
41194 | wzy | 아름다운 순열 (IZhO12_beauty) | C++14 | 2662 ms | 165108 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int adj[30] , v[30] , n , m ;
long long dp[20][1<<20] , maxi;
pair<int,int> f(int x){
int z1 , z2 , a1 = 0 , a2 = 0;
z1 = x, z2 = x;
while(z1 > 0){
if(z1%2 == 1) a1++;
z1/=2;
}
while(z2 > 0){
if(z2%3 == 1)a2++;
z2/=3;
}
return pair<int,int>(a1 , a2);
}
long long solve(int i , int j){
if(dp[i][j] != -1) return dp[i][j];
if(j == maxi) return 1;
dp[i][j] = 0;
for(int w = 0 ; w < n; w++){
if(1<<w & j) continue;
if(1<<w & adj[i]) dp[i][j] += solve(w , j | 1<<w);
}
return dp[i][j];
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |