結果

問題 No.229 線分上を往復する3つの動点の一致
ユーザー Kmcode1Kmcode1
提出日時 2015-06-19 23:49:51
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,454 bytes
コンパイル時間 683 ms
コンパイル使用メモリ 98,436 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-21 10:22:48
合計ジャッジ時間 2,214 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 WA -
testcase_08 AC 2 ms
4,376 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 2 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1 ms
4,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 2 ms
4,380 KB
testcase_24 WA -
testcase_25 AC 1 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 1 ms
4,376 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 1 ms
4,376 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
#include<unordered_map>
using namespace std;
#define MOD 1000000007
namespace math{
	unsigned long long int gcd(unsigned long long int a, unsigned long long int b){
		if (a > b){
			swap(a, b);
		}
		while (a){
			swap(a, b);
			a %= b;
		}
		return b;
	}
	unsigned long long int lcm(long long int a, long long int b){
		unsigned long long int g =gcd(a, b);
		a /= g;
		return a*b;
	}
}
using namespace math;
struct st{
	long long int u;
	long long int s;
	st(long long int u_ = 0,long long int s_=0){
		u = u_;
		s = s_;
	}
};
void y(st &a){
	long long int g = gcd(a.s, a.u);
	a.s /= g;
	a.u /= g;
}
vector<unsigned long long int> v;
int main(){
	for (int i = 0; i < 3; i++){
		long long int a;
		scanf("%lld", &a);
		v.push_back(a);
	}
	random_shuffle(v.begin(), v.end());
	st k = st(v[0] * v[1] * (v[1] + v[2]), (v[2] + v[1])*(v[0] + v[1]));
	st kk = st(v[2] * v[1] * (v[1] + v[0]), (v[2] + v[1])*(v[0] + v[1]));
	unsigned long long int B = lcm(k.u, kk.u);
	k.u = B;
	y(k);
	printf("%lld/%lld\n", k.u, k.s);
	return 0;
}
0