QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#424887#3284. Medical CheckupNYCU_template#WA 0ms3948kbC++201.2kb2024-05-29 19:31:592024-05-29 19:32:00

Judging History

你现在查看的是最新测评结果

  • [2024-05-29 19:32:00]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3948kb
  • [2024-05-29 19:31:59]
  • 提交

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]);
  }
  ll p = 0;
  for(int i = 1; i <= N; i++){
    cout << ceil(max((T - pre[i]) + 0.5, 0.5) / preMax[i]) + 1 << "\n";
  }
}

signed main() {
  fastio ll T = 1;
  // cin >> T;
  for (ll i = 1; i <= T; i++) {
    solve();
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3948kb

input:

1 0
8404

output:

2

result:

wrong answer 1st lines differ - expected: '1', found: '2'