結果

問題 No.816 Beautiful tuples
ユーザー HyadoHyado
提出日時 2019-04-19 21:40:15
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 344 bytes
コンパイル時間 1,451 ms
コンパイル使用メモリ 166,400 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-24 00:33:04
合計ジャッジ時間 12,322 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define fi first
#define se second
int main(){
    int a,b;
    cin >> a >> b;
    for(int c=1;c < a+b;c++)
    {
        if((a+b)%c == (b+c)%a && (c+a)%b == (a+b)%c && (b+c)%a==0){
            cout << c << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}
0