結果

問題 No.1723 [Cherry 3rd Tune *] Dead on
ユーザー kotatsugame
提出日時 2021-11-05 23:19:15
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 11 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 64,736 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-06 14:31:56
合計ジャッジ時間 2,363 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 50
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:12:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   12 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
long X,A,Y,B;
bool ok=true;
void f(long p)
{
	long c=0;
	while(Y%p==0)Y/=p,c+=B;
	while(X%p==0)X/=p,c-=A;
	if(c>0)ok=false;
}
main()
{
	cin>>X>>A>>Y>>B;
	for(long p=2;p*p<=Y;p++)if(Y%p==0)f(p);
	if(Y>1)f(Y);
	cout<<(ok?"Yes":"No")<<endl;
}
0