Contest Duration: - (local time) (120 minutes)

Submission #19179350

Source Code Expand

Copy
```#include <iostream>
#include <iomanip>
#include <fstream>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <cmath>
#include <chrono>

using namespace std;

bool w_compare(vector<int64_t> v, vector<int64_t> u) {
return v[3] < u[3];
}

int main(int argc, const char * argv[]) {

ios::sync_with_stdio(false);
cin.tie(0);

int N, M; cin >> N >> M;
vector<vector<int64_t>> abcw(N + 1, vector<int64_t>(4));
abcw[0][0] = abcw[0][1] = abcw[0][2] = abcw[0][3] = 0;
for (int i = 1; i <= N; i++) cin >> abcw[i][0] >> abcw[i][1] >> abcw[i][2] >> abcw[i][3];
sort(abcw.begin(), abcw.end(), w_compare);

vector<vector<vector<int>>> dp(101, vector<vector<int>>(101, vector<int>(101, N)));

for (int i = 100; i >= 0; i--) {
for (int j = 100; j >= 0; j--) {
for (int k = 100; k >= 0; k--) {
int cl = N;
cl = min(cl, dp[i][j][min(100, k + 1)]);
cl = min(cl, dp[i][min(100, j + 1)][k]);
cl = min(cl, dp[min(100, i + 1)][j][k]);
while (abcw[cl][0] > i || abcw[cl][1] > j || abcw[cl][2] > k) cl--;
dp[i][j][k] = cl;
}
}
}

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

return 0;

}
```

#### Submission Info

Submission Time 2021-01-03 15:47:58+0900 C - Optimal Recommendations parsley69 C++ (GCC 9.2.1) 100 1466 Byte AC 461 ms 11116 KB

#### Compile Error

```./Main.cpp: In function ‘int main(int, const char**)’:
./Main.cpp:19:14: warning: unused parameter ‘argc’ [-Wunused-parameter]
19 | int main(int argc, const char * argv[]) {
|          ~~~~^~~~
./Main.cpp:19:33: warning: unused parameter ‘argv’ [-Wunused-parameter]
19 | int main(int argc, const char * argv[]) {
|                    ~~~~~~~~~~~~~^~~~~~
```

#### Judge Result

Set Name All
Score / Max Score 100 / 100
Status
 AC × 24
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 AC 155 ms 11060 KB
10-random-01.txt AC 21 ms 7588 KB
10-random-02.txt AC 76 ms 7816 KB
10-random-03.txt AC 103 ms 8968 KB
10-random-04.txt AC 68 ms 10268 KB
20-absW-00.txt AC 461 ms 10976 KB
20-absW-01.txt AC 13 ms 7620 KB
20-absW-02.txt AC 365 ms 10944 KB
20-absW-03.txt AC 220 ms 9440 KB
20-absW-04.txt AC 85 ms 8464 KB
30-balance-00.txt AC 151 ms 11060 KB
30-balance-01.txt AC 13 ms 7636 KB
30-balance-02.txt AC 52 ms 7908 KB
30-balance-03.txt AC 100 ms 10916 KB
30-balance-04.txt AC 94 ms 7864 KB
40-limit_dim-00.txt AC 148 ms 11112 KB
40-limit_dim-01.txt AC 147 ms 11020 KB
40-limit_dim-02.txt AC 144 ms 10948 KB
40-limit_dim-03.txt AC 147 ms 10996 KB
40-limit_dim-04.txt AC 149 ms 11112 KB
40-limit_dim-05.txt AC 146 ms 11056 KB
40-limit_dim-06.txt AC 145 ms 11116 KB
Corner1.txt AC 16 ms 7488 KB
Sample1.txt AC 14 ms 7644 KB