結果

問題 No.455 冬の大三角
ユーザー evawenis
提出日時 2020-08-18 19:52:57
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 2,186 ms
コンパイル使用メモリ 196,876 KB
最終ジャッジ日時 2025-01-13 03:25:20
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 42 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int h,w; cin>>h>>w;
	vector<string>s(h); for(auto&&i:s)cin>>i;
	vector<int>H(h,0),W(w,0);
	for(int y=0;y<h;++y){
		for(int x=0;x<w;++x){
			if(s.at(y).at(x)=='*'){
				++H.at(y),++W.at(x);
			}
		}
	}
	for(int y=0;y<h;++y){
		for(int x=0;x<w;++x){
			if(H.at(y)||W.at(x))continue;
			s.at(y).at(x)='*';
			for(auto&&i:s){
				for(auto&&j:i){
					cout<<j;
				}
				cout<<"\n"s;
			}
			return 0;
		}
	}
}
0