結果
問題 |
No.455 冬の大三角
|
ユーザー |
![]() |
提出日時 | 2024-02-24 14:52:15 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 998 bytes |
コンパイル時間 | 4,568 ms |
コンパイル使用メモリ | 314,032 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-09-29 10:01:55 |
合計ジャッジ時間 | 6,665 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 53 WA * 1 |
ソースコード
#include <bits/stdc++.h> using namespace std; using namespace chrono; #if __has_include(<atcoder/all>) #include <atcoder/all> using namespace atcoder; #endif int main() { random_device rnd; mt19937 engine(rnd()); int64_t h, w; cin >> h >> w; vector<string> ss(h); for (auto &&s : ss) { cin >> s; } { uniform_int_distribution<> randh(0, h - 1), randw(0, w - 1); int64_t i = randh(engine); int64_t j = randw(engine); while (ss[i][j] == '*' || ranges::count(ss[i], '*') == 2 || [&] {int64_t ret = 0; for (int64_t k = 0; k < h; k++) { if (ss[k][j] == '*') { ret++; } } return ret; }() == 2) { i = randh(engine); j = randw(engine); } ss[i][j] = '*'; } for (auto &&s : ss) { cout << s << endl; } return 0; }