216002026-01-13 17:05:47algoproBájital (80 pont)cpp17Wrong answer 8/80298ms540 KiB
// UUID: a1db69a1-0c3a-441f-a5cc-a4050d9a35ed
#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
base8/80
1Accepted0/01ms316 KiB
2Wrong answer0/01ms316 KiB
3Wrong answer0/21ms316 KiB
4Wrong answer0/21ms316 KiB
5Wrong answer0/21ms316 KiB
6Wrong answer0/21ms388 KiB
7Wrong answer0/42ms316 KiB
8Wrong answer0/42ms396 KiB
9Wrong answer0/237ms540 KiB
10Wrong answer0/239ms396 KiB
11Wrong answer0/239ms508 KiB
12Wrong answer0/239ms400 KiB
13Wrong answer0/239ms400 KiB
14Wrong answer0/239ms396 KiB
15Wrong answer0/241ms396 KiB
16Wrong answer0/239ms400 KiB
17Wrong answer0/239ms396 KiB
18Wrong answer0/241ms400 KiB
19Wrong answer0/243ms524 KiB
20Wrong answer0/245ms316 KiB
21Wrong answer0/246ms316 KiB
22Wrong answer0/248ms400 KiB
23Wrong answer0/41ms316 KiB
24Accepted4/41ms316 KiB
25Wrong answer0/41ms316 KiB
26Accepted4/420ms400 KiB
27Wrong answer0/459ms396 KiB
28Wrong answer0/4135ms392 KiB
29Time limit exceeded0/4231ms400 KiB
30Time limit exceeded0/2298ms316 KiB
31Time limit exceeded0/2279ms316 KiB
32Wrong answer0/237ms316 KiB
33Wrong answer0/237ms316 KiB