Archive for the ‘college’ Category

Evil Exam Over !!

May 9, 2008

Hey, Guys long time illa, My Exams were over today. The Feeling is so nice and i guess this will be one reason if I say that I like Exams. (i.e. the feeling after it gets over !!)… Ofcorz, I wont say that I like Exams.

Some Things which happen to me when there is Exam the next day

*   Exams want me to memorise things which is very HARD for me :(

*   When I start reading some lesson(usually the first Lesson), I become very much involved in it, sometimes I even search for something related in the internet. ( cmon, wot is the purpose of exams, to make you learn, so learn it properly :p) . Eventually After some time I become tired, and then fall Asleep :D.

*   I end up in the examination hall only reading a couple of lessons out of five lessons !! I manage to write some crap for the questions from other lessons from the things other people discuss after I go to college on the morning of the Dday.

*   I never get the urge to read for Exams staying awake. I never had the drive to get high marks or gud grades or whatever…

Now you can hyperlink this blog topic for word “Lazy Boy” !! Did you hear that Wikipedia ???

ICPC 007 !! B-)

December 30, 2007

The Amrita University Organised the ICPC @ its Amritapuri Campus, Kerela.

Our Team: CSpirit

Members : Me, Shankar, Siddharth (Shankar is the new member of the team due to unknown reasons !!)

Let me start with the Online Round:

We did the online round well but still i thot we were slow. We were supposed to use one login per team but still 3 of us were in our respective homes. We decided that I shd login and do the submissions and stuff but hell broke loose when i was unable to even view the mooshak page !! Sidd took the job and pasted all the problem statements in rafb.net. I submitted for 1 of the problem to get AC in 55th minute. 1st AC !! habba !!… “Wot are u guys doing ?”. “sidd: I am trying B da.. Try anything else”. I started doin the other problem (not B). The prob was to “represent prime numbers in words”. Sidd got AC for prob B by 1.15 or something. By the time i finished coding, shanky was also done. I was confident.. so Sidd submitted my code to get AC !! Hurray.. We are all Done !!

