QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#850254 | #1373. Rating Problems | Teapot# | AC ✓ | 1ms | 3944kb | C++20 | 1.2kb | 2025-01-09 22:44:03 | 2025-01-09 22:44:04 |
Judging History
answer
/** gnu specific **/
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
/** contains everything I need in std **/
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(S) ((int)S.size())
#define FOR(i, st_, n) for(int i = st_; i < n; ++i)
#define RFOR(i, n, end_) for(int i = (n)-1; i >= end_; --i)
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ull, ull> pull;
using namespace __gnu_pbds;
typedef tree<ll, null_type, less<>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
using namespace std;
#ifdef ONPC
mt19937 rnd(228);
#else
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
#endif
int32_t main()
{
ios::sync_with_stdio(0);
cin.tie(0);
ll n,k;
ld s = 0;
ld a;
cin >> n >> k;
FOR(i,0,k){
cin >> a;
s+=a;
}
cout << (s - 3.0 * (n-k))/(n) << ' ' << (s + 3.0 * (n-k))/(n);
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3892kb
input:
10 0
output:
-3 3
result:
ok 2 numbers
Test #2:
score: 0
Accepted
time: 0ms
memory: 3944kb
input:
10 10 3 2 1 0 -1 -2 -3 -2 -1 0
output:
-0.3 -0.3
result:
ok 2 numbers
Test #3:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
10 10 0 0 0 0 0 0 0 0 0 0
output:
0 0
result:
ok 2 numbers
Test #4:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
10 10 3 3 3 3 3 3 3 3 3 3
output:
3 3
result:
ok 2 numbers
Test #5:
score: 0
Accepted
time: 1ms
memory: 3940kb
input:
10 10 -3 -3 -3 -3 -3 -3 -3 -3 -3 -3
output:
-3 -3
result:
ok 2 numbers
Test #6:
score: 0
Accepted
time: 1ms
memory: 3888kb
input:
1 0
output:
-3 3
result:
ok 2 numbers
Test #7:
score: 0
Accepted
time: 1ms
memory: 3868kb
input:
1 1 2
output:
2 2
result:
ok 2 numbers
Test #8:
score: 0
Accepted
time: 1ms
memory: 3888kb
input:
9 7 1 3 2 2 1 1 2
output:
0.666667 2
result:
ok 2 numbers
Test #9:
score: 0
Accepted
time: 1ms
memory: 3940kb
input:
6 4 -2 -1 -2 0
output:
-1.83333 0.166667
result:
ok 2 numbers