Submission #827309

#TimeUsernameProblemLanguageResultExecution timeMemory
827309rainboyPeru (RMI20_peru)C11
Compilation error
0 ms0 KiB
#include "peru.h" #include <string.h> #define N 2500000 #define MD 1000000007 #define X 23 long long min(long long a, long long b) { return a < b ? a : b; } int max(int a, int b) { return a > b ? a : b; } int solve(int n, int k, int *aa) { static long long dp[N + 1]; int i, j, a, ans; memset(dp, 0x3f, (n + 1) * sizeof *dp), dp[0] = 0; for (i = 0; i < n; i++) { a = 0; for (j = i; j < n && j - i < k; j++) { a = max(a, aa[j]); dp[j + 1] = min(dp[j + 1], dp[i] + a); } } ans = 0; for (i = 0; i <= n; i++) ans = ((long long) ans * X + dp[i] % MD) % MD; return ans; }

Compilation message (stderr)

grader.c:1:10: fatal error: cstdio: No such file or directory
    1 | #include <cstdio>
      |          ^~~~~~~~
compilation terminated.