結果

問題 No.816 Beautiful tuples
ユーザー yosakayosaka
提出日時 2019-04-21 02:43:03
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 323 bytes
コンパイル時間 1,619 ms
コンパイル使用メモリ 163,980 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-04-14 21:35:55
合計ジャッジ時間 5,479 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
13,756 KB
testcase_01 AC 2 ms
6,816 KB
testcase_02 AC 96 ms
6,940 KB
testcase_03 AC 299 ms
6,944 KB
testcase_04 AC 261 ms
6,940 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int main()
{
    int A, B;
    int C = -1;
    cin >> A >> B;
    for(int n = 1; n <= A + B; n++)
    {
        if ((A + n)%B==0 && (B + n)%A==0 && (A + B) % n == 0 && A!= B && A != n && B != n)
        {
            C = n;
        }
    }
    cout << C << endl;
    return 0;
}
0