結果

問題 No.883 ぬりえ
ユーザー okok
提出日時 2019-09-13 22:28:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,380 bytes
コンパイル時間 773 ms
コンパイル使用メモリ 84,108 KB
実行使用メモリ 12,676 KB
最終ジャッジ日時 2023-09-17 14:48:12
合計ジャッジ時間 3,248 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 9 ms
12,460 KB
testcase_01 AC 9 ms
12,376 KB
testcase_02 AC 9 ms
12,544 KB
testcase_03 AC 9 ms
12,456 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 10 ms
12,480 KB
testcase_07 AC 9 ms
12,404 KB
testcase_08 AC 9 ms
12,476 KB
testcase_09 AC 9 ms
12,592 KB
testcase_10 WA -
testcase_11 AC 9 ms
12,360 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 33 ms
12,456 KB
testcase_16 AC 15 ms
12,356 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 9 ms
12,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<cassert>

using namespace std;

#define int long long
#define endl "\n"

const long long INF = (long long)1e18;
const long long MOD = 1'000'000'007; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}


int N, K;

bool check(int num){
	
	// cout<<num <<" "<<min(K,num)*num <<endl;
	
	if(min(K,num)*num < N) return false;
	
	return true;
}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	const int MAX = 1100;
	int con = 0, M = 0;
	vector<vector<int>> ans(MAX, vector<int>(MAX, false));
	vector<int> conh(MAX), conw(MAX);
	
	cin>>N>>K;
	
	for(int i = 1; ; i++){
		if(check(i)){
			M = i;
			break;
		}
	}
	for(int i = 0; i < M; i++){
		for(int j = 0; j < K && j < M; j++){
			ans[i][(i+j)%M] = true;
		}
	}
	
	cout<<M<<endl;
	
	for(int i = 0; i < M; i++){
		for(int j = 0; j < M; j++){
			cout<<(ans[i][j]?"#":".");
		}
		cout<<endl;
	}
	
	return 0;
}
/*
##...
##...
..##.
..##.
....#

#.....
.#....
..#...
...#..
....#.
.....#

##....
.##...
..##..
...##.
....##

##....
.##...
..##..
...##.
....##
#....#

###....
.###...
..###..
...###.
....###
#....##
##....#

######..
.######.
..######

###
###
###


###....
###....
###....
...###.
...###.
...###.
......#


###...
###...
###...

*/
0