Submission #2524686
Source Code Expand
#include <vector> #include <list> #include <map> #include <set> #include <queue> #include <deque> #include <stack> #include <bitset> #include <algorithm> #include <functional> #include <numeric> #include <utility> #include <sstream> #include <iostream> #include <iomanip> #include <cstdio> #include <cmath> #include <cstdlib> #include <ctime> #include <string> #include <climits> #include <tuple> using namespace std; typedef long long ll; typedef pair<int,int> P; typedef tuple<int,int,int,int> T; int main(){ int n,m; cin>>n>>m; T corp[50000]; int x[50000],y[50000],z[50000]; int dp[101][101][101]; for(int i=0;i<101;i++)for(int j=0;j<101;j++)for(int k=0;k<101;k++)dp[i][j][k]=0; for(int i=0;i<n;i++){ int a,b,c,d; cin>>a>>b>>c>>d; corp[i]=T(a,b,c,d); dp[a][b][c]=max(dp[a][b][c],d); } for(int i=0;i<101;i++){ for(int j=0;j<101;j++){ for(int k=0;k<101;k++){ dp[i][j][k]=max(dp[i][j][(k==0)? k:k-1],max(dp[i][j][k],max(dp[(i==0)? i:i-1][j][k],dp[i][(j==0)?j:j-1][k]))); } } } for(int i=0;i<m;i++){ 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 | luogu_bot5 |
Language | C++ (GCC 5.4.1) |
Score | 0 |
Code Size | 1200 Byte |
Status | CE |
Compile Error
In file included from /usr/include/c++/5/tuple:35:0, from ./Main.cpp:22: /usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options. #error This file requires compiler and library support \ ^ ./Main.cpp:26:9: error: ‘tuple’ does not name a type typedef tuple<int,int,int,int> T; ^ ./Main.cpp: In function ‘int main()’: ./Main.cpp:30:3: error: ‘T’ was not declared in this scope T corp[50000]; ^ ./Main.cpp:37:5: error: ‘corp’ was not declared in this scope corp[i]=T(a,b,c,d); ^