# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
864353 | ElenaBM | Pohlepko (COCI16_pohlepko) | C++17 | 59 ms | 65536 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x, y;
cin>> x >> y;
vector<vector<string>> tab(x, vector<string>(y));
for (int i = 0; i < x; ++i){
string o;
cin>> o;
for (int j = 0; j < y; ++j){
tab[i][j] = o[j];
}
}
for (int i = 1; i < x; ++i)tab[i][0] = tab[i-1][0] + tab[i][0];
for (int j = 1; j < y; ++j)tab[0][j] = tab[0][j-1] + tab[0][j];
for (int i = 1; i < x; ++i){
for (int j = 1; j <y ; ++j){
tab[i][j] = min(tab[i-1][j], tab[i][j-1])+ tab[i][j];
}
}
cout<< tab[x-1][y-1] << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |