QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#424944#3284. Medical CheckupNYCU_template#WA 1ms3784kbC++201.2kb2024-05-29 20:05:072024-05-29 20:05:08

Judging History

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

  • [2024-05-29 20:05:08]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3784kb
  • [2024-05-29 20:05:07]
  • 提交

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;
ll 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++){
    if(T == 0 || (T < pre[i])){
      cout << "1\n";
    }
    else cout << max((T - pre[i]), 0ll) / preMax[i] + 2 << "\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: 100
Accepted
time: 0ms
memory: 3700kb

input:

1 0
8404

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

1 1
141237625

output:

1

result:

ok single line: '1'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3656kb

input:

1 0
1

output:

1

result:

ok single line: '1'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3644kb

input:

1 1
1

output:

2

result:

ok single line: '2'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3720kb

input:

1 2
1

output:

3

result:

ok single line: '3'

Test #6:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

1 1000000000
1

output:

1000000001

result:

ok single line: '1000000001'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

2 50000
5
68

output:

10001
736

result:

ok 2 lines

Test #8:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

2 50000
94
68

output:

532
532

result:

ok 2 lines

Test #9:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

35 917428
7671
10389
16620
692
1070
10595
13424
154
7669
1337
8350
13736
11780
18609
16924
10539
1840
13079
8321
14024
18207
15244
5250
950
14722
6565
12653
15129
19821
7307
4941
19652
14454
15068
13031

output:

120
88
55
55
55
54
53
53
53
53
52
51
50
44
43
43
43
42
42
41
40
39
39
39
38
37
37
36
33
33
32
31
31
30
29

result:

ok 35 lines

Test #10:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

45 8271901
29985
29600
28434
28230
27415
27277
27140
26930
26658
26542
26048
24835
23107
22996
22846
22087
21763
20654
18950
18887
15893
15489
15136
15022
14820
14596
14333
13934
13093
11525
10779
9572
8313
8248
8182
7985
7134
4996
3762
2723
2213
2181
1817
1503
477

output:

276
275
274
273
273
272
271
270
269
268
267
266
266
265
264
263
263
262
261
261
260
260
259
259
258
258
257
257
256
256
256
255
255
255
254
254
254
254
254
253
253
253
253
253
253

result:

ok 45 lines

Test #11:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

2222 923456789
299747
299740
299633
299502
299499
299377
299292
299165
298632
298410
298154
297738
297666
297568
297563
297472
296903
296821
296393
296348
296241
296209
296156
296125
296077
296031
295963
295921
295766
295659
295641
295489
295186
295004
294983
294662
294622
294609
294399
294293
29414...

output:

3081
3080
3079
3078
3077
3076
3075
3074
3073
3072
3071
3070
3069
3068
3067
3066
3065
3064
3063
3062
3061
3060
3059
3058
3057
3056
3055
3054
3053
3053
3052
3051
3050
3049
3048
3047
3046
3045
3044
3043
3042
3041
3040
3039
3038
3037
3036
3035
3034
3033
3032
3031
3030
3029
3028
3027
3026
3025
3024
3023
...

result:

ok 2222 lines

Test #12:

score: -100
Wrong Answer
time: 0ms
memory: 3732kb

input:

100000 1000000000
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
...

output:

2
1
1
1
1

result:

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