Submission #8403789
Source Code Expand
#include <iostream> #include <algorithm> #include <vector> 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 (){ vector<vector<ll> > dp(M_MAX, vector<ll>(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 | 972 Byte |
Status | RE |
Exec Time | 2521 ms |
Memory | 0 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 | TLE | 2492 ms | -561696 KB |
10-random-01.txt | RE | 1905 ms | -560924 KB |
10-random-02.txt | RE | 1937 ms | -561100 KB |
10-random-03.txt | RE | 1922 ms | -560992 KB |
10-random-04.txt | TLE | 2521 ms | -560828 KB |
20-absW-00.txt | RE | 1914 ms | -561020 KB |
20-absW-01.txt | RE | 1879 ms | -561292 KB |
20-absW-02.txt | TLE | 2513 ms | -560956 KB |
20-absW-03.txt | RE | 1687 ms | -560900 KB |
20-absW-04.txt | RE | 1753 ms | -561056 KB |
30-balance-00.txt | RE | 1836 ms | -560988 KB |
30-balance-01.txt | RE | 1736 ms | -560932 KB |
30-balance-02.txt | RE | 1745 ms | -561296 KB |
30-balance-03.txt | RE | 1698 ms | -560904 KB |
30-balance-04.txt | RE | 1671 ms | -560736 KB |
40-limit_dim-00.txt | RE | 1818 ms | -560560 KB |
40-limit_dim-01.txt | RE | 1823 ms | -560680 KB |
40-limit_dim-02.txt | RE | 1957 ms | -560736 KB |
40-limit_dim-03.txt | RE | 1819 ms | -560928 KB |
40-limit_dim-04.txt | RE | 1826 ms | -560844 KB |
40-limit_dim-05.txt | RE | 1744 ms | -560800 KB |
40-limit_dim-06.txt | RE | 1997 ms | -560656 KB |
Corner1.txt | TLE | 2231 ms | -560800 KB |
Sample1.txt | RE | 1681 ms | -561180 KB |