QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#49261#2540. Build The GridBovmeloWA 2ms3680kbC++20754b2022-09-19 20:55:352022-09-19 20:55:37

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-09-19 20:55:37]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3680kb
  • [2022-09-19 20:55:35]
  • 提交

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++)
   {
      for(int j=1;j<=i+1;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: 1ms
memory: 3584kb

input:

3

output:

WBW
WWW
BBW

result:

ok accepted

Test #2:

score: 0
Accepted
time: 2ms
memory: 3588kb

input:

2

output:

WW
BW

result:

ok accepted

Test #3:

score: 0
Accepted
time: 2ms
memory: 3596kb

input:

4

output:

WBWW
WBBW
WWWW
BBBW

result:

ok accepted

Test #4:

score: 0
Accepted
time: 0ms
memory: 3680kb

input:

5

output:

WBWWW
WBBWW
WBBBW
WWWWW
BBBBW

result:

ok accepted

Test #5:

score: -100
Wrong Answer
time: 2ms
memory: 3588kb

input:

7

output:

WBWWWWW
WBBWWWW
WBBBWWW
WBBBBWW
WBBBBBW
WWWWWWW
BBBBBBW

result:

wrong answer there are no white cells around a black cell