結果

問題 No.455 冬の大三角
ユーザー fura
提出日時 2020-04-14 23:07:24
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 425 bytes
コンパイル時間 2,443 ms
コンパイル使用メモリ 194,600 KB
最終ジャッジ日時 2025-01-09 19:09:45
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 54
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int h,w; cin>>h>>w;
	string B[100];
	rep(i,h) cin>>B[i];

	vector<int> x,y;
	rep(i,h) rep(j,w) if(B[i][j]=='*') {
		x.emplace_back(j);
		y.emplace_back(i);
	}

	int x3,y3;
	if(y[0]==y[1]){
		x3=x[0];
		y3=(y[0]==0?1:0);
	}
	else{
		x3=(x[0]==0?1:0);
		y3=y[0];
	}
	B[y3][x3]='*';

	rep(i,h) cout<<B[i]<<'\n';

	return 0;
}
0