当前位置:网站首页>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;
}
边栏推荐
- PR 2021 quick start tutorial, first understanding the Premiere Pro working interface
- MapReduce instance (VI): inverted index
- CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
- Hard core! One configuration center for 8 classes!
- 五月刷题27——图
- Why can't TN-C use 2p circuit breaker?
- 五月刷题01——数组
- 51单片机进修的一些感悟
- Nc29 search in two-dimensional array
- Compilation of libwebsocket
猜你喜欢
CAP理论
大学想要选择学习自动化专业,可以看什么书去提前了解?
Popularization of security knowledge - twelve moves to protect mobile phones from network attacks
[NLP] bert4vec: a sentence vector generation tool based on pre training
MapReduce instance (V): secondary sorting
The replay block of canoe still needs to be combined with CAPL script to make it clear
听哥一句劝,按这套嵌入式的课程内容和课程体系去学习
Some thoughts on the study of 51 single chip microcomputer
面试突击62:group by 有哪些注意事项?
Mapreduce实例(九):Reduce端join
随机推荐
Download address of canoe, download and activation of can demo 16, and appendix of all canoe software versions
CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
CANoe CAPL文件操作目录合集
There are software load balancing and hardware load balancing. Which one to choose?
Why is 51+ assembly in college SCM class? Why not come directly to STM32
If a university wants to choose to study automation, what books can it read in advance?
Bugku web guide
May brush question 27 - figure
Teach you how to write the first MCU program hand in hand
YARN组织架构
Elk project monitoring platform deployment + deployment of detailed use (II)
max-flow min-cut
五月刷题01——数组
Research and implementation of hospital management inpatient system based on b/s (attached: source code paper SQL file)
在CANoe中通過Panel面板控制Test Module 運行(初級)
June brush question 02 - string
I2C summary (single host and multi host)
Summary of May training - from a Guang
Hero League rotation map automatic rotation
Can I learn PLC at the age of 33