結果
| 問題 | No.883 ぬりえ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-09-13 22:24:46 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 978 bytes |
| 記録 | |
| コンパイル時間 | 1,542 ms |
| コンパイル使用メモリ | 167,092 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-04 09:58:20 |
| 合計ジャッジ時間 | 3,143 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;
const int INF = 1000000001;
int main() {
int n, k;
cin >> n >> k;
int x = (n + k - 1) / k;
cout << x << endl;
int z = 0;
int c = 0;
REP(i, x) {
REP(j, x) {
if (c < n && j >= z && j < z + k) {
cout << "#";
c++;
} else if (c < n && i >= x - (k - 1) && j < k - (x - i)) {
cout << "#";
c++;
} else {
cout << ".";
}
}
cout << endl;
z++;
}
}