結果

問題 No.459 C-VS for yukicoder
ユーザー vjudge1
提出日時 2025-06-20 16:53:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,060 bytes
コンパイル時間 1,498 ms
コンパイル使用メモリ 166,304 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2025-06-20 16:53:33
合計ジャッジ時間 7,514 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long

const int N = 30010;

int h, w, n, res[N][3];
vector<vector<char> > a;
vector<pair<int, int> > ha[N];

signed main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> h >> w >> n;
	a.resize(h);
	for (int i = 0; i < h; i ++ )
	{
		a[i].resize(w);
		for (int j = 0; j < w; j ++ )
			cin >> a[i][j];
	}
	for (int i = 1, x; i <= n; i ++ )
	{
		cin >> x;
		ha[x].push_back({i, 0});
		ha[x + 1].push_back({i, 1});
		ha[x + 2].push_back({i, 2});
	}
	for (int i = 0; i < w; i ++ )
	{
		int s = ha[i].size();
		if (s == 0) continue;
		int tot = 0;
		for (int j = 0; j < h; j ++ ) tot += a[j][i] != '.';
		for (int j = 0; j < tot % s; j ++ ) 
			res[ha[i][j].first][ha[i][j].second] = tot / s + 1;
		for (int j = tot % s; j < s; j ++ )
			res[ha[i][j].first][ha[i][j].second] = tot / s;
	}
	for (int i = 1; i <= n; i ++ , cout << "\n")
		for (int x = 0; x < 3; x ++ , cout << "\n")
			for (int y = 0; y < 3; y ++ )
				if (x <= res[i][y] - 1) cout << '#';
				else cout << ".";
	return 0;
}
0