結果
問題 | No.459 C-VS for yukicoder |
ユーザー |
|
提出日時 | 2025-06-22 14:55:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 1,633 bytes |
コンパイル時間 | 2,150 ms |
コンパイル使用メモリ | 201,668 KB |
実行使用メモリ | 18,544 KB |
最終ジャッジ日時 | 2025-06-22 14:55:54 |
合計ジャッジ時間 | 6,491 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 58 |
ソースコード
#include<bits/stdc++.h> #define lowbit(x) x & (-x) #define pi pair<ll, ll> #define ls(k) k << 1 #define rs(k) k << 1 | 1 #define fi first #define se second using namespace std; typedef __int128 __; typedef long double lb; typedef double db; typedef unsigned long long ull; typedef long long ll; const int N = 4e5 + 10; inline ll read(){ ll x = 0, f = 1; char c = getchar(); while(c < '0' || c > '9'){ if(c == '-') f = -1; c = getchar(); } while(c >= '0' && c <= '9'){ x = (x << 1) + (x << 3) + (c ^ 48); c = getchar(); } return x * f; } inline void write(ll x){ if(x < 0){ putchar('-'); x = -x; } if(x > 9) write(x / 10); putchar(x % 10 + '0'); } int n, m, q; string S; int h[N], c[N], a[N][3]; vector<int> V[N]; queue<int> Q[5]; int main() { n = read(), m = read(), q = read(); for(int i = 0; i < n; ++i){ cin >> S; for(int j = 0; j < m; ++j) h[j] += (S[j] == '#'); } for(int i = 0; i < q; ++i){ c[i] = read(); V[c[i]].push_back(i); } for(int x = 0; x < m; ++x){ for(int i = 2; i <= 4; ++i){ while(Q[i].size()){ Q[1].push(Q[i].front()); Q[i].pop(); } } for(auto v : V[x]) Q[0].push(v); for(int i = 0; i <= 3; ++i){ while(h[x] && Q[i].size()){ int y = Q[i].front(); Q[i].pop(); if(x >= c[y] + 3) continue; --h[x]; ++a[y][x - c[y]]; Q[i + 1 + (!i)].push(y); } } } for(int i = 0; i < q; ++i){ for(int j = 0; j < 3; ++j){ string ans = "..."; for(int x = 0; x < 3; ++x) if(a[i][x] > j) ans[x] = '#'; printf("%s\n", ans.c_str()); } } return 0; }