We came in 9th place. We were the only team to get AC(Accepted) for all the 3 problem in 1 shot with no penalties :D. They selected 2 Teams from each college. So The other team from m y class was not selected :(. (we had even got tickets) . The Juniors team got thro.

Regionals:

The Train Trip was not bad. The Amritapuri guys were very courteous. They received us in station even thought we didnt ask for a pick up. The hostel room given to us was very big. nice room. nice washroom. nice place. They provided us with free supply of mineral water bottles! We went to the college. They gave us Internet Facility, which we used to some extent. The Food was not that great though.

Another Notable thing about the college was that, wherever u go, the place would hv been labelled “Boys” and “Girls” in 2 sides. Be it the lab, canteen, auditorium. Is the college is very strict wrt to boys and gals…? (atleast the banners not there in my coll !!) . I knew I was wrong later. U cant see only boys or only gals doin something: Be it eating in the canteen or taking care of some part of the event.

I didnt talk with many of other ppl. except for ThreeAces and Chocolat from CEG. and Ckrackers from MIT-our coll !! CEG seniors were very free going. They said they organise some of events @ kurukshetra. Said they would come to Samhita too. I knew Anusha and Aruna of Chocolat from ICPC-2006 and had known them primarily thro the Internet. In Kerela, talked with them in real-time. We even took a photo.

 

kerela-amrita-icpc007

I took Camera to kerela to take photos.. I forgot to take camera to all the places and ended up without any photos.. This is the only photo i have now.

In Kerela, most of the gals were better than tamil gals esp. manyfold better than my college ! hope u undstd… :( -> :(( … When we were in the internet lab, some gal volunteers were guiding us with getting print outs. We wished these gals dont come to the contest for obvious reasons !! One of them said us that Prasanna (aka Thala, Singam, Singa-Kutti …) would be delivering a speech. Thala was shivering all the time giving speech. After the speech, He was able to identify me to my surpise. He also Identified Shankar…coz they talked in Kanpur.

Prasanna: Thala…

Shankar: <mum>

Vijay: macha, wot is this, prasanna is takin to u. ur not talking ?

Shankar: <mum>

After some time,

Vijay: Y u didnt talk to prasanna? Clg Gals kitta than olunga pessa matta … Maintaining Ur Taaru Maaru Geth even with Prasanna. ?

Shankar: Dei.. avanllam range da..!

Vijay: He called u thala da !!

Shankar: Avan enna ottaran da.. In Kanpur, I asked him “Wen are u going to become target?”…adhunala than ippo enna Kalaikarthuku apdi sonnan da.

Vijay: Edo solra.

During our stay, we were late to all the events, from arriving at the station, goin to breakfast, lunch, dinner, attending speech , … getting bus for departing … We missed the Kaliripattu performance coz we slept !!

Practice Contest:

Did very very silly mistakes which drank our time. like

1) Trying to find the bug in prime function even without calling it !

2) counting no. of days in the year as 355.

3) Got confused with a simple if else statement involing &&, || operators

At the End of the Practice Contest… we were not in the first page of the rank-list… that too with easy questions. ofcorz it would hv been easy for everyone ! Chocolat was very fast and they were in 5th position. We were wondering may be we shd hav practiced together before. I remembered Anusha tellin me that they attended all contest together. We knew that they gave solutions for practice problems below the qns themselves only after the end of the contest !! Sidd said “when we solve the problems which chocolat solves in the same time penalty.. we would surely get gud position” haa.. but that might not be that easy. Sidd: “And ofcorz we should solve one more problem !!”… hmm pakkalam…

BackWater Boating:

The Amrita ppl also took us for Boat Riding along Back Waters. It was not bad.. it seemed that the scene repeated itself: coconut trees, fish nets, houses. The co-ords came to our cabin and asked to sing. The guy was seein just me and tellin to sing… reason being all others dont even seemed to hear to him. Jnr. Vikram said me “y dont u sing ?”… “Naan padina ellarum thannila kuthichiruvanga da!!”… “Super idea, senior, Ella teamum thannila villunthutta… neenga first vanthurunga, nanga second.”… lol.

The Main Contest :

They gave username and password for linux only with the Qpaper.. Ahhh… which meant I hv to spend the contest time for typing headers and stuffs :(…

We had decided to split the Qns and so that the easiest problem can be identifed soon by one of us. There were 8 problems. The first prob i read looked easy.. So i started… After some debugging, I got AC for it in 30 min. When we looked at the rank list. XTC++ was first solving each of the problems in 10 min. Chocolat was second with almost same time. (semma fast!! ). Sidd had hand coded that other problem. He started typing it.. while me and Shankar read the other problems. In more than 5 minutes, he finished it and submitted to get WA.. !! boo !! sidd: “Dei.. WA da chaaa” Others: “seri.. porumaiya par ethavadu thappu panni irrupa”.

After few minutes of debugging.. he identified his stupid bug and then got AC. That was our final AC. Shankar had finished one of the problems involing two balls rolling over and under irregular plane. He was struck up with some bayangaramana case. Sidd and Shanky was thkin over it. At that time, I was coding a Min. Spanning Tree for one of the problems. After much struggle, I was able to code it out. Sidd and Shanky decided to skip the ball rolling prob and switch to another problem which was simple but involved careful handling of many cases. They were hand-coding it. Tho I got correct ans for Sample I/O for the min. spanning tree prob,,, I felt something was missing something. I got WA when I submitted. I got print out and Sidd and Shank Coded the prob they were doing. I helped them out in finding out beautiful no.s which was part of that problem and also in debugging some logical error in it.

I left the minimum. Spanning tree prob and went to simulation prob. which involed rotating a cube in various directions. I was able to handcoded it in a short time. When Sidd and Shanky gave up on their prob when only 10.00 min was left.. i started coding the simulation… The time was not enof for me.. but i got some output in some 20 min. after the contest ended.. I would hv done that had i started on that long bk ! :(

We tried all the problem except a couple of them. When the contest ended, We were in the 22nd place. Our juniors had Solved 3 probs( :) ). They were in 15th place.

Ranklist can be found here.

We talked with prasanna after the contest. We found that bayangaramana case for ball-rolling problem is not present and that such a case is not possible as per the problem statement.. Alas.. !! May be we should hv tried submitting it without that case.

Prasanna said for that min. spanning tree problem.. we should apply shortest-path-algo after finding the min. spanning tree.. I got that only after some thinking. Prasanna had set 4 of the contest questions. He was also one of the judges.

Post Contest Analysis in the hostel showed us that we would hv got AC for 5 of the problems if we had worked little more smarter. The other 3 required us to hv more knowlege on Algos and only one or two teams solved them. Much more to learn about teamwork, co-operation and stuffs.

Juggernaut sep07

September 23, 2007

The Computer Society of MIT started conducting Juggernaut from this September as a monthly campus event. The event includes several rounds including Puzzles, problem solving, algorithms(for circuit brchs), programming(for circuit brchs), core tech qns(for mech stream), computer designing (for mech stream). The Chairman told me while asking for comments about the event “Some Third yr student suggested doing programming contests thro Computer Society to Ramgopal and he approached me regarding this and thats how we started this event”. He did not know then that “Some Third yr student” was me !! :D.

Ok Coming to the event, It was very nice having 3 rounds. I and Suryanarayanan were a team and we completed all the 3 rounds and became Winners of Juggernaut sep07 !! hehe…. Another thing i would always remember bout the event is about the teamname. Initially we had given a team-name “Anything for Namitha” cool ha… The co-ords said durin round 1 to change the team name or else they may disqualify us !! :( Thus, We were already famous before the whole event started…. so we changed our teamname to “code-freaks”…. hmm…   In the finals we beat Siddharth’s team. They had sufficient amount of time penalty to become runner ups !!!

I give here the questions and our solutions of those qns we solved during the final programming round of the event:

Password Cracking :

 

Mario is a student of Final Year IT. Mario is a typical gethu MIT student who rarely attends class.Now he’s so much worried over the issue of Marks for attendance. His attendance marks would definitely be zero only.If he somehow manages to get marks in it he’ll clear the final year.

 

So he thinks of breaking into the COE office and changing the attendance marks in the computer there.The computer that holds the marks of students are placed in a secured room which no one can break into. The computer wont allow the third time wrong entering of the password and would raise an alarm and would get caught.The only way to get into is through the entrance which is protected by a security computer.Only after typing the password in the keyboard there one can enter the room.

 

The password cant be guessed or hacked through any means.The only way is to bring out the password from the hands of the COE officer,Mr.Paritchai Vendhan.The COE officer has a low memory.So he has a list of passwords in hand stored in a file .Once in fifteen days he selects one word from the list and sets as the password.Mario somehow managed to get that password file consisting of words N > 3 . But the only problem is that he has to get that correct password from it.So he devised one method.

 

Mario gifted Mr.Paritchai Vendhan a pen as a gift which was coated with a fluorescent marking material.When he took the pen in his hands ,his hands were stained with that invisible fluorescent marking material.What ever objects he touched were stained with that material which is invisible under normal light but can be viewed under a fluorescent light.Without knowing these he typed his password (with his stained hands )and entered the room . That night Mario came to that Computer room and he used a fluorescent light to look through the keys which were stained with that material,(ie) the keys that the COE officer used to type the password.As everyone knew our Mario is strong enough in action & adventures but very poor in logics and computers.

 

So with that password file in hand and the key strokes that he could decipher from the keyboard , now help Mario in finding the password and help him clear the final year,after all he’s your senior.It is noted that all passwords are in lowercase and numbers can also appear.

 

Input:

Input consists of T,the no of test cases ,where T<=10

Each test case consists of N , where 3<N<40 followed by N words each on a new line.

Each word doesnt exceed 15 characters.

K , no of keys that has a stain impression on it followed by K keys on a single line.

 

Output :

It must print one word for each test case each on a separate line.

If no words are matchin print NOP

if more than one words match print each word separated by a space on a single line in ascending order

 

 

Sample Input:

2

5

monkey

honey

donkey

sad

honest

6

ykonme

4

are

busy

mine

worse

4

mtbi

 

Sample Output:

monkey

NOP

 

Sum Of Perfect Cubes :

A perfect cube is an integer whose cube root is an integer ie a whole number . Eg : 1 , 8 , 27 , 64 , 125 are perfect cubes .

You are given an int low and an int high . You have to find the sum of all perfect cubes that lie between low and high also including low and high .

NOTE : Here we have sizeof(int) as 4 since we are using 32 bit rep.

 

CONSTRAINTS :

 

  • The first line in the input file contains no. of test cases .

  • Each test case is separated by an empty line.

  • Each test case satisfies the following conditions :

  • Value of low(first line) ranges from 2 to 2^31-1 both inclusive.

  • Value of high(second line) ranges from low to 2^31-1 both inclusive.

  • The output should contain one line for every test case.

  • Each line in the output must be the sum of all the perfect cubes cubes in the given range.

 

Sample Input :

3

1

1

 

7

63

 

7

65

 

Sample Output:

1

35

99

Graph Printing :

A scientist needs to analyze his research based on the graphical representation of his experiment’s output. All the results need to be plotted in a two dimensional graph of which X-axis and Y-axis represents some parameter. The graph will contain only three symbols as follows:

 

/ “– Represents a unit increase in the previous value of Y-axis

_“- Represents no change in the previous value of the Y-axis.

\“- Represents a unit decrease in the previous value of the Y-axis.

(Quotes for clarity only)

 

X-value increases uniformly at the rate of one unit.

 

You are provided with the sequence of these symbols based on the result. Your task is to print the representation of the graph with X and Y value starting from 0. X-value increases by one for each Y-value. Sample input and output is given below.

 

Constraints :

 

  • First line of input contains no. of test cases.

  • Each test case has a single line containing either of the 3 characters ‘_‘,’/’and ’\’.

  • Each test case has between 2 characters and 20 characters both inclusive.

  • Ouput should contain the representation for each test case.

 

Sample Input:

4

////___\\\\

 

\\\/\/\

 

/_\_/_\

 

___///

 

Sample Output:

___

/ \

/ \

/ \

/ \

 

\

\

\/\/\

 

_ _

/ \_/ \

 

 

/

/

___/

SOLUTION TIME!!!

PASSWORD CRACKING
The problem can be reduced to : From a given list of words W, find the words which contain all but only the letters in the word L. Many ways to solve this problem. One way is to use 2 flag arrays for each of the words: 1 for letters of size 26 and 1 for numbers of size 10. The index in the flag arrays corresponding to a word is 1 if that letter or number appears in the word.
Have a flag array pair for each of the words in W and one flag array pair for the word L. Output all words in W whose flag array pair is same as flag pairs corresponding to L. if none of them exist, output NOP.

SUM OF PERFECT CUBES
A Brute Force Approach could solve this problem.
long long i;
for(i = 1; i*i*i <= high; i++)
{
if(i*i*i >= low) sum += i*i*i;
}
print sum
But If u Belive u are decendents of ramanujam try to solve d prob in o(1) mathmatically !!
GRAPH PRINTING
With atmost 20 characters, the graph cannot go away from horizontal range 0-20 and vertical range of 20 to -20. Wot we can do it declare an array of size 50*25 say… arr[50][25]. Start plotting ur graph from the point arr[25][0]…
After that for each character in the given string S…. S[i] ull plot it in the graph at the position arr[j][i]… j is determined by the graph positon for the character S[i-1] and the character S[i-1] itself. A little thot on this is the only thing left which is left as exercise for the reader !!

 
 

NSO Camp !!

July 23, 2006

This shd possibly be the first camp in ma life….
There r some important things i feel i have learnt during my camp!
U can stay mentally fit only if u stay physically fit !! I learnt it from the way i slept during my camp… Sleeping was like something which never happened …..
After u wake up in the morning (around 5.30) , u feel ur mind so fresh to do stuff….(just the mind… coz the body wont be in any condtion to say like that) …..
we will go round the college for a couple of slow runs ……The beauty of our college during that early morning was simply GR8….hard to explain it wid the vocabulary i know..!!
well do warm ups.. and start playing shuttle …The coach will teach us some new tricks and proper methods of doing stuff…(which we r supposed to follow)
At around 8 .,,,, we go to the mess… to have Fooooood!!
My apetite increased a lot.. during this camp…. i ate to my satisfaction and then we go to our room… take the bucket and go to the bathroom and finish off things….
come back and ull find that its time for the next session at 10.00..
Ull be taught one of these thing…during that session…
* Yoga
* Aerobics
* First Aid
* Kundalini Yoga & Kaya Kalpa
I shd say all of them was pretty useful i learned something new in every one of them….
All of them r meant for us to regularly practice in our house!! :P
At 12.00 all roads(i mean the only road !!) lead to da Mess once again….
WoW…We then feel ourself free till 4.00…..
U can then find most of us in our dreams……
We used to play Chess during that time…it was Fun
The 4.00 session is a replica of the morning session….but for the fact that we dont leave to canteen after its over….
We continue to play till around 8.00….after which we go to…..where else?? To da mess…!!
after that…. we head to our rooms….We did not miss da FIFA wid a TV kept at the new hostel…..
during the Ghana Vs Brazil match….
To everyones surprise… there was more Ghana supporters…..
cheering up their favourites……by singing Ghana Songs!! lolz!!
we used to chit-chat upto 11.00 or even later… then gradually go to sleep…..
Whether the next day is saturday or sunday….There is no change to our shedule….the ssame things go on……until the 10th day!!
We had culturals after the camp-fire…
It was very nice ….and thus my unforgettable NSO camp came to a conclusion….

Reservation Rules !!

May 16, 2006
  • So its been a long time ha !!
    Well today My mind is full of thinking bout this reservation issue ! I have myself been a prey to this largely during my college admissions Being in TamilNadu and hav to face this 69% reservation….Its gr8 that u coudnt get a opportunity like that elsewhere in the country..!
    So u see I had to compete wid all brainy ppl for that lesser than 31%. seats that which will also be used for physically handicapped and army personnel..
    So I will say It is like making the target of an archer smaller in size so that its difficult for him. But in our society i would say this target shrinking had made the elite more elite. And the reservation is in no way helping those who are poor but is acting as a short cut for those ppl who say they r backward ( but r in no way backward ) to achieve gud position with comparative lower effort… INJUSTICE ! :( X-(

Great Project to Start !?

April 15, 2006

    I dont remember exactly how it all started… but i became very involved in various logics of solving of solving a sudoku… and about  how the various logics can be implemented using a computer. I even discussed it with my friends…

One fine moment, it dawned on me, y not do it as my PDS project !!

The time i spent later on the project is one of most interesting and was fun. I was using the little knowledge i had in programming C  (Yep, i Was a Bio Student in School and hv just learnt basics of c programming in my first semester of my college..)  to simulate wot i had in mind for solving a sudoku…  I was able to learn lot.. learnt how to code big stuffs, how to debug, and many things… I learned later from Varun Snr that  i hv implemented backtracking to solve it. I named it ‘trial and error’ technique b4..  and i hd also created a special data-structure for the purpose… desc follows:

The data structure is a tree.. with each NODE having the sudoku 9*9 grid as a data member, In addition it had a NODE** which can be made to point to a dynamically allocated ‘n’ NODE*. Each of these ‘n’ NODE* points to the possible board positions after making an assumption on the current node… I backtrack when i find there can be no assumptions made and the grid is incomplete… if the grid is complete then thats the solution grid.  :)…

Not to forget the inteface part…  I spent day and night to build interface for the sudoku solver using GLADE inteface designer

This is the first step in my coding career !! :)

Submitted my PDS project !!!
It was appreciated by the examiners, Asked me to continue the same thing in the forthcoming years..
Hope i do so like that :)

Projects

April 12, 2006

    Heh submitted my digital project (a 4 bit calculator) . Things went well
Working on my PDS project ( Sudoku Solver )

Very Busy

April 3, 2006

I just dont know what to do??
1) Will I finish my PDS project.
2) will i study for the forthcoming practical exams
3) or should i do my Digital Project
4) When am i gonna read the whole book for all the subjects (i hav always dreamt lik that)
I guess i will just do what I am going to do !!