Submission #503307

# Submission time Handle Problem Language Result Execution time Memory
503307 2022-01-07T16:05:56 Z rainboy Akcija (COCI21_akcija) C
0 / 110
1 ms 296 KB
#include <stdio.h>

#define N	2000

int main() {
	static int ww[N], dd[N];
	static int kk[N];
	int n, c, i, d, k, k_;

	scanf("%d%d", &n, &c);
	for (i = 0; i < n; i++) {
		scanf("%d%d", &ww[i], &dd[i]), dd[i]--;
		kk[dd[i]]++;
	}
	k_ = 0;
	for (d = n - 1, k = 0; d >= 0; d--) {
		k += kk[d];
		if (k > 0)
			k--, k_++;
	}
	printf("%d %d\n", k_, ww[0] * n);
	return 0;
}

Compilation message

Main.c: In function 'main':
Main.c:10:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |  scanf("%d%d", &n, &c);
      |  ^~~~~~~~~~~~~~~~~~~~~
Main.c:12:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d%d", &ww[i], &dd[i]), dd[i]--;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -