結果
| 問題 |
No.816 Beautiful tuples
|
| コンテスト | |
| ユーザー |
mhr380
|
| 提出日時 | 2019-04-23 01:32:20 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 371 bytes |
| コンパイル時間 | 405 ms |
| コンパイル使用メモリ | 53,828 KB |
| 実行使用メモリ | 10,496 KB |
| 最終ジャッジ日時 | 2024-10-12 09:15:15 |
| 合計ジャッジ時間 | 4,733 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 WA * 3 TLE * 1 -- * 6 |
ソースコード
#include <string>
#include <iostream>
int main() {
int a, b;
std::cin >> a >> b;
int c = 1;
bool flg = false;
while (c < a * b) {
int sum1 = a + b;
int sum2 = b + c;
int sum3 = c + a;
if (sum1 % c == 0 && sum2 % a == 0 && sum3 % b == 0) {
std::cout << c << std::endl;
return 0;
}
else {
c++;
}
}
c = -1;
std::cout << c << std::endl;
}
mhr380