QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#784573 | #9802. Light Up the Grid | yuanyi# | WA | 0ms | 3612kb | C++20 | 1.7kb | 2024-11-26 15:22:49 | 2024-11-26 15:22:49 |
Judging History
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;
}
Details
Tip: Click on the bar to expand more detailed information
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