216162026-01-13 17:17:32algoproBájital (80 pont)cpp17Wrong answer 12/8041ms2164 KiB
// UUID: a306e529-ae78-4e84-afc7-48431949df59
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
	ll n, x;
	cin >> n >> x;
	vector <ll> alap(n+1);
	for ( ll i = 1; i <= n; i++ ){
		cin >> alap[i];
	}
	vector <ll> pref(n+1);
	pref[0] = 0;
	for ( ll i = 1; i <= n; i++ ){
		pref[i] = pref[i-1] + alap[i]/x;
	}
	ll mx = 0;
	for ( ll i = 1; i <= n; i++ ){
		if ( (alap[i]-1)/x != alap[i]/x ){
			mx = max( mx, pref[n]-1 );
		}
		else mx = max( mx, pref[n] );
	}
	cout << mx << "\n";
}
SubtaskSumTestVerdictTimeMemory
base12/80
1Accepted0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/21ms508 KiB
4Wrong answer0/22ms316 KiB
5Wrong answer0/21ms404 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/42ms316 KiB
8Wrong answer0/42ms508 KiB
9Wrong answer0/241ms1848 KiB
10Wrong answer0/241ms1964 KiB
11Wrong answer0/241ms1956 KiB
12Wrong answer0/241ms1964 KiB
13Wrong answer0/241ms1844 KiB
14Wrong answer0/241ms1972 KiB
15Wrong answer0/241ms1844 KiB
16Wrong answer0/241ms1960 KiB
17Wrong answer0/241ms1844 KiB
18Wrong answer0/241ms1844 KiB
19Wrong answer0/241ms1844 KiB
20Wrong answer0/241ms1844 KiB
21Wrong answer0/241ms1844 KiB
22Wrong answer0/241ms1976 KiB
23Wrong answer0/41ms544 KiB
24Accepted4/41ms316 KiB
25Wrong answer0/41ms316 KiB
26Accepted4/426ms1964 KiB
27Wrong answer0/439ms1964 KiB
28Wrong answer0/441ms1844 KiB
29Wrong answer0/441ms1964 KiB
30Accepted2/241ms2164 KiB
31Accepted2/239ms1844 KiB
32Wrong answer0/241ms1844 KiB
33Wrong answer0/241ms1844 KiB