結果
問題 | No.455 冬の大三角 |
ユーザー |
![]() |
提出日時 | 2016-12-12 17:39:22 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 652 bytes |
コンパイル時間 | 774 ms |
コンパイル使用メモリ | 73,600 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-29 16:54:49 |
合計ジャッジ時間 | 3,079 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 49 WA * 5 |
ソースコード
#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,"*");}}else if(t1!=0||t2!=0){a[0].replace(a[0].find("-"),1,"*");}else{a[0].replace(1,1,"*");}for(i=0;i<H;i++){cout<<a[i]<<endl;}return 0;}