結果

問題 No.1224 I hate Sqrt Inequality
ユーザー nawawannawawan
提出日時 2020-09-11 21:52:46
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 457 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 74,208 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-30 19:26:33
合計ジャッジ時間 1,608 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 WA -
testcase_13 AC 1 ms
4,500 KB
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <set>
using namespace std;
int main(){
    unsigned long long a, b;
    cin >> a >> b;
    while(a < b) a *= 10;
    set<unsigned long long> s;
    while(1){
        unsigned long long t = a / b;
        if(s.count(t)){
            cout << "Yes" << endl;
            return 0;
        }
        else s.insert(t);
        if(a - t * b == 0) break;
        a = (a - t * b) * 10;
    }
    cout << "No" << endl;
}
0