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:BF ICK WSPC

hide comments
2010-07-23 15:15:58 mahmoud saleh
very easy
2010-06-22 18:09:10 Shrainik Jain
my code is running fast enough on my machine(less than a second) but here it shows time limit exceeded... can someone suggest as to what i might have done wrong??
2010-06-11 16:46:09 Jargon
eather:
If you could do this with C++, it would be too easy. This problem is intended to challenge your ability in BF, WS, and ICK.
2010-06-04 12:53:13 iftekhar ahmed
cant i do by C++?
2010-05-18 05:47:12 Otto.x3
Hello,
What BF compiler is used to check the solution?
2010-05-07 00:59:39 Craig H
Warning, bff-1.0.3.1 uses signed numbers so if after subraction a number goes negative you can't get to zero using -.
My suggestion is to debug using bff-1.0.3.1 to catch this problem
2010-05-04 09:23:37 Christopher Dunn
My code works fine with brainfuck.go, but it goes into an infinite loop printing '<' with bff-1.0.3.1.
2010-04-29 14:32:15 Ahmed Shafeeq Bin Mohd Shariff
Whitespace ftw
2010-04-28 07:28:47 Bastian Schweinsteiger
http://www.matrix67.com/blog/archives/168
2010-04-23 05:11:30 Alina
wow !!! what a language !!! only ,.<>+-[]

Last edit: 2010-04-23 05:15:38
SPOJ System © 2010 Sphere Research Labs. All Rights Reserved.