結果
| 問題 | No.3632 IQR |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-08-21 22:03:58 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 2,000 ms |
| + 900µs | |
| コード長 | 952 bytes |
| 記録 | |
| コンパイル時間 | 1,948 ms |
| コンパイル使用メモリ | 343,536 KB |
| 実行使用メモリ | 9,416 KB |
| 最終ジャッジ日時 | 2026-08-21 22:04:06 |
| 合計ジャッジ時間 | 6,233 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 63 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (ll i = s; i < (ll)(t); i++)
#define all(x) begin(x), end(x)
template <class T> bool chmin(T& x, T y) {
return x > y ? (x = y, true) : false;
}
template <class T> bool chmax(T& x, T y) {
return x < y ? (x = y, true) : false;
}
void solve() {
int n;
cin >> n;
vector<ll> a(n);
rep(i, 0, n) cin >> a[i];
sort(all(a));
auto qq = [&](int l, int r) {
int sz = r - l;
return (a[l + (sz - 1) / 2] + a[l + sz / 2]);
};
ll q1 = qq(0, n / 2), q2 = qq(0, n), q3 = qq((n + 1) / 2, n);
ll iqr = q3 - q1;
int u = 0;
rep(i, 0, n) {
if (a[i] * 4 < q1 * 2 - 3 * iqr || a[i] * 4 > q3 * 2 + 3 * iqr) u++;
}
cout << (double)q1 / 2 << ' ' << (double)q2 / 2 << ' ' << (double)q3 / 2
<< ' ' << u << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
int t = 1;
// cin >> t;
while (t--) solve();
}