結果
問題 |
No.356 円周上を回る3つの動点の一致
|
ユーザー |
![]() |
提出日時 | 2016-04-02 00:39:00 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 667 bytes |
コンパイル時間 | 1,257 ms |
コンパイル使用メモリ | 159,464 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-02 09:17:10 |
合計ジャッジ時間 | 2,579 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 WA * 43 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i=a;i<b;i++) typedef long long ll; typedef vector<int> vi; typedef vector<string> vs; typedef pair<int, int> pii; int euclid(int a, int b) { int temp; if (a < b) { temp = a; a = b; b = temp; } if (b < 1) return -1; if (a % b == 0) return b; return euclid(b, a % b); } int main() { int t1, t2, t3; cin >> t1 >> t2 >> t3; int up = t2 * t3 * abs(t2 - t1); int down = abs(t3 - t2) * t1 * t2; int a = euclid(up, down); up /= a; down /= a; int m = down; up = t2 * t3 * m; down = abs(t3 - t2); a = euclid(up, down); up /= a; down /= a; cout << up << "/" << down << endl; }