結果
問題 | No.455 冬の大三角 |
ユーザー |
|
提出日時 | 2022-08-25 23:36:33 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 714 bytes |
コンパイル時間 | 1,494 ms |
コンパイル使用メモリ | 172,200 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-13 04:18:53 |
合計ジャッジ時間 | 3,681 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 54 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int main(){ int h, w; cin >> h >> w; vector<string> A(h); vector<pair<int,int>> a; for(int y = 0; y < h; y++){ cin >> A[y]; for(int x = 0; x < w; x++){ if(A[y][x] == '*')a.emplace_back(y, x); } } cerr << a.size() << '\n'; for(int y = 0; y < h; y++){ for(int x = 0; x < w; x++){ int y1 = a[0].first - y, x1 = a[0].second - x; int y2 = a[1].first - y, x2 = a[1].second - x; if(y1 * x2 != y2 * x1){ A[y][x] = '*'; goto skip; } } } skip: for(auto &&s:A)cout << s << '\n'; }