当前位置:网站首页>Contest3145 - the 37th game of 2021 freshman individual training match_ C: Tour guide
Contest3145 - the 37th game of 2021 freshman individual training match_ C: Tour guide
2022-07-06 09:53:00 【This question AC sleep again】
//
#include<bits/stdc++.h>
using namespace std;
const int MAXN=11;
int a[MAXN][MAXN];
bool used[MAXN];
int n,ans;
void init()
{
memset( a,0,sizeof( a ) );
memset( used,0,sizeof( used ) );
ans=0;
}
// Judgment No. x A student The current total is sum
void dfs( int x,int sum )
{
if( x==n ) { ans=max( ans,sum ); return ; }
int i,j;
for( i=x;i<n;i++ )
{
for( j=0;j<n;j++ )
{
if( used[j]==false )
{
used[j]=true;
dfs( i+1,sum+a[i][j] );
used[j]=false;
}
}
}
}
int main()
{
int i,j; init();
while( ~scanf("%d",&n) )
{
for( i=0;i<n;i++ )
{
for( j=0;j<n;j++ )
{
scanf("%d",&a[i][j]);
}
}
dfs( 0,0 );
printf("%d\n",ans);
init();
}
return 0;
}
边栏推荐
- 面试突击62:group by 有哪些注意事项?
- 51单片机进修的一些感悟
- Regular expressions are actually very simple
- How can I take a shortcut to learn C language in college
- Automation sequences of canoe simulation functions
- tn-c为何不可用2p断路器?
- MapReduce instance (V): secondary sorting
- Contrôle de l'exécution du module d'essai par panneau dans Canoe (primaire)
- Yarn organizational structure
- Compress decompress
猜你喜欢
CAPL 脚本打印函数 write ,writeEx ,writeLineEx ,writeToLog ,writeToLogEx ,writeDbgLevel 你真的分的清楚什么情况下用哪个吗?
Control the operation of the test module through the panel in canoe (Advanced)
Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
[deep learning] semantic segmentation - source code summary
33岁可以学PLC吗
CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
I2C summary (single host and multi host)
DCDC power ripple test
MapReduce instance (x): chainmapreduce
Which is the better prospect for mechanical engineer or Electrical Engineer?
随机推荐
在CANoe中通過Panel面板控制Test Module 運行(初級)
Random notes
CANoe不能自动识别串口号?那就封装个DLL让它必须行
六月刷题01——数组
MapReduce instance (IX): reduce end join
Solve the problem of too many small files
Can I learn PLC at the age of 33
May brush question 02 - string
Tianmu MVC audit I
Regular expressions are actually very simple
C杂讲 文件 续讲
Competition vscode Configuration Guide
Use of activiti7 workflow
Mapreduce实例(十):ChainMapReduce
一大波开源小抄来袭
[Yu Yue education] reference materials of power electronics technology of Jiangxi University of science and technology
单片机实现模块化编程:思维+实例+系统教程(实用程度令人发指)
Mapreduce实例(七):单表join
Mapreduce实例(九):Reduce端join
[Yu Yue education] Wuhan University of science and technology securities investment reference