当前位置:网站首页>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;
}边栏推荐
- Elk project monitoring platform deployment + deployment of detailed use (II)
- A wave of open source notebooks is coming
- Why is 51+ assembly in college SCM class? Why not come directly to STM32
- Processes of libuv
- The replay block of canoe still needs to be combined with CAPL script to make it clear
- 大学C语言入门到底怎么学才可以走捷径
- Can I learn PLC at the age of 33
- CAPL脚本中关于相对路径/绝对路径操作的几个傻傻分不清的内置函数
- 在CANoe中通过Panel面板控制Test Module 运行(初级)
- Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
猜你喜欢

Segmentation sémantique de l'apprentissage profond - résumé du code source

Hero League rotation map automatic rotation
![《ASP.NET Core 6框架揭秘》样章发布[200页/5章]](/img/4f/5688c391dd19129d912a3557732047.jpg)
《ASP.NET Core 6框架揭秘》样章发布[200页/5章]

一大波開源小抄來襲

Defensive C language programming in embedded development

五月集训总结——来自阿光

Popularization of security knowledge - twelve moves to protect mobile phones from network attacks

Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions

CANoe不能自动识别串口号?那就封装个DLL让它必须行

手把手教您怎么编写第一个单片机程序
随机推荐
CAPL 脚本对.ini 配置文件的高阶操作
五月刷题02——字符串
Leetcode:608 tree node
What are the models of data modeling
CAPL script pair High level operation of INI configuration file
Learning SCM is of great help to society
零基础学习单片机切记这四点要求,少走弯路
解决小文件处过多
YARN组织架构
发生OOM了,你知道是什么原因吗,又该怎么解决呢?
Compress decompress
33岁可以学PLC吗
Combined search /dfs solution - leetcode daily question - number of 1020 enclaves
Keep these four requirements in mind when learning single chip microcomputer with zero foundation and avoid detours
Competition vscode Configuration Guide
Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
Mapreduce实例(八):Map端join
The real future of hardware engineers may not be believed by you if I say so
Redis distributed lock implementation redison 15 questions
May brush question 26 - concurrent search