Submission #2448623
Source Code Expand
#include <iostream> #include <cstdlib> #include <cstdio> #include <cstring> #include <vector> #include <algorithm> #include <set> #include <string> using namespace std; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define REP(i, k, n) for (int i = (int)(k); i <(int)(n); i++) #define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--) #define rREP(i,k,n) for (int i = (int)(n)-1; i >= k; i--) #define mod 1000000007 long long dp[110][110][110] = {}; int main() { rep(i,101)rep(j,101)rep(k,101) dp[i][j][k] = 0; int n,m; cin >> n >> m; rep(i,n) { int a,b,c; long long w; cin >> a >> b >> c >> w; dp[a][b][c] = w; } rep(a,101){ rep(b,101){ rep(c,101){ if(a) dp[a][b][c] = max(dp[a][b][c],dp[a-1][b][c]); if(b) dp[a][b][c] = max(dp[a][b][c],dp[a][b-1][c]); if(c) dp[a][b][c] = max(dp[a][b][c],dp[a][b][c-1]); } } } rep(i,m){ int x,y,z; cin >> x >> y >> z; cout << dp[x][y][z] << endl; } return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Optimal Recommendations |
User | ajinori |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1042 Byte |
Status | WA |
Exec Time | 182 ms |
Memory | 10880 KB |
Judge Result
Set Name | All | ||||
---|---|---|---|---|---|
Score / Max Score | 0 / 100 | ||||
Status |
|
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 | 173 ms | 10880 KB |
10-random-01.txt | AC | 7 ms | 10368 KB |
10-random-02.txt | AC | 86 ms | 10752 KB |
10-random-03.txt | WA | 115 ms | 10752 KB |
10-random-04.txt | WA | 59 ms | 10496 KB |
20-absW-00.txt | AC | 161 ms | 10624 KB |
20-absW-01.txt | AC | 7 ms | 10368 KB |
20-absW-02.txt | AC | 83 ms | 10496 KB |
20-absW-03.txt | AC | 128 ms | 10624 KB |
20-absW-04.txt | AC | 51 ms | 10496 KB |
30-balance-00.txt | WA | 172 ms | 10880 KB |
30-balance-01.txt | AC | 7 ms | 10368 KB |
30-balance-02.txt | AC | 49 ms | 10624 KB |
30-balance-03.txt | WA | 94 ms | 10496 KB |
30-balance-04.txt | WA | 111 ms | 10880 KB |
40-limit_dim-00.txt | WA | 182 ms | 10880 KB |
40-limit_dim-01.txt | WA | 179 ms | 10880 KB |
40-limit_dim-02.txt | WA | 179 ms | 10880 KB |
40-limit_dim-03.txt | WA | 174 ms | 10880 KB |
40-limit_dim-04.txt | WA | 179 ms | 10880 KB |
40-limit_dim-05.txt | WA | 176 ms | 10880 KB |
40-limit_dim-06.txt | WA | 173 ms | 10880 KB |
Corner1.txt | WA | 7 ms | 10368 KB |
Sample1.txt | AC | 7 ms | 10368 KB |