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 1725. Sold Out!

why WA5??
Posted by 123 17 Oct 2009 17:41
#include<stdio.h>


int n,k,answer;
int main()
{
scanf("%d %d",&n,&k);
int len = n/2;


if(k==len)
{
printf("0");
return 0;
}
else if(k<len)
{
answer = len - k;
}
else
{
answer = k - len - 1;
}

printf("%d",answer);
}
Re: why WA5??
Posted by Tolya_wolf 15 Jan 2010 11:27
I have the same problem:
test no. 5, wrong answer.
(Sorry, i don't know english well)
Я запихнул свой алгоритм в циклы for, ввод всех возможных значений, вывод.
Просмотрел всё вручную, нет ошибок!
Re: why WA5??
Posted by Zefick 19 Mar 2010 17:37
  Carefully read the condition.
  Visitor chooses a side in such a way that the number of people over whose feet he will stumble will be minimal.
  It is not always the shortest path.

  Внимательнее читайте условие.
  Зритель выбирает сторону так, чтобы споткнуться о меньшее число людей.
  Это не всегда наикратчайший путь.
Re: why WA5??
Posted by DNS 8 Jun 2010 03:24
Try test  50 50  answer 47
          40-20  18
          40 27  24
          ....
          ????
          PROFIT!!!

Edited by author 08.06.2010 03:26

Edited by author 08.06.2010 03:27
Re: why WA5??
Posted by ONU_Antananarivu 26 Jul 2011 15:37
k == n is the same situation as k == 1
Re: why WA5??
Posted by Yaroslav 1 Mar 2020 23:45
you are ...