結果

問題 No.816 Beautiful tuples
ユーザー anonymouse777
提出日時 2019-04-19 22:07:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 311 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 57,560 KB
実行使用メモリ 13,880 KB
最終ジャッジ日時 2024-09-22 20:08:06
合計ジャッジ時間 4,216 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;
    cin >> a >> b;
    for(long long i=2;i<=(a+b)/2;i++){
        if( ((a+b)%i==0) && ((a+i)%b==0) && ((b+i)%a==0) && a!=i && b!=i ){
            cout << i;
            return 0;
        }
    }
    cout << -1;
    
}
0