215942026-01-13 17:03:35algoproBájital (80 pont)cpp17Wrong answer 8/80300ms848 KiB
// UUID: 460c53a4-4a12-4995-a550-2e0a3cc3d5c3
#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;
	} else{
		cout << kettes;
	}
}
SubtaskSumTestVerdictTimeMemory
base8/80
1Wrong answer0/01ms316 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/42ms364 KiB
9Wrong answer0/237ms316 KiB
10Wrong answer0/239ms396 KiB
11Wrong answer0/239ms568 KiB
12Wrong answer0/239ms400 KiB
13Wrong answer0/239ms548 KiB
14Wrong answer0/239ms400 KiB
15Wrong answer0/241ms316 KiB
16Wrong answer0/241ms316 KiB
17Wrong answer0/241ms848 KiB
18Wrong answer0/241ms316 KiB
19Wrong answer0/243ms560 KiB
20Wrong answer0/246ms400 KiB
21Wrong answer0/246ms316 KiB
22Wrong answer0/248ms392 KiB
23Wrong answer0/41ms316 KiB
24Accepted4/41ms316 KiB
25Wrong answer0/41ms316 KiB
26Accepted4/420ms400 KiB
27Wrong answer0/459ms400 KiB
28Wrong answer0/4137ms316 KiB
29Time limit exceeded0/4233ms316 KiB
30Time limit exceeded0/2284ms316 KiB
31Time limit exceeded0/2300ms316 KiB
32Wrong answer0/237ms316 KiB
33Wrong answer0/237ms316 KiB