Sphere Online Judge

SPOJ Problem Set (classical)

3. Substring Check (Bug Funny)

Problem code: SBSTR1

Given two binary strings, A (of length 10) and B (of length 5), output 1 if B is a substring of A and 0 otherwise.

Please note, that the solution may only be submitted in the following languages: Brainf**k, Whitespace and Intercal.

Input

24 lines consisting of pairs of binary strings A and B separated by a single space.

Output

The logical value of: 'B is a substring of A'.

Example

First two lines of input:

1010110010 10110
1110111011 10011

First two lines of output:
1
0


Added by:Adrian Kosowski
Date:2004-05-01
Time limit:7s
Source limit:50000B
Languages:WSPC BF ICK

hide comments
2010-02-17 06:24:16 wecing
http://en.wikipedia.org/wiki/Brainfuck
2010-02-11 20:41:13 Rahul G
Better question... "Why" to learn BrainFuck and Whitespace?
2010-02-02 18:24:56 Saikiran
BrainF**k is far better than the other two though all three are equally esoteric
2010-02-01 08:43:31 ElemeNtLz.
Can anyone tell me how to solve this problem?``
2010-01-04 18:35:45 Zubaydulla
How to learn BrainF**k and Whitespace
SPOJ System © 2008-2010 Sphere Research Labs. All Rights Reserved.