結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,537 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1,671 ms
5,376 KB
testcase_05 AC 1,877 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 362 ms
5,376 KB
testcase_08 AC 944 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 974 ms
5,376 KB
testcase_13 AC 1,928 ms
5,376 KB
testcase_14 AC 959 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 1,904 ms
5,376 KB
testcase_17 AC 122 ms
5,376 KB
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 853 ms
5,376 KB
testcase_20 AC 3 ms
5,376 KB
testcase_21 AC 23 ms
5,376 KB
testcase_22 AC 482 ms
5,376 KB
testcase_23 AC 695 ms
5,376 KB
testcase_24 AC 70 ms
5,376 KB
testcase_25 AC 219 ms
5,376 KB
testcase_26 AC 188 ms
5,376 KB
testcase_27 AC 1,242 ms
5,376 KB
testcase_28 AC 1,243 ms
5,376 KB
testcase_29 AC 1,314 ms
5,376 KB
testcase_30 AC 163 ms
5,376 KB
testcase_31 AC 24 ms
5,376 KB
testcase_32 AC 26 ms
5,376 KB
testcase_33 AC 310 ms
5,376 KB
testcase_34 AC 874 ms
5,376 KB
testcase_35 AC 57 ms
5,376 KB
testcase_36 AC 375 ms
5,376 KB
testcase_37 AC 2 ms
5,376 KB
testcase_38 AC 25 ms
5,376 KB
testcase_39 AC 43 ms
5,376 KB
testcase_40 AC 3 ms
5,376 KB
testcase_41 AC 38 ms
5,376 KB
testcase_42 WA -
testcase_43 AC 383 ms
5,376 KB
testcase_44 AC 67 ms
5,376 KB
testcase_45 AC 214 ms
5,376 KB
testcase_46 AC 128 ms
5,376 KB
testcase_47 AC 2 ms
5,376 KB
testcase_48 AC 2 ms
5,376 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=max(max(K1,K2),K3);i>=1;i--){
		if(K1%i==K2%i&&K2%i==K3%i){
			cout<<i<<endl;
			break;
		}
	}

}

0