# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
254123 | rama_pang | Coins (LMIO19_monetos) | C++14 | 157 ms | 262148 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 80;
const int INF = 1e8;
int N, K1, K2;
int A[305][305];
int ans[305][305];
int L[MAXN][MAXN];
int dp[MAXN][MAXN][MAXN * MAXN / 2];
array<int, 3> pr[MAXN][MAXN][MAXN * MAXN / 2];
void Solve() {
int shift = max(1, N / 75);
int NN = N / shift;
for (int i = 1; i <= N; i++) {
for (int j = 1; j <= N; j++) {
int di = (i + shift - 1) / shift;
int dj = (j + shift - 1) / shift;
L[di][dj] += A[i][j];
}
}
for (int i = 1; i <= NN; i++) {
for (int j = 1; j <= NN; j++) {
L[i][j] += L[i][j - 1];
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |