結果
問題 | No.105 arcの六角ボルト |
ユーザー |
![]() |
提出日時 | 2017-04-28 21:36:38 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 26 ms / 5,000 ms |
コード長 | 1,007 bytes |
コンパイル時間 | 1,344 ms |
コンパイル使用メモリ | 159,252 KB |
実行使用メモリ | 6,812 KB |
最終ジャッジ日時 | 2024-09-13 17:54:29 |
合計ジャッジ時間 | 1,693 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:38:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 38 | scanf("%lf %lf", x + i, y + i); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>using namespace std;#define FOR(i,a,b) for(int i=(a);i<(b);i++)#define REP(i,n) FOR(i,0,n)#define ALL(v) (v).begin(),(v).end()template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }typedef unsigned long long ull;typedef long long ll;typedef pair<int, int> pii;typedef pair<ll, ll> pll;typedef pair<int, pii> P;const ll INF = 1ll<<60;const ll MOD = 1000000007;const double EPS = 1e-10;const double PI = acos(-1);double radToAng(double rad) {return rad * 180.0 / PI;}int main() {int t;cin >> t;while (t--) {double x[6], y[6];double ans = 50;REP(i, 6) {scanf("%lf %lf", x + i, y + i);if (x[i] < 0 || y[i] < 0) continue;double ang = radToAng(atan2(y[i], x[i]));chmin(ans, ang);}if (ans == 50.0) ans = 0;printf("%.15f\n", ans);}return 0;}