結果
問題 |
No.883 ぬりえ
|
ユーザー |
|
提出日時 | 2019-10-03 23:22:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 783 bytes |
コンパイル時間 | 1,568 ms |
コンパイル使用メモリ | 165,840 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-03 06:44:29 |
合計ジャッジ時間 | 5,072 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | WA * 19 |
ソースコード
#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; } } } 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; }