結果
問題 | No.455 冬の大三角 |
ユーザー |
![]() |
提出日時 | 2024-02-24 14:52:55 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 998 bytes |
コンパイル時間 | 5,224 ms |
コンパイル使用メモリ | 313,900 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-09-29 10:02:03 |
合計ジャッジ時間 | 8,012 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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;#endifint 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;}