結果
| 問題 |
No.965 門松列が嫌い
|
| コンテスト | |
| ユーザー |
あるふぁ
|
| 提出日時 | 2020-01-13 20:34:45 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 743 bytes |
| コンパイル時間 | 883 ms |
| コンパイル使用メモリ | 95,160 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-21 16:21:11 |
| 合計ジャッジ時間 | 1,170 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 WA * 2 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:39:13: warning: 'res' may be used uninitialized [-Wmaybe-uninitialized]
39 | cout << res << endl;
| ^~~
main.cpp:26:9: note: 'res' was declared here
26 | int res;
| ^~~
ソースコード
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <vector>
#include <set>
#include <queue>
#include <unordered_map>
#include <map>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using lint = long long;
using namespace std;
const int MOD = 1000000007;
int main() {
int A, B, C;
cin >> A >> B >> C;
int m = max(A, B);
m = max(m, C);
int mi = min(A, B);
mi = min(mi, C);
int res;
if (B == m) {
res = min(abs(B - A), abs(B - C));
res = min(res, abs(B-C));
}
else {
if (B == mi) {
res = min(abs(B-A), abs(B-C));
res = min(res, abs(A-C));
}
}
cout << res << endl;
return 0;
}
あるふぁ