当前位置:网站首页>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;
}
边栏推荐
- Design and implementation of online snack sales system based on b/s (attached: source code paper SQL file)
- Hero League rotation map automatic rotation
- Yarn organizational structure
- Solve the problem of too many small files
- Research and implementation of hospital management inpatient system based on b/s (attached: source code paper SQL file)
- Nc29 search in two-dimensional array
- Why can't TN-C use 2p circuit breaker?
- [NLP] bert4vec: a sentence vector generation tool based on pre training
- CANoe CAPL文件操作目录合集
- 机械工程师和电气工程师方向哪个前景比较好?
猜你喜欢
Popularization of security knowledge - twelve moves to protect mobile phones from network attacks
Defensive C language programming in embedded development
CAPL script printing functions write, writeex, writelineex, writetolog, writetologex, writedbglevel do you really know which one to use under what circumstances?
The replay block of canoe still needs to be combined with CAPL script to make it clear
What you have to know about network IO model
Single chip microcomputer realizes modular programming: Thinking + example + system tutorial (the degree of practicality is appalling)
[one click] it only takes 30s to build a blog with one click - QT graphical tool
CAPL script pair High level operation of INI configuration file
[Yu Yue education] Wuhan University of science and technology securities investment reference
Some thoughts on the study of 51 single chip microcomputer
随机推荐
tn-c为何不可用2p断路器?
Scoped in webrtc_ refptr
[deep learning] semantic segmentation: thesis reading (neurips 2021) maskformer: per pixel classification is not all you need
MapReduce instance (IX): reduce end join
The replay block of canoe still needs to be combined with CAPL script to make it clear
June brush question 02 - string
嵌入式开发中的防御性C语言编程
CANoe CAPL文件操作目录合集
018.有效的回文
在CANoe中通過Panel面板控制Test Module 運行(初級)
[deep learning] semantic segmentation - source code summary
[deep learning] semantic segmentation: paper reading: (CVPR 2022) mpvit (cnn+transformer): multipath visual transformer for dense prediction
一大波开源小抄来袭
Mapreduce实例(七):单表join
Release of the sample chapter of "uncover the secrets of asp.net core 6 framework" [200 pages /5 chapters]
Leetcode:608 tree node
MapReduce instance (x): chainmapreduce
CANoe下载地址以及CAN Demo 16的下载与激活,并附录所有CANoe软件版本
Defensive C language programming in embedded development
【深度学习】语义分割:论文阅读:(2021-12)Mask2Former