結果

問題 No.883 ぬりえ
ユーザー 438kujira438kujira
提出日時 2019-10-03 23:23:56
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 855 bytes
コンパイル時間 1,557 ms
コンパイル使用メモリ 167,316 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-03 06:44:50
合計ジャッジ時間 2,880 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
    ll cnt = 0;
    for(int i = 0; i < m; i++){
        for(int j = 0; j < m; j++){
            if(i/k*k <= j && j < i/k*k+k && cnt < n){
                cout << "#";
                cnt++;
            }else{
                cout << ".";
            }
        }
        cout << endl;
    }

    return 0;
}
0