結果

問題 No.455 冬の大三角
ユーザー butter_roll
提出日時 2016-12-12 17:32:59
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 851 ms
コンパイル使用メモリ 73,632 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-29 16:52:17
合計ジャッジ時間 3,240 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 47 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#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(t1!=0||t2!=0){
    a[0].replace(a[0].find("-"),a[0].find("-")+1,"*");
  }
  else{
    a[0].replace(1,1,"*");
  }
  for(i=0;i<H;i++){
    cout<<a[i]<<endl;
  }
  return 0;
}
0