結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー koyumeishikoyumeishi
提出日時 2016-04-02 00:36:17
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,646 bytes
コンパイル時間 714 ms
コンパイル使用メモリ 93,004 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 07:33:10
合計ジャッジ時間 13,976 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,279 ms
6,812 KB
testcase_01 AC 1 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 777 ms
6,940 KB
testcase_05 AC 876 ms
6,944 KB
testcase_06 WA -
testcase_07 AC 260 ms
6,940 KB
testcase_08 AC 930 ms
6,940 KB
testcase_09 AC 2 ms
6,940 KB
testcase_10 AC 1 ms
6,940 KB
testcase_11 AC 2 ms
6,944 KB
testcase_12 AC 973 ms
6,940 KB
testcase_13 AC 2 ms
6,944 KB
testcase_14 AC 2 ms
6,944 KB
testcase_15 AC 1 ms
6,944 KB
testcase_16 AC 1,947 ms
6,940 KB
testcase_17 AC 2 ms
6,940 KB
testcase_18 AC 2 ms
6,944 KB
testcase_19 AC 676 ms
6,944 KB
testcase_20 AC 1 ms
6,944 KB
testcase_21 AC 14 ms
6,940 KB
testcase_22 AC 187 ms
6,944 KB
testcase_23 AC 267 ms
6,940 KB
testcase_24 AC 4 ms
6,940 KB
testcase_25 AC 74 ms
6,940 KB
testcase_26 AC 71 ms
6,940 KB
testcase_27 AC 711 ms
6,940 KB
testcase_28 AC 429 ms
6,944 KB
testcase_29 AC 421 ms
6,940 KB
testcase_30 AC 92 ms
6,940 KB
testcase_31 AC 3 ms
6,940 KB
testcase_32 AC 12 ms
6,940 KB
testcase_33 AC 83 ms
6,940 KB
testcase_34 AC 71 ms
6,944 KB
testcase_35 AC 13 ms
6,940 KB
testcase_36 AC 54 ms
6,944 KB
testcase_37 AC 2 ms
6,944 KB
testcase_38 AC 19 ms
6,944 KB
testcase_39 AC 13 ms
6,944 KB
testcase_40 AC 3 ms
6,940 KB
testcase_41 AC 5 ms
6,940 KB
testcase_42 WA -
testcase_43 AC 244 ms
6,944 KB
testcase_44 AC 49 ms
6,944 KB
testcase_45 AC 26 ms
6,944 KB
testcase_46 AC 20 ms
6,944 KB
testcase_47 AC 2 ms
6,944 KB
testcase_48 AC 1 ms
6,944 KB
testcase_49 WA -
testcase_50 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#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>
#include <cassert>
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);
}
template<class ... T>
long long gcd(long long a, long long b, T ... c){
	return gcd(gcd(a,b), c...);
}

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));
}
template<class ... T>
long long lcm(long long a, long long b, T ... c){
	return lcm(lcm(a,b), c...);
}


int main(){
	vector<long long> t(3); cin >> t;
	long long l = lcm(t[0], t[1], t[2]);
	

	vector<long long> unko = {l/t[0], l/t[1], l/t[2]};

	long long x = 1;
	for(long long k=2, m = *min_element(unko.begin(), unko.end()); k<=m; k++){
		long long a = unko[0] % k;
		long long b = unko[1] % k;
		long long c = unko[2] % k;
		if(a == b && b == c){
			x = k;
		}
	}

	cout << l << "/" << x << endl;

	return 0;
}
0