結果
問題 | No.455 冬の大三角 |
ユーザー |
![]() |
提出日時 | 2016-12-12 15:59:04 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 858 bytes |
コンパイル時間 | 743 ms |
コンパイル使用メモリ | 78,352 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-29 21:37:48 |
合計ジャッジ時間 | 2,534 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 54 |
ソースコード
#include<iostream>#include<algorithm>#include<cstdio>#include<cstdlib>#include<vector>#include<map>#include<queue>#include<string>#include<sstream>#include<cmath>#include<numeric>using namespace std;int main(){int h, w;cin >> h >> w;vector<string> s(h);for(int i=0; i<h; i++) cin >> s[i];vector< pair<int, int> > star;for(int i=0; i<h; i++){for(int j=0; j<w; j++){if( s[i][j] == '*' ) star.push_back( make_pair(i, j) );}}if( star[0].first == star[1].first ){s[ (star[0].first+1)%h ][ star[0].second ] = '*';}else if( star[0].second == star[1].second ){s[ (star[0].first) ][ (star[0].second+1)%w ] = '*';}else{s[ (star[0].first) ][ star[1].second ] = '*';}for(int i=0; i<h; i++){for(int j=0; j<w; j++){cout << s[i][j];}cout << endl;}return 0;}