結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,384 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 WA -
testcase_08 AC 1 ms
4,380 KB
testcase_09 WA -
testcase_10 AC 1 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 WA -
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 1 ms
4,380 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 2 ms
4,380 KB
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{
	long long int gcd(long long int a, long long int b){
		if (a > b){
			swap(a, b);
		}
		while (a){
			swap(a, b);
			a %= b;
		}
		return b;
	}
	long long int lcm(long long int a, long long int b){
		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;
}
st mul(st a, st b){
	st s;
	s.s = a.s*b.s;
	s.u = a.u*b.u;
	y(s);
	return s;
}
vector<long long int> v;
int main(){
	for (int i = 0; i < 3; i++){
		int a;
		scanf("%d", &a);
		v.push_back(a);
	}
	sort(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]));
	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