結果
| 問題 |
No.455 冬の大三角
|
| コンテスト | |
| ユーザー |
kurenai3110
|
| 提出日時 | 2016-12-06 17:15:15 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 815 bytes |
| コンパイル時間 | 829 ms |
| コンパイル使用メモリ | 71,360 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-29 21:15:40 |
| 合計ジャッジ時間 | 2,775 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 54 |
ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
int main()
{
int h, w; cin >> h >> w;
vector<string>sky(h);
for (int i = 0; i < h; i++){
cin >> sky[i];
}
vector<pair<int, int>>star;
for (int i = 0; i < h; i++)for (int j = 0; j < w; j++){
if (sky[i][j] == '*'){
star.push_back(make_pair(i,j));
}
}
if (star[0].first == star[1].first){
for (int i = 0; i < h; i++){
if (i != star[0].first){
sky[i][star[0].second] = '*';
break;
}
}
}
else if (star[0].second == star[1].second){
for (int i = 0; i < h; i++){
if (i != star[0].second){
sky[star[0].first][i] = '*';
break;
}
}
}
else{
sky[star[0].first][star[1].second] = '*';
}
for (int i = 0; i < h; i++)cout << sky[i] << endl;
return 0;
}
kurenai3110