Submission #19247684


Source Code Expand

Copy
#include <iostream>
#include <vector>

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

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 686 Byte
Status WA
Exec Time 145 ms
Memory 8376 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 142 ms 8300 KB
10-random-01.txt AC 14 ms 8324 KB
10-random-02.txt AC 80 ms 8272 KB
10-random-03.txt WA 102 ms 8308 KB
10-random-04.txt WA 56 ms 8172 KB
20-absW-00.txt AC 132 ms 8268 KB
20-absW-01.txt AC 16 ms 8296 KB
20-absW-02.txt AC 72 ms 8376 KB
20-absW-03.txt AC 112 ms 8164 KB
20-absW-04.txt AC 52 ms 8180 KB
30-balance-00.txt WA 141 ms 8316 KB
30-balance-01.txt AC 19 ms 8300 KB
30-balance-02.txt AC 53 ms 8168 KB
30-balance-03.txt WA 83 ms 8176 KB
30-balance-04.txt WA 99 ms 8184 KB
40-limit_dim-00.txt WA 144 ms 8176 KB
40-limit_dim-01.txt WA 145 ms 8304 KB
40-limit_dim-02.txt WA 140 ms 8164 KB
40-limit_dim-03.txt WA 140 ms 8304 KB
40-limit_dim-04.txt WA 143 ms 8364 KB
40-limit_dim-05.txt WA 142 ms 8272 KB
40-limit_dim-06.txt WA 140 ms 8124 KB
Corner1.txt WA 15 ms 8324 KB
Sample1.txt AC 16 ms 8244 KB