FEU - East Asia College ACM Student Chapter


Join the forum, it's quick and easy

FEU - East Asia College ACM Student Chapter
FEU - East Asia College ACM Student Chapter
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» “Cochin builders: Symbol of Innovative Architecture”
Programming Challege EmptyThu Jul 18, 2013 8:11 pm by shevsoe

» SPICE (Cobol IDE)
Programming Challege EmptyMon May 06, 2013 5:36 pm by 200730059

» YMCA and Global Services
Programming Challege EmptyThu Sep 01, 2011 2:35 pm by Rene Churchill

» useDelimeter
Programming Challege EmptyThu Jun 23, 2011 11:02 am by ern_andrew

» The City of Cochin
Programming Challege EmptyThu Jun 16, 2011 7:31 pm by GhosnBachelder

» LIFE and LOVE GURU
Programming Challege EmptySat Oct 09, 2010 1:42 am by kggc09

» Interested to be an Adhoc?
Programming Challege EmptyFri Oct 08, 2010 2:47 pm by rmsalazar

» Meeting! Officers + Members (Open Meeting)
Programming Challege EmptyFri Oct 08, 2010 2:45 pm by rmsalazar

» Indescribable - Louis Giglio
Programming Challege EmptyThu Oct 07, 2010 12:03 am by rmsalazar

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar


Programming Challege

+2
angelie
scirtem
6 posters

Go down

Programming Challege Empty Programming Challege

Post by scirtem Tue Jul 20, 2010 1:17 am

Warm-up problem

Try it yourselves without the help of Larry Page and Sergey Brin!!!

Do not post your solution here...

PM me your solution!!!

----------------------------------------------------------------------------

Jolly Jumpers

A sequence of n > 0 integers is called a jolly jumper if the absolute values of the difference between successive elements take on all the values 1 through n-1. For instance,

1 4 2 3

is a jolly jumper, because the absolutes differences are 3, 2, and 1 respectively. The definition implies that any sequence of a single integer is a jolly jumper. You are to write a program to determine whether or not each of a number of sequences is a jolly jumper.

Input

Each line of input contains an integer n <= 3000 followed by n integers representing the sequence.

Output

For each line of input, generate a line of output saying "Jolly" or "Not jolly".

Sample Input

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

Sample Output

Jolly
Not jolly

scirtem
Level 0

Posts : 4
Reputation : 0
Join date : 2010-07-08
Age : 42

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by angelie Wed Jul 21, 2010 8:46 am

cyclops
angelie
angelie
Level 0

Posts : 25
Reputation : 0
Join date : 2010-07-07

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by arscariosus Wed Jul 21, 2010 7:18 pm

Each line of input contains an integer n <= 3000 followed by n integers representing the sequence.

waaaa. hindi ko maintindihan. T_T ibig sabihin may array[3000] ?

basag ang comprehension ko dito T_T


Last edited by arscariosus on Wed Jul 21, 2010 11:35 pm; edited 3 times in total

arscariosus
Level 0

Posts : 69
Reputation : -1
Join date : 2010-07-07
Age : 22
Location : Philippines

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by paulgarcia Wed Jul 21, 2010 8:00 pm

imba! kahirap nmn nyan.

paulgarcia
paulgarcia
Level 0

Posts : 2
Reputation : 0
Join date : 2010-07-21

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by paulgarcia Wed Jul 21, 2010 8:01 pm

pang CS kc....^^
paulgarcia
paulgarcia
Level 0

Posts : 2
Reputation : 0
Join date : 2010-07-21

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by Chyrl Thu Jul 22, 2010 12:12 am

paulgarcia wrote:pang CS kc....^^
Whether your BSCS or not, trying to solve this will increase your logic thinking.
Remember, almost all computer related courses are basically full of logic...
Chyrl
Chyrl
Level 0

Posts : 16
Reputation : 0
Join date : 2010-07-12

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by Chyrl Thu Jul 22, 2010 12:13 am

arscariosus wrote:
Each line of input contains an integer n <= 3000 followed by n integers representing the sequence.

waaaa. hindi ko maintindihan. T_T ibig sabihin may array[3000] ?

basag ang comprehension ko dito T_T

Try reading between the lines.
I might help you understand what is meant by n <= 3000.
Chyrl
Chyrl
Level 0

Posts : 16
Reputation : 0
Join date : 2010-07-12

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by rmsalazar Thu Jul 22, 2010 7:18 am

david signature mo..XD
rmsalazar
rmsalazar
Level 1

Posts : 129
Reputation : 2
Join date : 2010-07-06
Age : 32

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by arscariosus Thu Jul 22, 2010 7:20 pm

Chyrl wrote:
arscariosus wrote:
Each line of input contains an integer n <= 3000 followed by n integers representing the sequence.

waaaa. hindi ko maintindihan. T_T ibig sabihin may array[3000] ?

basag ang comprehension ko dito T_T

Try reading between the lines.
I might help you understand what is meant by n <= 3000.

Sir I think I get the first part about the absolute differences and the 1..n-1 range. But I might be wrong. Plus I can't comprehend this line. Hmm... Each line of input... Does that mean the program could accept multiple lines of input at a time? And a line that has a single integer in it is automatically a jolly jumper?

arscariosus
Level 0

Posts : 69
Reputation : -1
Join date : 2010-07-07
Age : 22
Location : Philippines

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by Chyrl Thu Jul 22, 2010 10:02 pm

arscariosus wrote:Does that mean the program could accept multiple lines of input at a time?
Maybe, it depends on the logic of your code.
Have you acquired to right output[n] for the given input[n], where n is the number of test cases?
Chyrl
Chyrl
Level 0

Posts : 16
Reputation : 0
Join date : 2010-07-12

Back to top Go down

Programming Challege Empty Re: Programming Challege

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum