Submission #19247445


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++)
			{
				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 704 Byte
Status WA
Exec Time 147 ms
Memory 7620 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 141 ms 7524 KB
10-random-01.txt AC 12 ms 7440 KB
10-random-02.txt AC 80 ms 7400 KB
10-random-03.txt WA 103 ms 7588 KB
10-random-04.txt WA 51 ms 7588 KB
20-absW-00.txt AC 130 ms 7584 KB
20-absW-01.txt AC 12 ms 7556 KB
20-absW-02.txt AC 69 ms 7588 KB
20-absW-03.txt AC 112 ms 7520 KB
20-absW-04.txt AC 51 ms 7560 KB
30-balance-00.txt WA 142 ms 7520 KB
30-balance-01.txt AC 12 ms 7412 KB
30-balance-02.txt AC 53 ms 7620 KB
30-balance-03.txt WA 79 ms 7552 KB
30-balance-04.txt WA 103 ms 7440 KB
40-limit_dim-00.txt WA 144 ms 7400 KB
40-limit_dim-01.txt WA 145 ms 7440 KB
40-limit_dim-02.txt WA 147 ms 7588 KB
40-limit_dim-03.txt WA 140 ms 7548 KB
40-limit_dim-04.txt WA 141 ms 7400 KB
40-limit_dim-05.txt WA 142 ms 7576 KB
40-limit_dim-06.txt WA 139 ms 7440 KB
Corner1.txt WA 13 ms 7436 KB
Sample1.txt AC 13 ms 7412 KB