Submission #19247666


Source Code Expand

Copy
#include <iostream>
#include <vector>

int N = 0, M = 0;
int 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++)
			{
				dp[i + 1][j][k] = std::max(dp[i][j][k], dp[i + 1][j][k]);
				dp[i][j + 1][k] = std::max(dp[i][j][k], dp[i][j + 1][k]);
				dp[i][j][k + 1] = 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 683 Byte
Status WA
Exec Time 143 ms
Memory 7616 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 4
WA × 20
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 142 ms 7500 KB
10-random-01.txt AC 12 ms 7372 KB
10-random-02.txt WA 79 ms 7516 KB
10-random-03.txt WA 103 ms 7568 KB
10-random-04.txt WA 55 ms 7424 KB
20-absW-00.txt WA 132 ms 7604 KB
20-absW-01.txt AC 14 ms 7416 KB
20-absW-02.txt WA 71 ms 7500 KB
20-absW-03.txt WA 111 ms 7564 KB
20-absW-04.txt WA 52 ms 7416 KB
30-balance-00.txt WA 139 ms 7616 KB
30-balance-01.txt AC 13 ms 7508 KB
30-balance-02.txt AC 52 ms 7436 KB
30-balance-03.txt WA 81 ms 7512 KB
30-balance-04.txt WA 100 ms 7376 KB
40-limit_dim-00.txt WA 142 ms 7496 KB
40-limit_dim-01.txt WA 143 ms 7436 KB
40-limit_dim-02.txt WA 141 ms 7536 KB
40-limit_dim-03.txt WA 140 ms 7380 KB
40-limit_dim-04.txt WA 142 ms 7604 KB
40-limit_dim-05.txt WA 140 ms 7572 KB
40-limit_dim-06.txt WA 139 ms 7572 KB
Corner1.txt WA 13 ms 7604 KB
Sample1.txt WA 13 ms 7500 KB