# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
236137 | topovik | Retro (COCI17_retro) | C++14 | 384 ms | 212040 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;
#define PB push_back
#define f first
#define s second
int dp[300][300][301];
int pred[300][300][301];
int main()
{
int n,m;
cin>>n>>m;
string a[n];
for (int i=0; i<n; i++) cin>>a[i];
reverse(a,a+n);
int pos=0;
for (int j=0; j<m; j++)
if (a[0][j]=='M') pos=j;
for (int i=0; i<n; i++)
for (int j=0; j<m; j++)
for (int c=0; c<300; c++) dp[i][j][c]=-1e9;
dp[0][pos][0]=0;
for (int i=0; i<n-1; i++)
{
for (int j=0; j<m; j++)
if (a[i][j]!='*')
for (int c=0; c<300; c++)
{
for (int c1=-1; c1<=1; c1++)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |