結果
問題 |
No.455 冬の大三角
|
ユーザー |
|
提出日時 | 2024-12-11 01:38:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,003 bytes |
コンパイル時間 | 3,736 ms |
コンパイル使用メモリ | 230,664 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-11 01:38:24 |
合計ジャッジ時間 | 6,086 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 44 WA * 10 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:35:35: warning: 'c' may be used uninitialized [-Wmaybe-uninitialized] 35 | if(a==i||c==i)continue; | ~^~~ main.cpp:24:17: note: 'c' was declared here 24 | int a,b,c,d; | ^ main.cpp:37:49: warning: 'd' may be used uninitialized [-Wmaybe-uninitialized] 37 | if((b-j)*(c-i)==(a-i)*(d-j))continue; | ~~^~~ main.cpp:24:19: note: 'd' was declared here 24 | int a,b,c,d; | ^ main.cpp:37:30: warning: 'b' may be used uninitialized [-Wmaybe-uninitialized] 37 | if((b-j)*(c-i)==(a-i)*(d-j))continue; | ~~^~~ main.cpp:24:15: note: 'b' was declared here 24 | int a,b,c,d; | ^ main.cpp:24:13: warning: 'a' may be used uninitialized [-Wmaybe-uninitialized] 24 | int a,b,c,d; | ^
ソースコード
#include<bits/stdc++.h> #include <atcoder/all> #ifdef LOCAL #include <debug_print.hpp> #define debug(...) debug_print::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast<void>(0)) #endif using namespace atcoder; using mint=modint998244353; using namespace std; using ll=long long; using ul=unsigned long long; int dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0}; int dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0}; using Graph=vector<vector<int>>; ll op(ll a,ll b){return min(a,b);} ll e(){return 2e9;} int main(){ int H,W; cin>>H>>W; vector<string>S(H); for(int i=0;i<H;i++)cin>>S[i]; int a,b,c,d; bool ok=false; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ if(S[i][j]=='*'&&!ok)a=i,b=j; else if(S[i][j]=='*')c=i,d=j; } } bool okok=false; for(int i=0;i<H;i++){ for(int j=0;j<W;j++){ if(a==i||c==i)continue; if(b==j&&c==j)continue; if((b-j)*(c-i)==(a-i)*(d-j))continue; S[i][j]='*'; okok=true; break; } if(okok)break; } for(auto a:S)cout<<a<<endl; }