RE
查看原帖
RE
1269423
huge_wave楼主2024/6/27 15:30
#include<bits/stdc++.h>
using namespace std;
const int N=10000;
typedef long long ll;
struct noid{
	int x,y;
}a[N];
bool xxx(noid g,noid h){
	if(g.x==h.x){
		return g.y<h.y;
	}
	return g.x<h.x;
}
int main(){
	/*ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);*/
	int n,ans=0;
	scanf("%d",&n);
	char c[11100][11100];
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			char dd;
			cin>>dd;
			if(dd=='O'){
				ans++;
				a[ans].x=i;
				a[ans].y=j;
			}
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			cin>>c[i][j];
		}
	}
	for(int k=1;k<=4;k++){
		for(int i=1;i<=ans;i++){
			cout<<c[a[i].x][a[i].y];
		}
		for(int i=1;i<=ans;i++){
			int hh=a[i].y;
			a[i].y=n+1-a[i].x;
			a[i].x=hh;
			
		}
		sort(a+1,a+1+ans,xxx);	
	}
	return 0;
}
//P2191

2024/6/27 15:30
加载中...