QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#424890 | #3284. Medical Checkup | NYCU_template# | WA | 1ms | 4008kb | C++20 | 1.1kb | 2024-05-29 19:37:04 | 2024-05-29 19:37:04 |
Judging History
answer
#include <algorithm>
// #include <bits/stdc++.h>
#include <deque>
#include <cmath>
#include <iostream>
#include <queue>
#include <stdio.h>
#include <set>
#include <map>
#include <tuple>
#include <vector>
using namespace std;
#define ll long long
#define fastio ios::sync_with_stdio(false), cin.tie(0);
#define pll pair<ll, ll>
#define pdd pair<double, double>
#define F first
#define S second
#define pb push_back
#define ppb pop_back
#define mkp make_pair
#define sz(a) (ll) a.size()
#define all(x) x.begin(), x.end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define lowbit(x) x &(-x)
const ll MAXN = 4e3 + 5;
// const ll MAXM = 1e2 + 5;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
ll N, T;
double h[MAXN], pre[MAXN], preMax[MAXN];
void solve(){
cin >> N >> T;
for(int i = 1; i <= N; i++){
cin >> h[i];
pre[i] = pre[i-1] + h[i];
preMax[i] = max(preMax[i-1], h[i]);
}
for(int i = 1; i <= N; i++){
cout << ceil(max((T - pre[i]) + 0.5, 0.0) / preMax[i]) + 1 << "\n";
}
}
signed main() {
fastio ll T = 1;
// cin >> T;
for (ll i = 1; i <= T; i++) {
solve();
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 4004kb
input:
1 0 8404
output:
1
result:
ok single line: '1'
Test #2:
score: 0
Accepted
time: 1ms
memory: 4008kb
input:
1 1 141237625
output:
1
result:
ok single line: '1'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3932kb
input:
1 0 1
output:
1
result:
ok single line: '1'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3936kb
input:
1 1 1
output:
2
result:
ok single line: '2'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
1 2 1
output:
3
result:
ok single line: '3'
Test #6:
score: -100
Wrong Answer
time: 1ms
memory: 3876kb
input:
1 1000000000 1
output:
1e+09
result:
wrong answer 1st lines differ - expected: '1000000001', found: '1e+09'