Submission #19247605


Source Code Expand

Copy
#include <iostream>
#include <vector>

int N = 0, M = 0;
long long dp[101][101][101] = {};

int main() {
	std::cin >> N >> M;

	for (int i = 0; i < N; i++)
	{
		int a, b, c;
		std::cin >> a >> b >> c;
		std::cin >> dp[a][b][c];
	}

	for (int i = 0; i <= 100; i++)
		for (int j = 0; j <= 100; j++)
			for (int k = 0; k <= 100; k++)
			{
				if (i > 0)dp[i][j][k] = std::max(dp[i][j][k], dp[i - 1][j][k]);
				if (j > 0)dp[i][j][k] = std::max(dp[i][j][k], dp[i][j - 1][k]);
				if (k > 0)dp[i][j][k] = std::max(dp[i][j][k], dp[i][j][k - 1]);
			}

	for (int i = 0; i < M; i++)
	{
		int x, y, z;
		std::cin >> x >> y >> z;
		std::cout << dp[x][y][z] << std::endl;
	}

	return 0;
}

Submission Info

Submission Time
Task C - Optimal Recommendations
User h0geh0ge
Language C++ (GCC 9.2.1)
Score 0
Code Size 710 Byte
Status WA
Exec Time 147 ms
Memory 11668 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 10
WA × 14
Set Name Test Cases
All 10-random-00.txt, 10-random-01.txt, 10-random-02.txt, 10-random-03.txt, 10-random-04.txt, 20-absW-00.txt, 20-absW-01.txt, 20-absW-02.txt, 20-absW-03.txt, 20-absW-04.txt, 30-balance-00.txt, 30-balance-01.txt, 30-balance-02.txt, 30-balance-03.txt, 30-balance-04.txt, 40-limit_dim-00.txt, 40-limit_dim-01.txt, 40-limit_dim-02.txt, 40-limit_dim-03.txt, 40-limit_dim-04.txt, 40-limit_dim-05.txt, 40-limit_dim-06.txt, Corner1.txt, Sample1.txt
Case Name Status Exec Time Memory
10-random-00.txt WA 147 ms 11500 KB
10-random-01.txt AC 24 ms 11596 KB
10-random-02.txt AC 86 ms 11600 KB
10-random-03.txt WA 106 ms 11664 KB
10-random-04.txt WA 57 ms 11560 KB
20-absW-00.txt AC 136 ms 11508 KB
20-absW-01.txt AC 18 ms 11592 KB
20-absW-02.txt AC 74 ms 11452 KB
20-absW-03.txt AC 113 ms 11600 KB
20-absW-04.txt AC 57 ms 11564 KB
30-balance-00.txt WA 143 ms 11508 KB
30-balance-01.txt AC 21 ms 11492 KB
30-balance-02.txt AC 55 ms 11576 KB
30-balance-03.txt WA 85 ms 11648 KB
30-balance-04.txt WA 106 ms 11668 KB
40-limit_dim-00.txt WA 147 ms 11452 KB
40-limit_dim-01.txt WA 142 ms 11452 KB
40-limit_dim-02.txt WA 143 ms 11504 KB
40-limit_dim-03.txt WA 143 ms 11560 KB
40-limit_dim-04.txt WA 144 ms 11644 KB
40-limit_dim-05.txt WA 141 ms 11600 KB
40-limit_dim-06.txt WA 140 ms 11580 KB
Corner1.txt WA 20 ms 11664 KB
Sample1.txt AC 20 ms 11564 KB