QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#784573#9802. Light Up the Gridyuanyi#WA 0ms3612kbC++201.7kb2024-11-26 15:22:492024-11-26 15:22:49

Judging History

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

  • [2024-11-26 15:22:49]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2024-11-26 15:22:49]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define ull unsigned long long
#define endl '\n'
const int N=1e5+7;
const int M=2e5+7;
const int mod=998244353;

void solve(){
    int n,m;
    cin>>n>>m;

    if(n==1&&m==1){
        cout<<"Yes"<<endl;
        cout<<"0"<<endl;
        cout<<"0"<<endl;
        //return ;
    }
    else if(n==1||m==1){
        cout<<"Yes"<<endl;
        if(n==1){
            cout<<"1"<<endl;
            for(int i=0;i<m;i++){
                cout<<i<<" ";
            }
            cout<<endl;
        }
        else{
            for(int i=0;i<n;i++){
                cout<<i<<" ";
            }
            cout<<endl;
            cout<<"1"<<endl;
        }
    }
    else if(n==2||m==2){
        if(n==2){
            if(m%2==1){
                cout<<"Yes"<<endl;
                cout<<"1 2"<<endl;
                for(int i=1;i<=n*m-1;i++){
                    if(i%2==1) cout<<i<<" ";
                }
                cout<<endl;
            }
            else{
                cout<<"No"<<endl;
            }
        }
        else{
            if(n%2==1){
                cout<<"Yes"<<endl;

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

}



signed main(){
    ios::sync_with_stdio(false);
    std::cin.tie(0);
    cout.tie(0);
    int T=1;
    cin>>T;

    while(T--){
        solve();
    }

    return 0;
}

詳細信息

Test #1:

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

input:

2 1000 100 10 1
4
10
00

01
00

00
10

00
01
1
11
11

output:

No
Yes
0 1 2 3 4 5 6 7 8 9 
1

result:

wrong output format Expected integer, but "No" found