QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#49272#2540. Build The GridBovmeloWA 0ms3520kbC++20739b2022-09-19 21:24:542022-09-19 21:24:56

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 21:24:56]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3520kb
  • [2022-09-19 21:24:54]
  • 提交

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,k=n-1;i<n;i+=2)
   {
      for(int j=0;j<k;j++)
         a[i][j]=a[i+j][k]=1;
      k-=2;
   }
   for(auto i:a)
   {
      for(auto j:i) cout<<(j?'B':'W');
      cout<<"\n";
   }
   return 0;
}

詳細信息

Test #1:

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

input:

3

output:

BBB
WWB
WWW

result:

wrong answer there are no white cells around a black cell