結果
| 問題 | No.883 ぬりえ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-10-03 23:22:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 805 bytes |
| コンパイル時間 | 1,502 ms |
| コンパイル使用メモリ | 167,608 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-03 06:44:34 |
| 合計ジャッジ時間 | 3,671 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 WA * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define LLINF 9223372036854775807
#define MOD ll(1e9+7)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cerr<<#x<<": "<<x<<endl
int main(){
ll n, k;
cin >> n >> k;
ll m = 0;
ll black = 0;
while(n > black){
for(int i = 1; i <= k; i++){
m++;
black += i*i-(i-1)*(i-1);
if(n <= black){
break;
}
}
}
cout << m << endl;
for(int i = 0; i < m; i++){
for(int j = 0; j < m; j++){
if(i/k*k <= j && j < i/k*k+k){
cout << "#";
}else{
cout << ".";
}
}
cout << endl;
}
return 0;
}