Submission #503308

#TimeUsernameProblemLanguageResultExecution timeMemory
503308rainboyAkcija (COCI21_akcija)C11
10 / 110
1 ms296 KiB
#include <stdio.h> #define N 2000 int main() { static int ww[N], dd[N], 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 %lld\n", k_, (long long) ww[0] * k_); return 0; }

Compilation message (stderr)

Main.c: In function 'main':
Main.c:9:2: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  scanf("%d%d", &n, &c);
      |  ^~~~~~~~~~~~~~~~~~~~~
Main.c:11:3: warning: ignoring return value of 'scanf' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |   scanf("%d%d", &ww[i], &dd[i]), dd[i]--;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...