結果
問題 |
No.883 ぬりえ
|
ユーザー |
👑 ![]() |
提出日時 | 2020-10-24 10:24:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 41 ms / 2,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 1,787 ms |
コンパイル使用メモリ | 167,056 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-21 14:59:27 |
合計ジャッジ時間 | 2,788 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 19 |
ソースコード
#include<bits/stdc++.h> using namespace std; using LL = long long; using ULL = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int main() { int N, K; cin >> N >> K; int R = (N - 1) / K + 1; while (R * R < N) R++; cout << R << endl; rep(y, R) { rep(x, R) { bool black = false; if ((x + y) % R < K) if (N != 0) { N--; black = true; } cout << (black ? "#" : "."); } cout << endl; } return 0; }