215912026-01-13 16:58:44algoproBájital (80 pont)cpp17Wrong answer 4/80300ms508 KiB
// UUID: f1e3a52a-3f91-43d5-bc5b-e23638691b54
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, x, a, kettes, legh, minh;
	cin >> n >> x;
	kettes = 0;
	legh = 0;
	vector<int> h;
	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/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/21ms500 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms400 KiB
6Wrong answer0/21ms316 KiB
7Wrong answer0/42ms316 KiB
8Wrong answer0/42ms316 KiB
9Wrong answer0/237ms316 KiB
10Wrong answer0/237ms500 KiB
11Wrong answer0/237ms500 KiB
12Wrong answer0/237ms316 KiB
13Wrong answer0/239ms500 KiB
14Wrong answer0/239ms404 KiB
15Wrong answer0/239ms500 KiB
16Wrong answer0/239ms316 KiB
17Wrong answer0/239ms316 KiB
18Wrong answer0/239ms500 KiB
19Wrong answer0/241ms400 KiB
20Wrong answer0/243ms392 KiB
21Wrong answer0/246ms316 KiB
22Wrong answer0/246ms316 KiB
23Wrong answer0/41ms316 KiB
24Wrong answer0/41ms316 KiB
25Wrong answer0/41ms320 KiB
26Accepted4/419ms404 KiB
27Wrong answer0/457ms392 KiB
28Wrong answer0/4135ms316 KiB
29Time limit exceeded0/4231ms400 KiB
30Time limit exceeded0/2300ms316 KiB
31Time limit exceeded0/2286ms316 KiB
32Wrong answer0/235ms508 KiB
33Wrong answer0/235ms332 KiB