結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー kotatsugame
提出日時 2020-02-14 21:25:12
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 289 bytes
コンパイル時間 488 ms
コンパイル使用メモリ 64,168 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-13 21:13:01
合計ジャッジ時間 1,692 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 48
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    5 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
long T1,T2,T3;
long gcd(long a,long b){return b?gcd(b,a%b):a;}
main()
{
	cin>>T1>>T2>>T3;
	long A=T2*(T3-T1),B=T3*(T2-T1);
	long G=gcd(A,B);
	long k=B/G,l=A/G;
	long ta=T1*T2*k,tb=T2-T1;
	long g=gcd(ta,tb);
	ta/=g;tb/=g;
	cout<<ta<<"/"<<tb<<endl;
}
0