結果
問題 |
No.883 ぬりえ
|
ユーザー |
![]() |
提出日時 | 2019-09-13 22:11:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 589 bytes |
コンパイル時間 | 543 ms |
コンパイル使用メモリ | 66,380 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 09:49:44 |
合計ジャッジ時間 | 2,051 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 5 |
ソースコード
#include<cstdio> #include<cstdlib> #include<algorithm> #include<iostream> #include<queue> #include<vector> #include <bitset> #include<cmath> using namespace std; #define INF 110000000000 #define MOD 1000000007 typedef long long ll; typedef pair<ll,int> P; int main(){ int N,K,count=0; cin>>N>>K; cout<<(N+K-1)/K<<endl; int M=(N+K-1)/K; for(int i=0;i<M;i++){ for(int j=0;j<M;j++){ if(i<=j && j<i+K || j<(i+K)%M && i+K>M){ if(count<N){ cout<<"#"; count++; }else cout<<"."; }else cout<<"."; } cout<<endl; } }