結果

問題 No.459 C-VS for yukicoder
ユーザー hirokazu1020
提出日時 2016-12-10 02:24:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 1,295 bytes
コンパイル時間 1,041 ms
コンパイル使用メモリ 104,284 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-28 21:16:53
合計ジャッジ時間 5,040 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 55 RE * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include<sstream>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<ctime>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())


int h, w, n;
int nb[10000];
int ans[10000][3];


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

	cin >> h >> w >> n;
	rep(i,h) {
		string s;
		cin >> s;
		rep(j,w) {
			if (s[j] == '#')nb[j]++;
		}
	}
	vector<pair<int, int>> pos;
	rep(i,n) {
		int c;
		cin >> c;
		pos.emplace_back(c, i);
	}
	sort(all(pos));
	for (auto p : pos) {
		rep(x,3) {
			if (nb[p.first + x]) {
				nb[p.first + x]--;
				ans[p.second][x]++;
				break;
			}
		}
	}
	for (auto p : pos) {
		rep(x, 3) {
			while (ans[p.second][x] < 3 && nb[p.first + x]) {
				nb[p.first + x]--;
				ans[p.second][x]++;
			}
		}
	}
	rep(i,n) {
		rep(y,3) {
			rep(x,3) {
				cout << (ans[i][x] > y ? '#' : '.');
			}
			cout << endl;
		}
	}

	

	return 0;
}
0