QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#424125#6743. water235HUY1#WA 0ms3604kbC++142.0kb2024-05-28 22:10:012024-05-28 22:10:03

Judging History

你现在查看的是最新测评结果

  • [2024-05-28 22:10:03]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3604kb
  • [2024-05-28 22:10:01]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=2e6+10;
ll n,m,q;
struct hy{
    ll x,id,sex;
}a[N];
bool cmp(hy x,hy y){
    return x.x>y.x;
}
void solve(){
    cin>>n>>m;
    ll jl=1;
    ll res;
    if(n>=m){
        for(int i=1;i<=n;i++){
                if(i==m){
                    if((i+2)<=n) res=0;
                    else res=1;
                }
            for(int j=1;j<=m;j++){
                if(i<=m){
                    if(j==i){cout<<1<<" ";}
                    else cout<<0<<" ";
                }
                else {
                    if((i-m)%2==res){
                        if(j==m) cout<<1<<" ";
                        else cout<<0<<" ";
                    }
                    else cout<<0<<" ";

                }
            }
            if((i-m)%2==res){
                if((i+2)<=n) res=0;
                else res=1;
            }
            cout<<endl;
        }
    }
    else if(n<m){
        for(int i=1;i<=n;i++){
            for(int j=1;j<=m;j++){
                if(i<n){
                    if(j==i) cout<<1<<" ";
                    else cout<<0<<" ";
                }
                else{
                    if(j==n){
                        if((j+2)<=m) res=0;
                        else res=1;
                    }
                    if(j<=n){
                        if(j==i) cout<<1<<" ";
                        else cout<<0<<" ";
                    }
                    else {
                        if((j-n)%2==res) {
                            cout<<1<<" ";
                            if((j+2)<=m) res=0;
                            else res=1;
                        }
                        else cout<<0<<" ";
                    }
                }
            }
            cout<<endl;
        }
    }

}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3604kb

input:

2 1

output:

1 
1 

result:

wrong output format Unexpected end of file - int32 expected