結果
| 問題 |
No.883 ぬりえ
|
| コンテスト | |
| ユーザー |
Imperi_Night
|
| 提出日時 | 2019-09-13 22:00:50 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,004 bytes |
| コンパイル時間 | 812 ms |
| コンパイル使用メモリ | 95,328 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-04 04:14:56 |
| 合計ジャッジ時間 | 2,254 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 14 WA * 5 |
ソースコード
#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using ll = long long;
using P = std::pair<ll, ll>;
#define rep(i, a, b) for (ll(i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug "<< i << std::endl
// const ll MOD = 998244353;
const ll MOD = 1e9 + 7;
int main() {
std::cin.tie(0);
std::ios::sync_with_stdio(false);
//問題文中の添え字が0-indexか1-indexか確認!
ll n,k;
std::cin>>n>>k;
ll row=n/k+((n%k==0)?0:1);
std::cout<<row<<"\n";
ll cnt=0;
rep(i,0,row){
rep(j,0,row){
if(((i+j)%row<k)&&(cnt<n)){
std::cout<<'#';
cnt++;
}else{
std::cout<<'.';
}
}
std::cout<<"\n";
}
return 0;
}
Imperi_Night