ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1319. Hotel

Why I have TL?
Posted by enick 23 Mar 2008 18:17
#include <stdio.h>
//#include <stdlib.h>
int main()
{
 int a[100][100];
 int f,flag,i,j,k,n,N,E;
 scanf("%d",&N);
 E=0;
 i=-1;
 j=N;
 flag=0;
 while (E<N*N+1)
 {
   if (flag==1)
   {
    j--;
   }
   else i++;
    n=j;
    k=i;

    while (k>=0&&n>=1)
    {
      ++E;
      a[k][n]=E;
      k--;n--;


    }
    if (i>=N-1)
     flag=1;

    }
    for  (i=0;i<N;i++)
    {
     for (j=1;j<=N;j++)
      printf("%d ",a[i][j]);
      printf("\n");
     }
    return 0;
  }
Re: Why I have TL?
Posted by SorrowAngel 24 Apr 2008 14:49
enick wrote 23 March 2008 18:17
#include <stdio.h>
//#include <stdlib.h>
int main()
{
 int a[100][100];
 int f,flag,i,j,k,n,N,E;
 scanf("%d",&N);
 E=0;
 i=-1;
 j=N;
 flag=0;
 while (E<N*N+1)
 {
   if (flag==1)
   {
    j--;
   }
   else i++;
    n=j;
    k=i;

    while (k>=0&&n>=1)
    {
      ++E;
      a[k][n]=E;
      k--;n--;


    }
    if (i>=N-1)
     flag=1;

    }
    for  (i=0;i<N;i++)
    {
     for (j=1;j<=N;j++)
      printf("%d ",a[i][j]);
      printf("\n");
     }
    return 0;
  }
IT IS DONT TRUE
Re: Why I have TL?
Posted by ENick(TNU) 2 May 2008 18:55
I got AC.