結果

問題 No.816 Beautiful tuples
ユーザー yosakayosaka
提出日時 2019-04-21 02:39:04
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 1,524 ms
コンパイル使用メモリ 162,904 KB
実行使用メモリ 13,888 KB
最終ジャッジ日時 2024-04-14 12:23:52
合計ジャッジ時間 5,489 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
10,016 KB
testcase_01 WA -
testcase_02 AC 97 ms
6,940 KB
testcase_03 AC 301 ms
6,944 KB
testcase_04 AC 261 ms
6,944 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 && A != n && B != n)
        {
            C = n;
        }
    }
    cout << C << endl;
    return 0;
}
0