結果

問題 No.816 Beautiful tuples
ユーザー 259_Momone
提出日時 2019-04-19 22:43:17
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 541 bytes
コンパイル時間 1,802 ms
コンパイル使用メモリ 170,796 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-09-22 22:58:44
合計ジャッジ時間 2,390 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;

int main(){
    long A, B;
    cin >> A >> B;
    long N{A + B};
    vector<long> tapi, tape;
    {
        long i;
        for(i = 1; i * i <= N; ++i)if(N % i == 0){tapi.push_back(i); tape.push_back(N / i);}
    }
    reverse(tape.begin(), tape.end());
    //for(const auto i : tapi)
    //    if((A + i) % B == 0 && (B + i) % A == 0)return 0 & printf("%ld\n", i);
    //for(const auto i : tape)
    //    if((A + i) % B == 0 && (B + i) % A == 0)return 0 & printf("%ld\n", i);
    puts("-1");
}
0