結果

問題 No.82 市松模様
ユーザー 👑 p-adic
提出日時 2022-08-08 14:32:32
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 598 bytes
コンパイル時間 783 ms
コンパイル使用メモリ 72,944 KB
最終ジャッジ日時 2025-01-30 19:25:47
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <list>
#include <vector>
#include <string>
#include <stdio.h>
#include <stdint.h>
using namespace std;

using uint = unsigned int;
using ll = long long;

#define CIN( LL , A ) LL A; cin >> A 

int main()
{

  CIN( ll , W );
  CIN( ll , H );
  CIN( string , C );
  const string color[2] = { "B" , "W" };
  ll start_num = C == color[0] ? 0 : 1;
  ll num;
  
  for( ll i = 0 ; i < H ; i++ ){

    num = start_num;
    
    for( ll j = 0 ; j < W ; j++ ){

      cout << color[ num % 2 ];
      num++;

    }

    cout << endl;
    start_num++;
    
  }
    
  return 0;

}
0