.

1 条评论

  • @ 2026-8-18 17:31:56
    #include<bits/stdc++.h>
    using namespace std;
    int a[1145140],b[14][14];
    int main(){
    	int n,m;cin>>n>>m;
    	for(int i=1;i<=n*m;i++) cin>>a[i];
    	sort(a, a+n*m);
    	for(int i=1;i<=n;i++){
    		if(i%2==1){
    			for(int j=1;j<=m;j++){
    				cout<<i<<j<<"\n";		
    			}
    		}else if(i%2==0){
    			for(int j=m;j>=1;j--){
    				cout<<i<<j<<"\n";		
    			}
    		}
    	}
    } 
    
    • 1