結果

問題 No.816 Beautiful tuples
ユーザー anonymouse777
提出日時 2019-04-19 22:14:24
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 376 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 58,892 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 20:37:07
合計ジャッジ時間 1,043 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cmath>
using namespace std;
int main(void){
    unsigned long long a,b,c;
    cin >> a >> b;
    c = a > b ? b : a;
    cout << c << endl;
    for(unsigned long long i=c;i<=(a+b);i+=c){
        if( ((a+b)%i==0) && ((a+i)%b==0) && ((b+i)%a==0) && a!=i && b!=i ){
            cout << i;
            return 0;
        }
    }
    cout << -1;
    
}
0