#2出错求条
查看原帖
#2出错求条
1199534
ycy1124楼主2025/1/15 11:33

自己拍了几下好像没问题,求hack数据或指错qwq

#include<bits/stdc++.h>
using namespace std;
char ch[2]={'.','@'};
int n,m;
int main(){
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    int n,m;
    cin>>n>>m;
    if(n==m){
        cout<<m<<' '<<1<<'\n';
        for(int i=1;i<=m;i++){
            cout<<ch[0]<<'\n';
            cout<<ch[1]<<'\n';
        }
        return 0;
    }
    if(m>n){
        swap(n,m);
        swap(ch[0],ch[1]);
    }
    cout<<(n-m)/2*2+m*2<<' '<<3<<'\n';
    int w=n-m+1;
    while(w){
        if(w>=2){
            cout<<ch[1]<<ch[0]<<ch[1]<<'\n';
            cout<<ch[0]<<ch[0]<<ch[0]<<'\n';    
            w-=2;
        }
        else{
            cout<<ch[1]<<ch[0]<<ch[0]<<'\n';
            cout<<ch[0]<<ch[0]<<ch[0]<<'\n';
            w--;
        }
    }
    for(int i=1;i<=m-1;i++){
        cout<<ch[1]<<ch[1]<<ch[1]<<'\n';
        cout<<ch[0]<<ch[0]<<ch[0]<<'\n';
    }
    return 0;
}
2025/1/15 11:33
加载中...