当前位置:网站首页>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;
}
边栏推荐
- [NLP] bert4vec: a sentence vector generation tool based on pre training
- [deep learning] semantic segmentation: paper reading: (2021-12) mask2former
- Mapreduce实例(六):倒排索引
- 在CANoe中通过Panel面板控制Test Module 运行(高级)
- 五月刷题03——排序
- Safety notes
- [one click] it only takes 30s to build a blog with one click - QT graphical tool
- How does the single chip microcomputer execute the main function from power on reset?
- Why data Tiering
- 五月刷题01——数组
猜你喜欢
Use of activiti7 workflow
[one click] it only takes 30s to build a blog with one click - QT graphical tool
MapReduce instance (IX): reduce end join
MapReduce instance (x): chainmapreduce
MapReduce instance (VIII): Map end join
Take you back to spark ecosystem!
Defensive C language programming in embedded development
What are the models of data modeling
Cap theory
解决小文件处过多
随机推荐
Research and implementation of hospital management inpatient system based on b/s (attached: source code paper SQL file)
[NLP] bert4vec: a sentence vector generation tool based on pre training
Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
tn-c为何不可用2p断路器?
Bugku web guide
Single chip microcomputer realizes modular programming: Thinking + example + system tutorial (the degree of practicality is appalling)
[deep learning] semantic segmentation: paper reading: (CVPR 2022) mpvit (cnn+transformer): multipath visual transformer for dense prediction
C#/. Net phase VI 01C Foundation_ 01: running environment, process of creating new C program, strict case sensitivity, meaning of class library
五月刷题01——数组
Compilation of libwebsocket
Teach you how to write the first MCU program hand in hand
Une grande vague d'attaques à la source ouverte
Use of activiti7 workflow
Summary of May training - from a Guang
There are software load balancing and hardware load balancing. Which one to choose?
学习单片机对社会的帮助是很大的
Inject common SQL statement collation
[Yu Yue education] Wuhan University of science and technology securities investment reference
Redis distributed lock implementation redison 15 questions
一大波開源小抄來襲