Submission #95025

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
950252019-01-26 22:17:31Rouge_HugoKronican (COCI16_kronican)C++14
100 / 100
837 ms16036 KiB
#include <bits/stdc++.h>
using namespace std;
int n,k;
long long d[2000009];
long long a[22][22];
long long dp(int mask,int y)
{
if (y==k)return 0;
if(d[mask]!=-1)return d[mask];
long long mn=10000000000;
long long u=10000000000;
for(int i=0;i<n;i++)
{
int l=21;
mn=10000000000;
if (((1<<i)&mask)==(1<<i))
{
for(int j=0;j<n;j++)
{
if (i!=j&&(((1<<j)&mask)==(1<<j)))
{
mn=min(mn,a[i][j]);
}
}
u=min(u,dp(mask-(1<<i),y-1)+mn);
}
}
return d[mask]=u;
}
int main()
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

kronican.cpp: In function 'long long int dp(int, int)':
kronican.cpp:14:7: warning: unused variable 'l' [-Wunused-variable]
   int l=21;
       ^
#Verdict Execution timeMemoryGrader output
Fetching results...