結果
問題 |
No.816 Beautiful tuples
|
ユーザー |
|
提出日時 | 2019-04-20 08:17:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 306 bytes |
コンパイル時間 | 227 ms |
コンパイル使用メモリ | 27,264 KB |
最終ジャッジ日時 | 2025-01-07 02:45:49 |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 WA * 2 TLE * 4 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:4:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 4 | scanf("%d %d", &A, &B); | ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#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"); }