結果
| 問題 |
No.459 C-VS for yukicoder
|
| コンテスト | |
| ユーザー |
hirokazu1020
|
| 提出日時 | 2016-12-10 02:27:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 125 ms / 2,000 ms |
| コード長 | 1,296 bytes |
| コンパイル時間 | 914 ms |
| コンパイル使用メモリ | 102,628 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-28 21:16:57 |
| 合計ジャッジ時間 | 4,186 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 58 |
ソースコード
#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[30000][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;
}
hirokazu1020