Saratov State University :: Online Contester


::Go
- home
- news
- register
- update personal info
- problemset archive
- submit
- status online
- standing
- contests
- virtual contests
- forum
- statistic
- FAQ
- links
- projects

::Poll
Are you registered on Codeforces?
Yes
No
What is it???

[results]

::webboard

time limit on twst 10
Author: guguli
ID: 049831
Problem: 168
Contest: 0
Date: 2012-08-15 18:14:18

why time limit on test 10?
it is my code :

#include <iostream>
using namespace std;
const int maxn=1005;
int d2[maxn][maxn],d1[maxn][maxn];
int main()
{
int n,m;
cin>>n>>m;
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
cin>>d1[i][j];
for(int i=n;i>0;i--)
for(int j=1;j<=m;j++)
{
if(i==n)
d2[i][j]=d1[i][j];
else
d2[i][j]=min(d1[i][j],d2[i+1][j]);
}
for(int j=m;j>0;j--)
for(int i=1;i<=n;i++)
{
if(j==m)
d1[i][j]=d2[i][j];
if(j!=m && i==1)
d1[i][j]=min(d1[i][j+1],d2[i][j]);
if(j!=m && i!=1)
d1[i][j]=min(d1[i-1][j+1],d2[i][j]);
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
cout<<d1[i][j]<<" ";
cout<<endl;
}

return 0;
}


see sub-tree reply to that message


::Login
Forgot password?

::News
22.10.12 - The problems from the Southern Subregional Programming Contest 2012 added to the problemset archive (542 - 553).
22.10.12 - After the start of the contest the statements in PDF will be available by the link.
23.10.11 - The problems from the Southern Subregional Programming Contest 2011 added to the problemset archive (530 - 541).

::Counter

Server time: 2017-09-22 20:58:17Online Contester Team © 2002 - 2016. All rights reserved.