結果

問題 No.816 Beautiful tuples
ユーザー howakurohowakuro
提出日時 2019-04-20 08:17:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 306 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 31,324 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-25 10:02:12
合計ジャッジ時間 6,648 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
int main(){
    int A,B;
    scanf("%d %d", &A, &B);
    for(int C = 1;C < A + B; C++){
        if(A != C && B != C){
            if((A+B)%C == 0 && (B+C) % A == 0 && (C+A)%B==0){
                printf("%d",C);
                return 0;
            }
        }
    }
    printf("-1");
}
0