結果
問題 | No.455 冬の大三角 |
ユーザー |
![]() |
提出日時 | 2016-12-12 17:44:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 724 bytes |
コンパイル時間 | 779 ms |
コンパイル使用メモリ | 75,120 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-29 16:54:56 |
合計ジャッジ時間 | 2,871 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 51 WA * 3 |
ソースコード
#include <cstdio>#include <algorithm>#include <iostream>#include <vector>using namespace std;int main(void){int H,W;vector<string> a;string s;int i,t1,t2;cin>>H>>W;t1=t2=-1;for(i=0;i<H;i++){cin>>s;if(s.find("*")!=-1){if(t1==-1) t1=s.find("*");else t2=s.find("*");}a.push_back(s);}if(t2==-1){if(t1==0){a[1].replace(a[0].find("-"),1,"*");}else{a[0].replace(a[0].find("-"),1,"*");}}for(i=0;i<H;i++){if(t2!=-1){if(a[i].find("*")!=-1){if(a[i].find("*")==0) a[i].replace(1,1,"*");else a[i].replace(a[i].find("*")-1,1,"*");t2=-1;}}cout<<a[i]<<endl;}return 0;}