215952026-01-13 17:04:10algoproBájital (80 pont)cpp17Wrong answer 0/80300ms512 KiB
// UUID: b3501044-661e-4d20-ae87-51cdde5aab52
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, x, a, kettes, legh, minh;
	cin >> n >> x;
	kettes = 0;
	legh = 0;
	for(int i = 0; i < n; i++){
		cin >> a;
		if(a < x){
			kettes += a;
		} else{
			for(int j = 0; j < x; j++){
				if((a + j) %  x == 0){
					a -= (x-j);
					kettes += (x-j);
					legh += a;
					break;
				}
			}
		}
	}

	minh = legh / x;

	if(minh < kettes){
		cout << minh+1;
	} else{
		cout << kettes+1;
	}
}
SubtaskSumTestVerdictTimeMemory
base0/80
1Accepted0/01ms316 KiB
2Wrong answer0/01ms500 KiB
3Wrong answer0/21ms336 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms400 KiB
6Wrong answer0/21ms400 KiB
7Wrong answer0/42ms316 KiB
8Wrong answer0/42ms316 KiB
9Wrong answer0/237ms396 KiB
10Wrong answer0/239ms508 KiB
11Wrong answer0/239ms392 KiB
12Wrong answer0/239ms512 KiB
13Wrong answer0/239ms316 KiB
14Wrong answer0/239ms396 KiB
15Wrong answer0/241ms508 KiB
16Wrong answer0/241ms396 KiB
17Wrong answer0/241ms316 KiB
18Wrong answer0/241ms500 KiB
19Wrong answer0/243ms316 KiB
20Wrong answer0/245ms400 KiB
21Wrong answer0/246ms404 KiB
22Wrong answer0/248ms396 KiB
23Wrong answer0/41ms316 KiB
24Wrong answer0/41ms316 KiB
25Wrong answer0/41ms316 KiB
26Wrong answer0/420ms396 KiB
27Wrong answer0/459ms396 KiB
28Wrong answer0/4137ms316 KiB
29Time limit exceeded0/4233ms316 KiB
30Time limit exceeded0/2300ms316 KiB
31Time limit exceeded0/2287ms316 KiB
32Wrong answer0/237ms316 KiB
33Wrong answer0/237ms316 KiB