結果

問題 No.816 Beautiful tuples
ユーザー anonymouse777
提出日時 2019-04-19 21:51:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 297 bytes
コンパイル時間 652 ms
コンパイル使用メモリ 57,508 KB
実行使用メモリ 13,888 KB
最終ジャッジ日時 2024-09-22 18:35:16
合計ジャッジ時間 4,273 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 3 WA * 2 TLE * 1 -- * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

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