結果

問題 No.883 ぬりえ
ユーザー ganariyaganariya
提出日時 2019-09-13 21:35:35
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,778 bytes
コンパイル時間 1,438 ms
コンパイル使用メモリ 143,840 KB
実行使用メモリ 4,568 KB
最終ジャッジ日時 2023-09-17 07:00:19
合計ジャッジ時間 4,779 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <climits>
#include <set>
#include <unordered_set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>
#include <locale>
#include <random>
#include <type_traits>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}

using LL = long long;

//------------------------------------------
//------------------------------------------


int main() {

    int N, K;
    cin >> N >> K;

    for (int i = 1; i <= 100000; i++) {
        int d = i * K;
        if (d >= N) {

            vector<vector<char>> ans(i, vector<char>(i, '.'));
           // for (int j = 0; j < i; j++) SHOW_VECTOR(ans[j]);

            for (int j = 0; j < i; j++) {
                for (int k = 0; k < K; k++) {
                    if (N > 0) {
                        ans[j][(j + k) % i] = '#';
                        N--;
                    }
                }
            }

            for (int j = 0; j < i; j++) {
                for (int k = 0; k < i; k++) cout << ans[j][k];
                cout << endl;
            }

            return 0;
        }
    }


    return 0;
}





































0