結果
| 問題 | No.356 円周上を回る3つの動点の一致 | 
| コンテスト | |
| ユーザー |  koyumeishi | 
| 提出日時 | 2016-04-01 23:03:42 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                WA
                                 
                             | 
| 実行時間 | - | 
| コード長 | 1,457 bytes | 
| コンパイル時間 | 759 ms | 
| コンパイル使用メモリ | 93,048 KB | 
| 実行使用メモリ | 6,824 KB | 
| 最終ジャッジ日時 | 2024-10-02 09:18:39 | 
| 合計ジャッジ時間 | 2,000 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 31 WA * 17 | 
ソースコード
#include <iostream>
#include <vector>
#include <cstdio>
#include <sstream>
#include <map>
#include <string>
#include <algorithm>
#include <queue>
#include <cmath>
#include <functional>
#include <set>
#include <ctime>
#include <random>
#include <chrono>
using namespace std;
template<class T> istream& operator >> (istream& is, vector<T>& vec){for(T& val: vec) is >> val; return is;}
template<class T> istream& operator ,  (istream& is, T& val){ return is >> val;}
template<class T> ostream& operator << (ostream& os, const vector<T>& vec){for(int i=0; i<vec.size(); i++) os << vec[i] << (i==vec.size()-1?"":" "); return os;}
template<class T> ostream& operator ,  (ostream& os, const T& val){ return os << " " << val;}
template<class T> ostream& operator >> (ostream& os, const T& val){ return os << " " << val;}
long long gcd(long long a, long long b){
	if(b==0) return a;
	return gcd(b, a%b);
}
long long lcm(long long a, long long b){
	if(a<b) swap(a,b);
	if(b==1) return a;
	return a * (b/gcd(a,b));
}
long long extgcd(long long a, long long b, long long &x, long long &y){
	long long d=a;
	if(b!=0){
		d = extgcd(b, a%b, y, x);
		y -= (a/b) * x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}
int main(){
	vector<int> t(3); cin >> t;
	long long l = lcm(t[0], lcm(t[1],t[2]));
	
	long long g = gcd(max(1LL,l/t[0]-1), gcd(max(1LL,l/t[1]-1),max(1LL,l/t[2]-1)));
	long long gg = gcd(l,g);
	l /= gg;
	g /= gg;
	cout << l << "/" << g << endl;
	return 0;
}
            
            
            
        