結果
| 問題 |
No.1224 I hate Sqrt Inequality
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-12 12:27:22 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 438 bytes |
| コンパイル時間 | 689 ms |
| コンパイル使用メモリ | 67,012 KB |
| 最終ジャッジ日時 | 2025-01-14 13:16:51 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 WA * 7 |
コンパイルメッセージ
main.cpp:10:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
10 | main() {
| ^~~~
ソースコード
#include <iostream>
using namespace std;
long long p10[100];
long long gcd(long long a,long long b) {
return a?gcd(b%a,a):b;
}
main() {
p10[0]=1;
for (int i=1;i<100;++i) p10[i]=p10[i-1]*10;
long long a,b;
cin>>a>>b;
long long g=gcd(a,b);
a/=g;
b/=g;
for (int i=1;i<=18;++i) {
if ((p10[i]-1)%b==0) {
cout<<"Yes"<<endl;
exit(0);
}
}
cout<<"No"<<endl;
}