結果
問題 |
No.883 ぬりえ
|
ユーザー |
![]() |
提出日時 | 2019-09-13 21:30:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 608 bytes |
コンパイル時間 | 660 ms |
コンパイル使用メモリ | 73,332 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-04 03:59:03 |
合計ジャッジ時間 | 2,093 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 5 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <algorithm> #include <cstdio> #include <cstring> #include <cmath> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; int m = (n + k - 1) / k; cout << m << '\n'; for (int i = 0; i < m; i++) { for (int j = 0; j < m; j++) { if ((i + j) % m < k && n > 0) { cout << '#'; n--; } else { cout << '.'; } } cout << '\n'; } return 0; }