P9656 [ICPC2021 Macao R] So I‘ll Max Out My Constructive Algorithm Skills

P9656 [ICPC2021 Macao R] So I‘ll Max Out My Constructive Algorithm Skills_第1张图片

ACcode:


#include
using namespace std;
#define int long long
const int N=70;
int a[N][N],t,n,t1,t2; 
void solve() {
	cin>>n;
  vectorv;
  memset(a,0,sizeof a);
  t1=t2=0;
  for(int i=1;i<=n;i++)
  for(int j=1;j<=n;j++)
  cin>>a[i][j];
  
  for(int i=1;i<=n;i++){
  	if(i%2!=0){
  		for(int j=1;j<=n;j++){
  			v.push_back(a[i][j]);
		  }
	  }
	  else{
	  	for(int j=n;j>=1;j--){
	  		v.push_back(a[i][j]);
		  }
	  }
  }
  for(int i=0;iv[i+1])t1++;
  	else t2++;
  }
  if(t1=0;i--){
  		cout<>t;
	while(t--) {
		solve();
	}
	return 0;
}



over~

你可能感兴趣的:(算法,c++)