結果

問題 No.356 円周上を回る3つの動点の一致
ユーザー kotatsugamekotatsugame
提出日時 2020-02-14 21:21:47
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 438 bytes
コンパイル時間 540 ms
コンパイル使用メモリ 64,500 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-16 01:24:45
合計ジャッジ時間 2,272 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 2 ms
5,376 KB
testcase_12 AC 3 ms
5,376 KB
testcase_13 WA -
testcase_14 AC 8 ms
5,376 KB
testcase_15 AC 3 ms
5,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 2 ms
5,376 KB
testcase_19 AC 4 ms
5,376 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 6 ms
5,376 KB
testcase_33 AC 5 ms
5,376 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 2 ms
5,376 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 3 ms
5,376 KB
testcase_41 WA -
testcase_42 AC 2 ms
5,376 KB
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 4 ms
5,376 KB
testcase_48 AC 2 ms
5,376 KB
testcase_49 AC 3 ms
5,376 KB
testcase_50 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;
	for(long k=1;k<=10000;k++)
	{
		long ta=T1*T2*k,tb=T2-T1;
		long g=gcd(ta,tb);
		ta/=g;tb/=g;
		long a1,b1,a2,b2;
		a1=ta,b1=tb*T1;
		g=gcd(a1,b1);
		a1/=g;b1/=g;
		a1%=b1;
		a2=ta,b2=tb*T3;
		g=gcd(a2,b2);
		a2/=g;b2/=g;
		a2%=b2;
		if(a1==a2&&b1==b2)
		{
			cout<<ta<<"/"<<tb<<endl;
			return 0;
		}
	}
}
0