結果

問題 No.455 冬の大三角
ユーザー taba
提出日時 2017-05-18 08:13:33
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 618 bytes
コンパイル時間 1,071 ms
コンパイル使用メモリ 112,144 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-18 18:37:09
合計ジャッジ時間 2,527 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 45 WA * 9
権限があれば一括ダウンロードができます

ソースコード

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;
	}
	for(int y=0;y<h;y++){
		for(int x=0;x<w;x++){
			if(s[y][x]=='-'){
				if(count(s[y].begin(),s[y].end(),'*')<2&&count_if(s.begin(),s.end(),[x](string t){return t[x]=='*';})){
					s[y][x]='*';
					for(auto a:s){
						puts(a.c_str());
					}
					return 0;
				}
			}
		}
	}
	
	return 0;
}
0