Submission #8403764
Source Code Expand
#include <iostream> #include <algorithm> using namespace std; #define REP(i,n) for(int i = 0; i < (int)n; i++) #define N_MAX 50000 #define M_MAX 50000 typedef long long ll; int N, M; int a[N_MAX], b[N_MAX], c[N_MAX]; ll w[N_MAX]; int x[M_MAX], y[M_MAX], z[M_MAX]; bool workable(int i, int j){ if(a[j] <= x[i] && b[j] <= y[i] && c[j] <= z[i]) return true; else return false; } void solve (){ ll dp[M_MAX][N_MAX + 1]; REP(i,M){ REP(j,N){ if(workable(i, j)) dp[i][j + 1] = max(dp[i][j], w[j]); else dp[i][j + 1] = dp[i][j]; } } REP(i,M) cout << dp[i][N] << endl; } int main (){ cin >> N >> M; REP(i,N) cin >> a[i] >> b[i] >> c[i] >> w[i]; REP(i,M) cin >> x[i] >> y[i] >> z[i]; solve(); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Optimal Recommendations |
User | molinuntius |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 924 Byte |
Status | RE |
Exec Time | 195 ms |
Memory | 1792 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 | RE | 185 ms | 1792 KB |
10-random-01.txt | RE | 98 ms | 256 KB |
10-random-02.txt | RE | 123 ms | 768 KB |
10-random-03.txt | RE | 142 ms | 1024 KB |
10-random-04.txt | RE | 140 ms | 1024 KB |
20-absW-00.txt | RE | 172 ms | 1792 KB |
20-absW-01.txt | RE | 101 ms | 256 KB |
20-absW-02.txt | RE | 147 ms | 1408 KB |
20-absW-03.txt | RE | 150 ms | 1280 KB |
20-absW-04.txt | RE | 117 ms | 640 KB |
30-balance-00.txt | RE | 181 ms | 1792 KB |
30-balance-01.txt | RE | 97 ms | 256 KB |
30-balance-02.txt | RE | 111 ms | 512 KB |
30-balance-03.txt | RE | 160 ms | 1408 KB |
30-balance-04.txt | RE | 135 ms | 896 KB |
40-limit_dim-00.txt | RE | 195 ms | 1792 KB |
40-limit_dim-01.txt | RE | 193 ms | 1792 KB |
40-limit_dim-02.txt | RE | 191 ms | 1792 KB |
40-limit_dim-03.txt | RE | 186 ms | 1792 KB |
40-limit_dim-04.txt | RE | 191 ms | 1792 KB |
40-limit_dim-05.txt | RE | 187 ms | 1792 KB |
40-limit_dim-06.txt | RE | 187 ms | 1792 KB |
Corner1.txt | RE | 98 ms | 256 KB |
Sample1.txt | RE | 99 ms | 256 KB |