結果

問題 No.3556 KCPC or KUPC
コンテスト
ユーザー jastaway
提出日時 2026-05-26 00:01:24
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
RE  
実行時間 -
コード長 1,247 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,587 ms
コンパイル使用メモリ 443,548 KB
実行使用メモリ 7,972 KB
最終ジャッジ日時 2026-05-29 18:41:00
合計ジャッジ時間 11,707 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
サブタスク 配点 結果
部分点1 5 % AC * 2
部分点2 5 % AC * 2
部分点3 5 % AC * 2
部分点4 5 % AC * 2
部分点5 5 % AC * 2
部分点6 6 % AC * 2
部分点7 7 % AC * 2
部分点8 8 % AC * 2
部分点9 9 % AC * 2
部分点10 10 % RE * 2
部分点11 5 % AC * 9 RE * 1
部分点12 5 % AC * 9 RE * 1
部分点13 25 % AC * 18 RE * 2
合計 55 点
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include "testlib.h"
#include <bits/stdc++.h>
using namespace std;
 
const int MAX_Y = 1'000'000'000;
const int MAX_N = 100;
const int MAX_A = 10'000'000;

const vector<string> kcpc = {
"#...#.#####",
"#.##..#....",
"##....#....",
"#.##..#....",
"#...#.#####",
"...........",
"####..#####",
"#...#.#....",
"####..#....",
"#.....#....",
"#.....#####"
};
const vector<string> kupc = {
"#...#.#...#",
"#.##..#...#",
"##....#...#",
"#.##..#...#",
"#...#.#####",
"...........",
"####..#####",
"#...#.#....",
"####..#....",
"#.....#....",
"#.....#####"
};

int main(int argc, char* argv[]) {
    registerValidation(argc, argv);
    int N = inf.readInt(11, MAX_N, "N");
    inf.ensuref(N%11 == 0, "invalid N");
    int k = N/11;
    inf.readEoln();
    vector<string> S(N);
    for(int i = 0; i < N; i++)
    {
        S[i] = inf.readString(format("[.#]{%d, %d}", N, N), "S_"+to_string(i));
    }
    inf.readEof();
    bool iskcpc = true, iskupc = true;
    for(int i = 0; i < N; i++) for(int j = 0; j < N; j++)
    {
        if(S[i][j] != kcpc[i/k][j/k]) iskcpc = false;
        if(S[i][j] != kupc[i/k][j/k]) iskupc = false;
    }
    inf.ensuref(iskcpc || iskupc, "invalid S");
    if(iskcpc) cout << "KCPC" << endl;
    else cout << "KUPC" << endl;
}
0