BFBIGTHN - "If Bigger than" in BF
Brainf*** is a Turing complete language...
what ever the arithmatic/logic operation other langs like C or LISP can do ...BF can do it also !
your task is to write a BF code to test if a is Bigger Than b ..
Input:
tow_digit_number t (number of test cases)followed by end_of_line charachter
then t lines each of them contains:
tow_digit_number a
followed by space
then tow_digit_number b
followed by ASCII(10) (End of line).
(at the end of the file there is EOF charachter which value is (-1))
output:
the logic value of (a > b) for each test case
(don't forget to print any space after each output such like '\n' or '\t' or space' ')
Example:
inputs:
09
41 92
99 40
01 20
23 00
00 01
20 30
00 09
99 00
11 12
outputs:
0
1
0
1
0
0
0
1
0
BE CAREFUL: ONLY BRAINF*** AVAILABLE FOR SUBMIT .
ENJOY ;)
Note : maybe it will be helpful for you to know that a never equal to b in the test cases ;)
hide comments
Jander:
2013-01-06 17:36:00
Time to join in the fun ;-) |
|
Mostafa 36a2:
2013-01-04 10:03:27
thanks to @Piotr Kąko for adding the problem to SHORTEN
|
|
Mostafa 36a2:
2013-01-03 17:09:52
@Tjandra Satria Gunawan : amazing ,nice idea _ it will be interesting to write the Judge :D
|
|
Robert Gerbicz:
2013-01-03 17:09:52
"easy to be classical" No, in classic there are lots of easier problems, in bf this task is nontrivial (obviously the same problem in c/c++/python would be tutorial, but that is another issue).
|
|
Aditya Pande:
2013-01-03 17:09:52
right now Tjandra's code seems to be using the most BF commands...
|
|
Mitch Schwartz:
2013-01-03 17:09:52
@Tjandra: Optimising BF interpreters (like bff used on SPOJ) don't execute commands that way, e.g. +++++ becomes a single addition of 5. So that metric doesn't seem so meaningful to me, although an interesting twist.
|
|
(Tjandra Satria Gunawan)(曾毅昆):
2013-01-03 17:09:52
@Mostafa 36a2: How about not to shorten the code, but score= BF command executed, example:
|
|
Mostafa 36a2:
2013-01-03 17:09:52
@ Aditya Pande :completely right..
|
|
Aditya Pande:
2013-01-03 17:09:52
got it in 102 bytes Last edit: 2013-01-03 11:03:33 |
|
Aditya Pande:
2013-01-03 17:09:52
i would say this is much different than the previous problem..
|
Added by: | Mostafa 36a2 |
Date: | 2012-12-27 |
Time limit: | 1s-5s |
Source limit: | 2000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | BF |
Resource: | BF it self ^_^ |