QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#49262 | #2540. Build The Grid | Bovmelo | WA | 2ms | 3624kb | C++20 | 775b | 2022-09-19 20:59:14 | 2022-09-19 20:59:16 |
Judging History
answer
// Nothing is Given, Everything is Earned.
#include<bits/stdc++.h>
using namespace std;
template<class T> constexpr auto vec(int sz=0,auto ...dim)
{
if constexpr(sizeof...(dim)==0) return move(vector<T>(sz));
else return move(vector(sz,vec<T>(dim...)));
}
template<auto val> constexpr auto vec(int sz=0,auto ...dim)
{
if constexpr(sizeof...(dim)==0) return move(vector(sz,val));
else return move(vector(sz,vec<val>(dim...)));
}
int main()
{
int n; cin>>n;
auto a=vec<int>(n,n);
for(int i=0;i<n-2;i++)
{
a[i][1]=1;
for(int j=n-2;j>n-i-2;j--)
a[i][j]=1;
}
for(int i=0;i<n-1;i++) a[n-1][i]=1;
for(auto i:a)
{
for(auto j:i) cout<<(j?'B':'W');
cout<<"\n";
}
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3612kb
input:
3
output:
WBW WWW BBW
result:
ok accepted
Test #2:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
2
output:
WW BW
result:
ok accepted
Test #3:
score: 0
Accepted
time: 2ms
memory: 3624kb
input:
4
output:
WBWW WBBW WWWW BBBW
result:
ok accepted
Test #4:
score: 0
Accepted
time: 2ms
memory: 3588kb
input:
5
output:
WBWWW WBWBW WBBBW WWWWW BBBBW
result:
ok accepted
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3524kb
input:
7
output:
WBWWWWW WBWWWBW WBWWBBW WBWBBBW WBBBBBW WWWWWWW BBBBBBW
result:
wrong answer there are no white cells around a black cell