結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,696 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 65 ms
4,348 KB
testcase_03 AC 397 ms
4,348 KB
testcase_04 AC 72 ms
4,348 KB
testcase_05 AC 1,389 ms
4,348 KB
testcase_06 AC 145 ms
4,348 KB
testcase_07 AC 443 ms
4,348 KB
testcase_08 AC 252 ms
4,348 KB
testcase_09 AC 315 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