結果

問題 No.883 ぬりえ
ユーザー Imperi_NightImperi_Night
提出日時 2019-09-13 22:00:50
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,004 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 94,724 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-17 07:15:39
合計ジャッジ時間 2,687 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 WA -
testcase_15 AC 22 ms
4,380 KB
testcase_16 AC 7 ms
4,380 KB
testcase_17 AC 4 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 WA -
testcase_20 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using ll = long long;
using P = std::pair<ll, ll>;

#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug "<< i << std::endl

// const ll MOD = 998244353;
const ll MOD = 1e9 + 7;

int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);
  //問題文中の添え字が0-indexか1-indexか確認!

  ll n,k;
  std::cin>>n>>k;

  ll row=n/k+((n%k==0)?0:1);

  std::cout<<row<<"\n";

  ll cnt=0;

  rep(i,0,row){
    rep(j,0,row){
      if(((i+j)%row<k)&&(cnt<n)){
        std::cout<<'#';
        cnt++;
      }else{
        std::cout<<'.';
      }
    }
    std::cout<<"\n";
  }

  return 0;
}
0