結果
| 問題 |
No.816 Beautiful tuples
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-04-21 02:27:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 316 bytes |
| コンパイル時間 | 1,412 ms |
| コンパイル使用メモリ | 167,008 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-03 04:01:44 |
| 合計ジャッジ時間 | 2,208 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 WA * 8 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:11:56: warning: 'C' may be used uninitialized [-Wmaybe-uninitialized]
11 | if ((A + C) == 2 * B && (B + C) == 2 * A && A != C && B != C)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
main.cpp:5:15: note: 'C' was declared here
5 | int A, B, C;
| ^
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main()
{
int A, B, C;
cin >> A >> B;
if (A != B)
{
C = (A + B) / 2;
}
if ((A + C) == 2 * B && (B + C) == 2 * A && A != C && B != C)
{
cout << C << endl;
}
else
{
cout << -1 << endl;
}
return 0;
}