結果
問題 | No.459 C-VS for yukicoder |
ユーザー | satanic |
提出日時 | 2016-12-10 00:37:56 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 5,121 bytes |
コンパイル時間 | 1,536 ms |
コンパイル使用メモリ | 126,372 KB |
実行使用メモリ | 18,560 KB |
最終ジャッジ日時 | 2024-05-06 13:45:02 |
合計ジャッジ時間 | 10,534 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
6,816 KB |
testcase_01 | AC | 2 ms
6,940 KB |
testcase_02 | AC | 2 ms
6,944 KB |
testcase_03 | AC | 2 ms
6,940 KB |
testcase_04 | AC | 2 ms
6,940 KB |
testcase_05 | AC | 2 ms
6,940 KB |
testcase_06 | AC | 2 ms
6,944 KB |
testcase_07 | AC | 2 ms
6,944 KB |
testcase_08 | AC | 2 ms
6,944 KB |
testcase_09 | AC | 2 ms
6,944 KB |
testcase_10 | AC | 2 ms
6,940 KB |
testcase_11 | AC | 2 ms
6,940 KB |
testcase_12 | AC | 1 ms
6,940 KB |
testcase_13 | RE | - |
testcase_14 | RE | - |
testcase_15 | AC | 2 ms
6,940 KB |
testcase_16 | AC | 3 ms
6,940 KB |
testcase_17 | RE | - |
testcase_18 | AC | 2 ms
6,940 KB |
testcase_19 | RE | - |
testcase_20 | RE | - |
testcase_21 | AC | 31 ms
18,560 KB |
testcase_22 | AC | 14 ms
6,940 KB |
testcase_23 | AC | 15 ms
6,944 KB |
testcase_24 | AC | 21 ms
17,280 KB |
testcase_25 | AC | 18 ms
16,896 KB |
testcase_26 | AC | 5 ms
6,944 KB |
testcase_27 | AC | 4 ms
6,944 KB |
testcase_28 | AC | 16 ms
16,896 KB |
testcase_29 | AC | 7 ms
6,940 KB |
testcase_30 | AC | 4 ms
6,944 KB |
testcase_31 | RE | - |
testcase_32 | AC | 11 ms
11,904 KB |
testcase_33 | RE | - |
testcase_34 | AC | 13 ms
11,136 KB |
testcase_35 | AC | 9 ms
9,856 KB |
testcase_36 | AC | 6 ms
6,944 KB |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | RE | - |
testcase_41 | AC | 10 ms
10,240 KB |
testcase_42 | AC | 5 ms
6,940 KB |
testcase_43 | RE | - |
testcase_44 | RE | - |
testcase_45 | RE | - |
testcase_46 | RE | - |
testcase_47 | RE | - |
testcase_48 | RE | - |
testcase_49 | AC | 9 ms
10,752 KB |
testcase_50 | RE | - |
testcase_51 | AC | 9 ms
11,776 KB |
testcase_52 | RE | - |
testcase_53 | RE | - |
testcase_54 | RE | - |
testcase_55 | RE | - |
testcase_56 | RE | - |
testcase_57 | AC | 10 ms
12,544 KB |
testcase_58 | RE | - |
testcase_59 | RE | - |
testcase_60 | RE | - |
ソースコード
// need #include <iostream> #include <algorithm> // data structure #include <bitset> //#include <list> #include <map> #include <queue> #include <set> #include <stack> #include <string> #include <utility> #include <vector> //#include <array> //#include <tuple> #include <unordered_map> #include <unordered_set> //#include <complex> //#include <deque> // stream //#include <istream> //#include <sstream> //#include <ostream> // etc #include <cassert> #include <functional> #include <iomanip> //#include <typeinfo> //#include <chrono> #include <random> #include <cfenv> #define INIT std::ios::sync_with_stdio(false);std::cin.tie(0); #define VAR(type, ...)type __VA_ARGS__;Scan(__VA_ARGS__); template<typename T> void Scan(T& t) { std::cin >> t; } template<typename First, typename...Rest>void Scan(First& first, Rest&...rest) { std::cin >> first; Scan(rest...); } #define OUT(d) std::cout<<d; #define FOUT(n, d) std::cout<<std::fixed<<std::setprecision(n)<<d; #define SOUT(n, c, d) std::cout<<std::setw(n)<<std::setfill(c)<<d; #define SP std::cout<<" "; #define TAB std::cout<<"\t"; #define BR std::cout<<"\n"; #define ENDL std::cout<<std::endl; #define FLUSH std::cout<<std::flush; #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i; #define MAT(type, c, m, n) std::vector<std::vector<type>> c(m, std::vector<type>(n));for(auto& r:c)for(auto& i:r)std::cin>>i; #define ALL(a) (a).begin(),(a).end() #define FOR(i, a, b) for(int i=(a);i<(b);++i) #define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i) #define REP(i, n) for(int i=0;i<int(n);++i) #define RREP(i, n) for(int i=(n)-1;i>=0;--i) #define FORLL(i, a, b) for(ll i=ll(a);i<ll(b);++i) #define RFORLL(i, a, b) for(ll i=ll(b)-1;i>=ll(a);--i) #define REPLL(i, n) for(ll i=0;i<ll(n);++i) #define RREPLL(i, n) for(ll i=ll(n)-1;i>=0;--i) #define PAIR std::pair<int, int> #define PAIRLL std::pair<ll, ll> #define IN(a, x, b) (a<=x && x<b) #define SHOW(d) {std::cerr << #d << "\t:" << d << "\n";} #define SHOWVECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";} #define SHOWVECTOR2(v) {std::cerr << #v << "\t:\n";for(const auto& xxx : v){for(const auto& yyy : xxx){std::cerr << yyy << " ";}std::cerr << "\n";}} #define SHOWPAIR(p) {std::cerr << #p << "\t:(" << p.first << ",\t" << p.second << ")\n";} #define SHOWPAIRVECTOR2(v) {std::cerr << #v << "\t:\n";for(const auto& xxx : v){for(const auto& yyy : xxx){std::cerr<<'('<<yyy.first<<", "<<yyy.second<<") ";}std::cerr << "\n";}} #define SHOWPAIRVECTOR(v) {for(const auto& xxx:v){std::cerr<<'('<<xxx.first<<", "<<xxx.second<<") ";}std::cerr<<"\n";} #define SHOWQUEUE(a) {std::queue<decltype(a.front())> tmp(a);std::cerr << #a << "\t:";for(int i=0; i<static_cast<int>(a.size()); ++i){std::cerr << tmp.front() << "\n";tmp.pop();}std::cerr << "\n";} template<typename T> inline T CHMAX(T& a, const T b) { return a = (a < b) ? b : a; } template<typename T> inline T CHMIN(T& a, const T b) { return a = (a > b) ? b : a; } #define EXCEPTION(msg) throw std::string("Exception : " msg " [ in ") + __func__ + " : " + std::to_string(__LINE__) + " lines ]" #define TRY(cond, msg) try {if (cond) EXCEPTION(msg);}catch (std::string s) {std::cerr << s << std::endl;} //void CHECKTIME(std::function<void()> f) { auto start = std::chrono::system_clock::now(); f(); auto end = std::chrono::system_clock::now(); auto res = std::chrono::duration_cast<std::chrono::nanoseconds>((end - start)).count(); std::cerr << "[Time:" << res << "ns (" << res / (1.0e9) << "s)]\n"; } //#define int ll using ll = long long; using ull = unsigned long long; constexpr int INFINT = 1 << 30; // 1.07x10^ 9 constexpr int INFINT_LIM = (1LL << 31) - 1; // 2.15x10^ 9 constexpr ll INFLL = 1LL << 60; // 1.15x10^18 constexpr ll INFLL_LIM = (1LL << 62) - 1 + (1LL << 62); // 9.22x10^19 constexpr double EPS = 1e-9; constexpr int MOD = 1000000007; constexpr double PI = 3.141592653589793238462643383279; signed main() { INIT; VAR(int, h, w, n); MAT(char, s, h, w); VEC(int, c, n); std::vector<int> field(w, 0); REP(i, h) REP(j, w) { if (s[i][j] == '#') ++field[j]; } std::vector<std::queue<int>> block(w); std::vector<std::queue<int>> block2(w); std::vector<bool> flag(n, false); REP(i, n) { block[c[i]+0].push(i); block[c[i]+1].push(i); block[c[i]+2].push(i); } std::vector<std::vector<int>> res(n, std::vector<int>(3, 0)); REP(i, w) { while (field[i] > 0) { if (!block[i].empty()) { int t = block[i].front(); block[i].pop(); block2[i].push(t); if (flag[t]) { continue; } flag[t] = true; ++res[t][i - c[t]]; --field[i]; } else { int t = block2[i].front(); block2[i].pop(); block2[i].push(t); if (res[t][i - c[t]] > 3) continue; ++res[t][i - c[t]]; --field[i]; } } } REP(i, n) { int sum = 0; REP(j, 3) { assert(res[i][j] <= 3); sum += res[i][j]; } assert(sum > 0); } REP(k, n) { REP(i, 3) { REP(j, 3) { if (res[k][j] >= i + 1) { OUT('#'); } else { OUT('.'); } } BR; } } return 0; }