結果

問題 No.455 冬の大三角
ユーザー taba
提出日時 2017-05-18 08:04:00
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 625 bytes
コンパイル時間 976 ms
コンパイル使用メモリ 112,504 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-18 18:36:10
合計ジャッジ時間 4,787 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 WA * 2 RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <random>
#include <vector>
#include <algorithm>
#include <array>
#include <functional>
#include <utility>
#include <regex>

using namespace std;
int main(){
	int h,w;
	-scanf("%d%d",&h,&w);
	vector<string> s(h);
	for(int i=0;i<h;i++){
		char t[128];
		-scanf("%s",t);
		s[i]=t;
	}
	vector<int> f(h*w,0);
	for(int y=0;y<h;y++){
		for(int x=0;x<w;x++){
			if(s[y][x]=='*'){
				for(int i=0;i<w;i++){
					f[y*h+i]++;
				}
				for(int i=0;i<h;i++){
					f[i*h+x]++;
				}
			}
		}
	}
	int p=0;
	while(f[p]>1)p++;
	s[p/w][p%h]='*';
	for(auto a:s){
		puts(a.c_str());
	}
	return 0;
}
0