Submit | All submissions | Best solutions | Back to list |
EMP - University Employees |
On some island each inhabitant is either a knight who only tells the truth, or a liar who always lies. Also, on the island there exists a university of technology where some of the inhabitants work. All of the university employees will always tell you the following two things, no matter which employee you ask:
It is also known that no two employees of the university have an identical salary, and no two work equally. Write a program which will compute how many persons are employed by this university.
Input
The only input line contains two integers N and M, with one space between them [N, M <= 1000000000].
Output
The output must contain only one integer - the total number of employees of this university, or 0 if there is no way to find the number of employees.
Example
Input: 1 1 Output: 2
Author: Filimonenkov D.O.
Added by: | Roman Sol |
Date: | 2006-04-24 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ERL JS-RHINO NODEJS PERL6 VB.NET |
Resource: | ZCon 2007 |
hide comments
|
|||||||
2012-04-15 13:43:17 Alex
Smallest Code I've ever written in Spoj. Saw the testcase wrote down my first idea, got AC :) |
|||||||
2012-03-24 00:17:29 brainf*cker
too hard! |
|||||||
2012-01-11 10:30:42 saket diwakar
can anyone please give some more test cases...i did'nt understood properly |
|||||||
2011-12-12 12:22:51 Tommy Adhyasa S.
this is not a problem at all... -__-" |
|||||||
2011-12-09 15:22:13 qwerty
PROBLEM SHOULD BE DELETED... |
|||||||
2011-07-24 20:41:14 blashyrkh
Is it possible that N=M=0? I think: N=0 ==> he is definitely a liar, but he answered a truth on the second question. Contradiction? |
|||||||
2011-06-12 05:50:12 azer
should not be in tutorial, should not be in anywhere, delete this problem Last edit: 2011-06-12 05:50:34 |
|||||||
2011-06-07 17:32:18 ashutosh gautam
plz can anyone provide more test cases? |
|||||||
2011-05-29 21:05:39 ~
check out test cases?? |
|||||||
2010-12-16 05:08:22 Hapsoro Adi Permana
should be in tutorial |