結果
| 問題 | No.883 ぬりえ |
| コンテスト | |
| ユーザー |
leaf_1415
|
| 提出日時 | 2019-09-13 21:28:11 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 536 bytes |
| 記録 | |
| コンパイル時間 | 1,677 ms |
| コンパイル使用メモリ | 55,072 KB |
| 実行使用メモリ | 7,336 KB |
| 最終ジャッジ日時 | 2024-07-04 03:58:23 |
| 合計ジャッジ時間 | 2,698 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 WA * 9 |
ソースコード
#include <iostream>
using namespace std;
int n, k;
int ans[1005][1005];
int main(void)
{
ios::sync_with_stdio(0);
cin.tie(0);
cin >> n >> k;
int m = (n+k-1)/k;
int rem = n, x = 0, y = 0;
while(1){
for(int i = 0; i < k; i++){
for(int j = 0; j < k; j++){
if(rem == 0) goto end;
ans[x+i][y+j] = 1;
rem--;
}
}
x += k, y += k;
}
end:;
cout << m << endl;
for(int i = 0; i < m; i++){
for(int j = 0; j < m; j++){
if(ans[i][j]) cout << "#";
else cout << ".";
}
cout << endl;
}
return 0;
}
leaf_1415