結果

問題 No.105 arcの六角ボルト
ユーザー mayoko_mayoko_
提出日時 2014-12-16 23:32:11
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,091 bytes
コンパイル時間 837 ms
コンパイル使用メモリ 75,272 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-02 15:25:27
合計ジャッジ時間 1,148 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>

#define INF 1000000000

using namespace std;
typedef long long ll;

int main(void) {
    int T;
    cin >> T;
    while (T--) {
        double x[6];
        double y[6];
        vector<int> candidate;
        for (int i = 0; i < 6; i++) {
            cin >> x[i] >> y[i];
            if (x[i] > 0 && y[i] > 0) candidate.push_back(i);
        }
        if (candidate.size() == 1) {
            double ans = acos(x[candidate[0]]);
            ans = ans / M_PI * 180;
            printf("%.10lf\n", ans);
        } else {
            int index = 0;
            if (x[candidate[0]] > x[candidate[1]]) index = 0;
            else index = 1;
            double ans = acos(x[candidate[index]]);
            ans = ans / M_PI * 180;
            printf("%.10lf\n", ans);
        }
    }
    return 0;
}
0