結果
| 問題 |
No.455 冬の大三角
|
| コンテスト | |
| ユーザー |
anta
|
| 提出日時 | 2016-12-06 00:04:53 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,017 bytes |
| コンパイル時間 | 1,611 ms |
| コンパイル使用メモリ | 171,288 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-06-29 20:58:44 |
| 合計ジャッジ時間 | 3,037 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
static const int INF = 0x3f3f3f3f; static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
template<typename T, typename U> static void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> static void amax(T &x, U y) { if(x < y) x = y; }
int main() {
int H, W;
cin >> H >> W;
vector<string> S(H);
rep(i, H) cin >> S[i];
vector<int> ys, xs;
rep(i, H) rep(j, W) if(S[i][j] == '*') {
ys.push_back(i);
xs.push_back(j);
}
if(ys[0] != ys[1]) {
int i = ys[0];
rep(j, W) if(S[i][j] == '-') {
S[i][j] = '*';
break;
}
} else {
int j = xs[0];
rep(i, H) if(S[i][j] == '-') {
S[i][j] = '*';
break;
}
}
rep(i, H)
puts(S[i].c_str());
return 0;
}
anta