結果

問題 No.3731 Kaleidoscope
コンテスト
ユーザー hiro1729
提出日時 2026-09-19 14:23:14
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
+ 567µs
コード長 976 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,117 ms
コンパイル使用メモリ 334,540 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-19 14:23:25
合計ジャッジ時間 5,949 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
	ios::sync_with_stdio(false); cin.tie(nullptr);

	string S; cin >> S;
	int L = S.size(), N = 512;
	cout << N * 2 << '\n';
	vector<string> g(N * 2, string(N * 2, '#'));
	for (int i = 0; i < N * 2; i++) g[0][i] = '.';
	for (int i = 0; i < N * 2; i++) g[N * 2 - 1][i] = '.';
	for (int j = 2; j < N * 2; j++) {
		g[j][N - 1] = '.';
		g[j][2 * N - 1] = '.';
	}
	for (int j = 1; j < N - 5; j++) {
		g[j * 2 - 2][j] = '.';
		g[j * 2 - 1][j] = '.';
		g[j * 2][j] = '.';
		g[j * 2 - 2][j + N] = '.';
		g[j * 2 - 1][j + N] = '.';
		g[j * 2][j + N] = '.';
	}
	if (S[0] == 'o') g[1][N * 2 - 1] = '.';
	if (L > 1 && S[1] == 'o') g[1][N - 1] = '.';
	for (int i = 2; i < L; i++) {
		if (S[i] == 'o') {
			if (i % 2 == 0) {
				for (int j = N + 1; j < 2 * N; j++) g[i][j] = '.';
			} else {
				for (int j = 1; j < N; j++) g[i - 1][j] = '.';
			}
		}
	}
	for (int i = 0; i < N * 2; i++) cout << g[i] << '\n';
}
0