X-burguer
This commit is contained in:
commit
815e707dbc
18
codeforces/round-105/e/.vscode/c_cpp_properties.json
vendored
Normal file
18
codeforces/round-105/e/.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "linux-gcc-x64",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**"
|
||||||
|
],
|
||||||
|
"compilerPath": "/usr/bin/gcc",
|
||||||
|
"cStandard": "${default}",
|
||||||
|
"cppStandard": "${default}",
|
||||||
|
"intelliSenseMode": "linux-gcc-x64",
|
||||||
|
"compilerArgs": [
|
||||||
|
""
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
24
codeforces/round-105/e/.vscode/launch.json
vendored
Normal file
24
codeforces/round-105/e/.vscode/launch.json
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "C/C++ Runner: Debug Session",
|
||||||
|
"type": "cppdbg",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [],
|
||||||
|
"stopAtEntry": false,
|
||||||
|
"externalConsole": false,
|
||||||
|
"cwd": "/tmp/files/problem-solutions/codeforces/round-105/e",
|
||||||
|
"program": "/tmp/files/problem-solutions/codeforces/round-105/e/build/Debug/outDebug",
|
||||||
|
"MIMode": "gdb",
|
||||||
|
"miDebuggerPath": "gdb",
|
||||||
|
"setupCommands": [
|
||||||
|
{
|
||||||
|
"description": "Enable pretty-printing for gdb",
|
||||||
|
"text": "-enable-pretty-printing",
|
||||||
|
"ignoreFailures": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
31
codeforces/round-105/e/.vscode/settings.json
vendored
Normal file
31
codeforces/round-105/e/.vscode/settings.json
vendored
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"C_Cpp_Runner.cCompilerPath": "gcc",
|
||||||
|
"C_Cpp_Runner.cppCompilerPath": "g++",
|
||||||
|
"C_Cpp_Runner.debuggerPath": "gdb",
|
||||||
|
"C_Cpp_Runner.cStandard": "",
|
||||||
|
"C_Cpp_Runner.cppStandard": "",
|
||||||
|
"C_Cpp_Runner.msvcBatchPath": "",
|
||||||
|
"C_Cpp_Runner.useMsvc": false,
|
||||||
|
"C_Cpp_Runner.warnings": [
|
||||||
|
"-Wall",
|
||||||
|
"-Wextra",
|
||||||
|
"-Wpedantic"
|
||||||
|
],
|
||||||
|
"C_Cpp_Runner.enableWarnings": true,
|
||||||
|
"C_Cpp_Runner.warningsAsError": false,
|
||||||
|
"C_Cpp_Runner.compilerArgs": [],
|
||||||
|
"C_Cpp_Runner.linkerArgs": [],
|
||||||
|
"C_Cpp_Runner.includePaths": [],
|
||||||
|
"C_Cpp_Runner.includeSearch": [
|
||||||
|
"*",
|
||||||
|
"**/*"
|
||||||
|
],
|
||||||
|
"C_Cpp_Runner.excludeSearch": [
|
||||||
|
"**/build",
|
||||||
|
"**/build/**",
|
||||||
|
"**/.*",
|
||||||
|
"**/.*/**",
|
||||||
|
"**/.vscode",
|
||||||
|
"**/.vscode/**"
|
||||||
|
]
|
||||||
|
}
|
||||||
BIN
codeforces/round-105/e/E. Porcelain
Executable file
BIN
codeforces/round-105/e/E. Porcelain
Executable file
Binary file not shown.
99
codeforces/round-105/e/E. Porcelain.cpp
Normal file
99
codeforces/round-105/e/E. Porcelain.cpp
Normal file
@ -0,0 +1,99 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
#define V vector
|
||||||
|
|
||||||
|
#define rmin(a, b) a = min(a, b)
|
||||||
|
#define rmax(a, b) a = max(a, b)
|
||||||
|
|
||||||
|
#define rep(i, lim) for (size_t i = 0; i < (lim); i++)
|
||||||
|
#define nrep(i, s, lim) for (size_t i = s; i < (lim); i++)
|
||||||
|
|
||||||
|
#define repv(i, v) for (auto &i : (v))
|
||||||
|
#define fillv(v) for (auto &itr_ : (v)) { cin >> itr_; }
|
||||||
|
#define sortv(v) sort(v.begin(), v.end())
|
||||||
|
#define all(v) (v).begin(), (v).end()
|
||||||
|
|
||||||
|
using vi = vector<int>;
|
||||||
|
using vvi = vector<vi>;
|
||||||
|
using vvvi = vector<vvi>;
|
||||||
|
using vvvvi = vector<vvvi>;
|
||||||
|
|
||||||
|
using ll = long long;
|
||||||
|
|
||||||
|
using vl = vector<ll>;
|
||||||
|
using vvl = vector<vl>;
|
||||||
|
using vvvl = vector<vvl>;
|
||||||
|
using vvvvl = vector<vvvl>;
|
||||||
|
|
||||||
|
template<class v>
|
||||||
|
auto operator<<(ostream &os, const vector<v> &vec)->ostream& {
|
||||||
|
os << vec[0];
|
||||||
|
for (size_t i = 1; i < vec.size(); i++) {
|
||||||
|
os << ' ' << vec[i];
|
||||||
|
}
|
||||||
|
os << '\n';
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class v>
|
||||||
|
auto operator>>(istream &is, vector<v> &vec)->istream& {
|
||||||
|
for (auto &i : vec) {
|
||||||
|
is >> i;
|
||||||
|
}
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class v>
|
||||||
|
auto operator<<(ostream &os, const vector<vector<v>> &vec)->ostream& {
|
||||||
|
for (auto &i : vec) {
|
||||||
|
os << i[0];
|
||||||
|
for (size_t j = 1; j < i.size(); j++) {
|
||||||
|
os << ' ' << i[j];
|
||||||
|
}
|
||||||
|
os << '\n';
|
||||||
|
}
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class v>
|
||||||
|
auto operator>>(istream &is, vector<vector<v>> &vec)->istream& {
|
||||||
|
for (auto &i : vec) {
|
||||||
|
for (auto &j : i) {
|
||||||
|
is >> j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
ios::sync_with_stdio(false);
|
||||||
|
cin.tie(nullptr);
|
||||||
|
|
||||||
|
int n, m;
|
||||||
|
cin >> n >> m;
|
||||||
|
|
||||||
|
vvl plates(n);
|
||||||
|
|
||||||
|
rep(i, n) {
|
||||||
|
int n;
|
||||||
|
cin >> n;
|
||||||
|
plates[i].resize(n);
|
||||||
|
cin >> plates[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
vvl dp(n, vl(100, 0));
|
||||||
|
for (size_t i = 0; i < n; i++) {
|
||||||
|
vvl dp2(101, vl(101, 0));
|
||||||
|
|
||||||
|
for (int k = plates[i].size() - 1; k >= 0; k--) {
|
||||||
|
for (int j = 1; j <= k; j++) {
|
||||||
|
dp2[j][k] = max(dp2[j - 1][k] + plates[i][j - 1], dp2[j][k + 1] + plates[i][k]);
|
||||||
|
rmax(dp[i][plates[i].size()-(k-j)], dp2[j][k]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cout << dp;
|
||||||
|
}
|
||||||
3
codeforces/round-105/e/E. Porcelain_input0.txt
Normal file
3
codeforces/round-105/e/E. Porcelain_input0.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
2 3
|
||||||
|
3 3 7 2
|
||||||
|
3 4 1 5
|
||||||
2
codeforces/round-105/e/E. Porcelain_input1.txt
Normal file
2
codeforces/round-105/e/E. Porcelain_input1.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
1 3
|
||||||
|
4 4 3 1 2
|
||||||
1
codeforces/round-105/e/E. Porcelain_output0.txt
Normal file
1
codeforces/round-105/e/E. Porcelain_output0.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
15
|
||||||
1
codeforces/round-105/e/E. Porcelain_output1.txt
Normal file
1
codeforces/round-105/e/E. Porcelain_output1.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
9
|
||||||
Loading…
x
Reference in New Issue
Block a user