216072026-01-13 17:07:53algoproBájital (80 pont)cpp17Wrong answer 4/80300ms512 KiB
// UUID: 9bedf7c5-9d2e-4912-9a21-093fb58dfabd
#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 -= j;
					kettes += j;
					legh += a;
					break;
				}
			}
		}
	}

	minh = legh / x;

	if(minh < kettes){
		cout << minh;
	} else{
		cout << kettes;
	}
}
SubtaskSumTestVerdictTimeMemory
base4/80
1Accepted0/01ms508 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/42ms316 KiB
8Wrong answer0/42ms316 KiB
9Wrong answer0/235ms508 KiB
10Wrong answer0/237ms396 KiB
11Wrong answer0/237ms400 KiB
12Wrong answer0/239ms392 KiB
13Wrong answer0/239ms316 KiB
14Wrong answer0/239ms316 KiB
15Wrong answer0/241ms316 KiB
16Wrong answer0/239ms316 KiB
17Wrong answer0/239ms316 KiB
18Wrong answer0/239ms316 KiB
19Wrong answer0/241ms316 KiB
20Wrong answer0/243ms512 KiB
21Wrong answer0/246ms316 KiB
22Wrong answer0/248ms512 KiB
23Wrong answer0/42ms316 KiB
24Wrong answer0/41ms316 KiB
25Wrong answer0/41ms316 KiB
26Accepted4/419ms400 KiB
27Wrong answer0/457ms396 KiB
28Wrong answer0/4135ms500 KiB
29Time limit exceeded0/4231ms316 KiB
30Time limit exceeded0/2280ms316 KiB
31Time limit exceeded0/2300ms316 KiB
32Wrong answer0/235ms512 KiB
33Wrong answer0/235ms400 KiB