結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー kongarishisyamokongarishisyamo
提出日時 2016-04-01 23:46:25
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 482 bytes
コンパイル時間 785 ms
コンパイル使用メモリ 58,064 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 08:24:05
合計ジャッジ時間 99,477 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,858 ms
6,816 KB
testcase_01 AC 1,907 ms
6,944 KB
testcase_02 AC 1,878 ms
6,940 KB
testcase_03 AC 1,860 ms
6,944 KB
testcase_04 AC 1,853 ms
6,944 KB
testcase_05 AC 1,879 ms
6,944 KB
testcase_06 WA -
testcase_07 AC 1,873 ms
6,940 KB
testcase_08 AC 1,906 ms
6,940 KB
testcase_09 AC 1,875 ms
6,944 KB
testcase_10 AC 1,858 ms
6,944 KB
testcase_11 AC 1,858 ms
6,940 KB
testcase_12 AC 1,858 ms
6,944 KB
testcase_13 AC 1,860 ms
6,944 KB
testcase_14 AC 1,873 ms
6,944 KB
testcase_15 AC 1,862 ms
6,944 KB
testcase_16 AC 1,840 ms
6,940 KB
testcase_17 AC 1,839 ms
6,940 KB
testcase_18 AC 1,850 ms
6,944 KB
testcase_19 AC 1,867 ms
6,944 KB
testcase_20 AC 1,845 ms
6,940 KB
testcase_21 AC 1,845 ms
6,944 KB
testcase_22 AC 1,844 ms
6,940 KB
testcase_23 AC 1,833 ms
6,940 KB
testcase_24 AC 1,847 ms
6,940 KB
testcase_25 AC 1,887 ms
6,940 KB
testcase_26 AC 1,875 ms
6,940 KB
testcase_27 AC 1,870 ms
6,944 KB
testcase_28 AC 1,851 ms
6,944 KB
testcase_29 AC 1,862 ms
6,948 KB
testcase_30 AC 1,845 ms
6,944 KB
testcase_31 AC 1,867 ms
6,940 KB
testcase_32 AC 1,906 ms
6,940 KB
testcase_33 AC 1,925 ms
6,940 KB
testcase_34 AC 1,923 ms
6,944 KB
testcase_35 AC 1,876 ms
6,944 KB
testcase_36 AC 1,907 ms
6,940 KB
testcase_37 AC 1,863 ms
6,940 KB
testcase_38 AC 1,857 ms
6,944 KB
testcase_39 AC 1,832 ms
6,944 KB
testcase_40 AC 1,862 ms
6,944 KB
testcase_41 AC 1,875 ms
6,940 KB
testcase_42 WA -
testcase_43 AC 1,883 ms
6,944 KB
testcase_44 AC 1,853 ms
6,940 KB
testcase_45 AC 1,863 ms
6,944 KB
testcase_46 AC 1,876 ms
6,940 KB
testcase_47 AC 1,843 ms
6,940 KB
testcase_48 AC 1,846 ms
6,940 KB
testcase_49 WA -
testcase_50 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<algorithm>

using namespace std;

long long gcd(long long a,long long b){
	if(a<b) return gcd(b,a);
	if(b!=0) return gcd(b,a%b);
	return a;
}

int main(){

	long long T1,T2,T3;

	cin>>T1>>T2>>T3;

	long long N=gcd(T1,T2);
	long long A=T1*T2/N;
	N=gcd(A,T3);
	A=A*T3/N;

	cout<<A<<"/";

	long long K1=A/T1;
	long long K2=A/T2;
	long long K3=A/T3;

	for(long long i=100000000;i>=1;i--){
		if(K1%i==K2%i&&K2%i==K3%i){
			cout<<i<<endl;
			break;
		}
	}

}

0