QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#585350 | #9114. Black or White 2 | yhddd | WA | 157ms | 3904kb | C++20 | 1.1kb | 2024-09-23 20:28:18 | 2024-09-23 20:28:19 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
#define mod 998244353ll
#define pii pair<int,int>
#define fi first
#define se second
#define mems(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define db double
using namespace std;
const int maxn=1510;
const int inf=1e18;
inline int read(){
int x=0,f=1;
char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+(ch-48);ch=getchar();}
return x*f;
}
bool Mbe;
int n,m,k;
int ans[maxn][maxn];
void work(){
n=read();m=read();k=read();
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++)ans[i][j]=0;
}
for(int j=1;j<=m;j+=2)if(k)ans[1][j]=1,k--;
for(int i=2;i<=n;i++){
for(int j=2-(i&1);j<=m;j+=2){
if(k>=2)ans[i][j]=ans[i-1][j]=1,k-=2;
}
}
if(k)ans[n][m]=1;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++)printf("%lld",ans[i][j]);puts("");
}
}
// \
444
bool Med;
int T;
signed main(){
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
// ios::sync_with_stdio(0);
// cin.tie(0);cout.tie(0);
// cerr<<(&Mbe-&Med)/1048576.0<<" MB\n";
T=read();
while(T--)work();
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3740kb
input:
2 2 2 2 2 3 0
output:
10 01 000 000
result:
ok Output is valid. OK.
Test #2:
score: -100
Wrong Answer
time: 157ms
memory: 3904kb
input:
27520 2 2 0 2 2 1 2 2 2 2 2 3 2 2 4 2 3 0 2 3 1 2 3 2 2 3 3 2 3 4 2 3 5 2 3 6 3 2 0 3 2 1 3 2 2 3 2 3 3 2 4 3 2 5 3 2 6 3 3 0 3 3 1 3 3 2 3 3 3 3 3 4 3 3 5 3 3 6 3 3 7 3 3 8 3 3 9 2 4 0 2 4 1 2 4 2 2 4 3 2 4 4 2 4 5 2 4 6 2 4 7 2 4 8 3 4 0 3 4 1 3 4 2 3 4 3 3 4 4 3 4 5 3 4 6 3 4 7 3 4 8 3 4 9 3 4 10...
output:
00 00 10 00 10 01 11 01 11 01 000 000 100 000 101 000 101 001 111 010 111 011 111 011 00 00 00 10 00 00 10 00 01 11 01 00 11 01 01 11 11 10 11 11 11 000 000 000 100 000 000 101 000 000 101 000 001 111 010 000 111 010 001 111 110 100 111 110 101 111 111 101 111 111 101 0000 0000 1000 0000 1010 0000 1...
result:
wrong answer The number of black cell is not K