Submission #2167912
Source Code Expand
# include <iostream>
# include <algorithm>
#include <array>
# include <cassert>
#include <cctype>
#include <climits>
#include <numeric>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <tuple>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <bitset>
# include <complex>
# include <chrono>
# include <random>
# include <limits.h>
# include <unordered_map>
# include <unordered_set>
# include <deque>
# include <cstdio>
# include <cstring>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr long long MOD = 1000000000 + 7;
constexpr long long INF = 1e17 - 10;
const double PI = acos(-1);
#define fir first
#define sec second
typedef pair<LL, LL> Pll;
typedef pair<LL, pair<LL, LL>> Ppll;
typedef pair<LL, pair<LL, bitset<100001>>> Pbll;
typedef pair<LL, pair<LL, vector<LL>>> Pvll;
typedef pair<LL, LL> Vec2;
struct Tll { LL first, second, third; };
typedef pair<LL, Tll> Ptll;
#define rep(i,rept) for(LL i=0;i<rept;i++)
#define Mfor(i,mf) for(LL i=mf-1;i>=0;i--)
LL h, w, n, m, s, t, q, ans, sum,a[101][101][101],
dp[101][101][101], last;
struct Edge { LL to,cost; };
string str, ss;
pair<char,int> c[1000];
vector<char>v;
bool f[100];
void YN(bool f) {
if (f)
cout << "YES" << endl;
else
cout << "NO" << endl;
}
void yn(bool f) {
if (f)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
int main() {
cin >> n >> m;
rep(i, n) {
LL x, y, z, w;
cin >> x >> y >> z >> w;
a[x][y][z] = max(a[x][y][z], w);
}
rep(i, 101) {
rep(j, 101) {
rep(k, 101) {
dp[i][j][k] = max({ dp[i][j][k], a[i][j][k],dp[i - 1][j][k],dp[i][j - 1][k],dp[i][j][k - 1] });
}
}
}
rep(i, m) {
LL x, y, z;
cin >> x >> y >> z;
cout << dp[x][y][z] << endl;
}
return 0;
}
Submission Info
Submission Time |
|
Task |
C - Optimal Recommendations |
User |
akusyounin |
Language |
C++14 (GCC 5.4.1) |
Score |
0 |
Code Size |
1928 Byte |
Status |
RE |
Exec Time |
150 ms |
Memory |
10240 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 |
147 ms |
10240 KB |
10-random-01.txt |
RE |
97 ms |
2304 KB |
10-random-02.txt |
RE |
102 ms |
9728 KB |
10-random-03.txt |
RE |
115 ms |
10240 KB |
10-random-04.txt |
RE |
134 ms |
10240 KB |
20-absW-00.txt |
RE |
137 ms |
10240 KB |
20-absW-01.txt |
RE |
97 ms |
2304 KB |
20-absW-02.txt |
RE |
139 ms |
10240 KB |
20-absW-03.txt |
RE |
118 ms |
10240 KB |
20-absW-04.txt |
RE |
109 ms |
10240 KB |
30-balance-00.txt |
RE |
146 ms |
10240 KB |
30-balance-01.txt |
RE |
98 ms |
2304 KB |
30-balance-02.txt |
RE |
102 ms |
9856 KB |
30-balance-03.txt |
RE |
150 ms |
10240 KB |
30-balance-04.txt |
RE |
104 ms |
10112 KB |
40-limit_dim-00.txt |
RE |
147 ms |
256 KB |
40-limit_dim-01.txt |
RE |
149 ms |
8576 KB |
40-limit_dim-02.txt |
RE |
146 ms |
256 KB |
40-limit_dim-03.txt |
RE |
150 ms |
10240 KB |
40-limit_dim-04.txt |
RE |
148 ms |
256 KB |
40-limit_dim-05.txt |
RE |
148 ms |
8576 KB |
40-limit_dim-06.txt |
RE |
146 ms |
384 KB |
Corner1.txt |
RE |
98 ms |
2304 KB |
Sample1.txt |
RE |
100 ms |
4352 KB |