結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー Tatsuno
提出日時 2016-04-02 00:18:51
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 1,182 bytes
コンパイル時間 1,422 ms
コンパイル使用メモリ 158,344 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-02 10:15:04
合計ジャッジ時間 2,910 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using i32 = int;
using i64 = int64_t;
template <class T> using vec = vector<T>;
using wdgraph = vec<vec<pair<i32, i32>>>;
#define times(n, i) for (i32 i = 0; i < (n); i++)
#define range(n, m, i) for (i32 i = (n); i < (m); i++)
#define upto(n, m, i) for (i32 i = (n); i <= (m); i++)
#define downto(n, m, i) for (i32 i = (n); i >= (m); i--)
#define foreach(xs, x) for (auto &x : (xs))
#define all(xs) (xs).begin(), (xs).end()
#define sortall(xs) sort(all(xs))
#define reverseall(xs) reverse(all(xs))
#define uniqueall(xs) erase(unique(all(xs)), (xs).end())
#define maximum(xs) *max_element(all(xs))
#define minimum(xs) *min_element(all(xs))
i64 MOD = 1000000007;

int64_t gcd(int64_t x, int64_t y) {
    while (y > 0) { int64_t r = x % y; x = y; y = r; }
    return x;
}

i64 lcm(i64 x, i64 y)
{
    return x*y/gcd(x, y);
}

i32 main()
{
    i32 a,b,c;
    cin >> a >> b >> c;
    i32 d = lcm(lcm(a, b), c);
    i32 x = (d/a), y = (d/b), z = (d/c);
    i32 u = z;
    while(u > 0) {
        if (x%u == y%u && y%u == z%u)
            break;
        u--;
    }
    cout << fixed << setprecision(12) << d << "/" << u << endl;
    return 0;
}
0