当前位置:网站首页>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;
}边栏推荐
- There are software load balancing and hardware load balancing. Which one to choose?
- 五月集训总结——来自阿光
- Hero League rotation map automatic rotation
- 发生OOM了,你知道是什么原因吗,又该怎么解决呢?
- Vs All comments and uncomments
- Why data Tiering
- Une grande vague d'attaques à la source ouverte
- [deep learning] semantic segmentation - source code summary
- Hugo blog graphical writing tool -- QT practice
- Mapreduce实例(七):单表join
猜你喜欢

Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
![《ASP.NET Core 6框架揭秘》样章发布[200页/5章]](/img/4f/5688c391dd19129d912a3557732047.jpg)
《ASP.NET Core 6框架揭秘》样章发布[200页/5章]

Why can't TN-C use 2p circuit breaker?

Mapreduce实例(九):Reduce端join

Contrôle de l'exécution du module d'essai par panneau dans Canoe (primaire)

If a university wants to choose to study automation, what books can it read in advance?

Design and implementation of online snack sales system based on b/s (attached: source code paper SQL file)

小白带你重游Spark生态圈!
![[NLP] bert4vec: a sentence vector generation tool based on pre training](/img/fd/8e5e1577b4a6ccc06e29350a1113ed.jpg)
[NLP] bert4vec: a sentence vector generation tool based on pre training

在CANoe中通过Panel面板控制Test Module 运行(初级)
随机推荐
[Yu Yue education] Wuhan University of science and technology securities investment reference
Mapreduce实例(六):倒排索引
Meituan Er Mian: why does redis have sentinels?
MapReduce instance (VI): inverted index
【深度学习】语义分割:论文阅读(NeurIPS 2021)MaskFormer: per-pixel classification is not all you need
Single chip microcomputer realizes modular programming: Thinking + example + system tutorial (the degree of practicality is appalling)
CANoe下载地址以及CAN Demo 16的下载与激活,并附录所有CANoe软件版本
竞赛vscode配置指南
33岁可以学PLC吗
Tianmu MVC audit I
Segmentation sémantique de l'apprentissage profond - résumé du code source
Why can't TN-C use 2p circuit breaker?
How can I take a shortcut to learn C language in college
解决小文件处过多
在CANoe中通过Panel面板控制Test Module 运行(高级)
[deep learning] semantic segmentation: paper reading: (2021-12) mask2former
max-flow min-cut
Processes of libuv
C#/. Net phase VI 01C Foundation_ 01: running environment, process of creating new C program, strict case sensitivity, meaning of class library
CAPL 脚本对.ini 配置文件的高阶操作