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 1107. Warehouse Problem

wow i got AC with less than 10line prog!!!!!
Posted by Locomotive 9 Jan 2003 00:45
Var
  i,k,t               :word;
begin
  readln(i,k,t);
  writeln('YES');
  for i:=1 to k do
  begin
    readln(t);
    writeln(2-(t mod 2));
  end;
end.

1-use pairity
2-always yes (m>=2)

Aidin_n7
But this means that bad tests because it's wrong solution. I don't understand why you got accepted!!!
Posted by Yuriy Frolov (ufrolov@ukr.net) 9 Jan 2003 03:31
> Var
>   i,k,t               :word;
> begin
>   readln(i,k,t);
>   writeln('YES');
>   for i:=1 to k do
>   begin
>     readln(t);
>     writeln(2-(t mod 2));
>   end;
> end.
>
> 1-use pairity
> 2-always yes (m>=2)
>
> Aidin_n7
Re: But this means that bad tests because it's wrong solution. I don't understand why you got accepted!!!
Posted by Locomotive 9 Jan 2003 19:53
WHy?
what you think wrong?
tell me a test case with answers u think it is.
Aidin_n7
use this (+)
Posted by Yuriy Frolov (ufrolov@ukr.net) 9 Jan 2003 22:09
For example this test on which your programe give wrong answer.
3 3 2
3 1 2 3
2 1 2
1 1 3
I'm sorry. But this (+)!
Posted by Yuriy Frolov (ufrolov@ukr.net) 9 Jan 2003 23:21
3 2 2
3 1 2 3
3 1 2 3
SO what will be wrong?
Posted by Locomotive 10 Jan 2003 09:07
> 3 2 2
> 3 1 2 3
> 3 1 2 3
~~~~~~~~~~~~~~~~~~~~
that testcase in my program gives:
YES
1
1

*** both of sets goes to first shop
*** and nothing will go to the second (as in program said: It is
possible not to send any set to one or more shops.[3line before input
in program])

*** and also 1 2 3 (first set) and (1 2 3) second set is different
and and and !!!

*** Employees of this warehouse made k different [!!!] sets of theese
goods. [line 2 of program]

~~~~~~~~~~~~~~~~~~~~~
thanks for your conversation Dear yuriy... (thanks from Aydin in Iran)
You are right!!!I think that 1 2 3 and 1 2 3 are similar.Thanks for conversation.
Posted by Yuriy Frolov (ufrolov@ukr.net) 10 Jan 2003 14:38
Hey Aidin_n7!! Who is Nah_ni?
Posted by Илья Гофман (Ilya Gofman) 10 Jan 2003 18:36
Is it your girlfriend?
Re: Hey Aidin_n7!! Who is Nah_ni?
Posted by Locomotive 11 Jan 2003 18:46
> Is it your girlfriend?
Yes, she is who gives me help by her loves to solve this programs.
I Really love her because she is best girl i have ever seen.
Aidin_n7
You Are Welcome
Posted by Locomotive 11 Jan 2003 21:05
> You are welcome dear
Wish to have nice time...
and also i wish we help eachother to succeed in ratings ;)
Thanks again my First Frined in acm.timus.ru
Aidin_n7@hotmail.com
Re: use this (+)
Posted by liufeng 26 Jan 2003 10:04
no
the m should be larger than n
this test is wrong!!


> For example this test on which your programe give wrong answer.
> 3 3 2
> 3 1 2 3
> 2 1 2
> 1 1 3
If you yet want to see test on wich this program fails
Posted by Agh 15 Feb 2003 00:28
5 2 6
4 1 2 3 4
4 1 5 4 3

Your answer:
YES
2
2

but this sets are similar (see task description) so they couldn't be
in one shop
you mistake indeed! and don`t understand what does "similar" means
Posted by Locomotive 3 Jun 2003 21:19
Problem says:

We'll say that two sets are "similar" if one of them is obtained by
deleting one good form the second set or by replacing one good to
another.

ok?

notice that OR is XOR in mentioned sentence!
more clear:
only deleting (deleting one good form the second set)
OR
Only replacing (replacing one good to another.)

by this meaning you can`t delete and replace in same time

So:

4 1 2 3 4
4 1 5 4 3

Are not similar
because you can`t make one of them from the other one by just 1 work
you need to
1: delete 2 from first set
2: insert 5 in second set

and It`s 2 work not 1 work...
then these are not similar

Best Regards
Aidin_n7
Re: you mistake indeed! and don`t understand what does "similar" means
Posted by Stinger 4 Jun 2003 11:19
Problem also says:
E.g. Set "1 2 3 4" is similar to sets "3 2 1", "1 2 5 3 4", "1 2 3 4
2" and "1 5 4 3"
So sets "1 2 3 4" and "1 5 4 3" are similar !!!

And in Polar's test

5 2 6
4 1 2 3 4
4 1 5 4 3

(n=5)<(m=6) and (k=2) (which satisfies problem's limitations
101>m>n>0 & k<=50000)
and string "4 1 2 3 4" defines a set consisting of 4 elements "1 2 3
4"
(but not a set "4 1 2 3 4" consisting of 5 elements).
On all fours, "4 1 5 4 3" defines a set consisting of 4 elements "1 5
4 3"
(but not a set "4 1 5 4 3" consisting of 5 elements).
Therefore, this test is absolutely correct    :)

Stinger
Re: you mistake indeed! and don`t understand what does "similar" means
Posted by Vlad Ionescu 7 Jun 2003 18:27
I agree with Stinger. However this solution gets accepted (though it
distributes sets 1 and 2 - 1 3 5 6 4 and 1 3 5 6 3 -from the example
at the same shop, and they seem simillar to me). So either the tests
used are very bad, or the problem text is unclear...
Re: you mistake indeed! and don`t understand what does "similar" means
Posted by ChenXiXing(SCAU) 20 Apr 2004 15:36
the host is so clever ,you use the bug of this problem.there are not the same is good.only two shop is ok
Re: you mistake indeed! and don`t understand what does "similar" means
Posted by Igor Dex 18 May 2004 00:51
The description of the problem is definately unclear.

For example "...or by replacing one good to
another."

What is replacing ???

1. We can get a good for replacing in the warehouse or
2. Replacing is when we take a good from one set and put it into another one. Then the sets 1 2 3 and 1 2 3 7 7 are the same, because we can get 7 from the second set and put it into the first set. We'll have 1 2 3 7 and 1 2 3 7.