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 1642. 1D Maze

Access Violation ? (Test 1)
Posted by Mickkie 9 Jan 2013 00:13
#include<stdio.h>
int n,i,exit,leftob=-1005,rightob=1005,temp;
main()
{
      scanf("%d %d",&n,&exit);

      for (i=0;i<n;i++)
      {
          scanf("%d",&temp);
          if (temp<rightob && temp>exit)
             rightob=temp;
          if (temp>leftob && temp<exit)
             leftob=temp;
      }

      if (leftob==-1005)
         leftob=exit;
      if (rightob==1005)
         rightob=exit;

      if (exit>0)
      {
         if (leftob>0)
            printf("Impossible\n");
         else
             printf("%d %d\n",exit,-2*leftob+exit);
      }
      else
      {
          if (rightob<0)
             printf("Impossible\n");
          else
              printf("%d %d\n",2*rightob-exit,-exit);
      }
      scanf(" ");
}
Re: Access Violation ? (Test 1)
Posted by aram_gyumri 27 Mar 2013 21:21
delete this
Mickkie wrote 9 January 2013 00:13
scanf(" ");
Re: Access Violation ? (Test 1)
Posted by [TSOGU]Sabit 30 May 2015 10:32
int main()