Tuesday, December 13, 2011

ACt III, Scene 2: Playful Practice

My alarm rang today at 625 at which time I woke up and not feeling like getting up myself, started waking up the others, saying “Hey, its 625! Wake up; wake up!” and “Only 5 minutes left till 630!” which got Nikhil in particular very irritated. At 630, Rudy's alarm on his phone began playing The Corrs' Erin Shore and I found myself trying to figure out the notes of it in my head, while failing miserably.


After freshening up, I took a photo of my broken mirror. It was a nice compositional photograph, in which I drew a heart on my notebook and showed it as a broken heart in the reflection. I'd like to caption it as, “Mirror, mirror on the wall. Tune mera dil tod diya!” meaning “Mirror, mirror on the wall. You have broken my heart!” We later left for breakfast and registration at around 730.


The registration itself was hardly anything as compared to last year. Here, they just took our names, and took our reference documents and pointed us to our bags. It turns out that there was some Travel Grant form which we could have used to get our travel reimbursed, if it was filled in and attested by our Team Coach. Somehow, this formality slipped our notice, and we hadn't made anything of it, alas.


During breakfast, we found ourselves discussing a particular sci-fi cum evolution theme. That man would one day fill up space and then would have to go back in time and squeeze out the life of everything. Or perhaps go back in time and help right our wrongs. We discussed Aladdin's one-day-repetition movie – the one where the wise old guy says in the end, “What was meant to be, was meant to be. And the young man and his friends, were meant to be, ... Heroes.” In fact, it got so involved, with theories of physics, relativity and quantum entanglement, and other such mysteries that in the end, Nikhil suggested to me that we should a scifi story on this. A long one – about 10 pages. I agreed that it was an interesting prospect and that we should do so, but told him to make a note of what all we had discussed for our setting, since my memory was most pathetic for all these things.


After breakfast was the opening ceremony. We made our way to the hall, where we were being anointed (I can't find a better word for that red and yellow mark they put on your forehead) as we entered, with me taking photos of the other two as they went. Nikhil had his hand on his head, which Rudy found funny, and I found funny except that I thought it was done to brush back the hair from his forehead, however Nikhil maintained that its a standard custom to be done when you're being anointed.



The ceremony itself was boring. The initial part consisted of the lamp-lighting and a Bharatanatyam performance by these two girls, and this was itself quite interesting. However, later there came a few speakers who waxed eloquent on such topics that we couldn't (or atleast I couldn't) care to bother about. One of the sponsors – ipinfusion – had come with some pamphlets of their company. Reading it was a fair distraction from the proceedings. Rudy pointed out however, that among the three pamphlets that they handed out, all three had the same text, but just had difference in layout and graphics. Amused by this, I took a few pics of it as well.



When we were finally done with the opening ceremony, we headed to the practice contest area. The practice contest is where you test all the facilities and the robustness of the system you are given, and the online judge, and ask questions and pose feedback. One extremely irritating feature we noticed this year, was that they were disallowing two submissions of a team on the same problem within a short time frame. In cases where you get to debug your code, or see a very stupid error immediately, this would prove a huge hinderance, and our queries about the same seemed largely unresponsive. Also, there was one funny thing happening with the time: we had just submitted our third solution at 33 mins, but found submissions of some other teams at around 45 to 50 mins time. It turned out that that was probably due to a different contest schedule between Amrita and Coimbatore. In the process of testing all the features of the code, we even gave a Java “.class” file to be printed! All in all, the testing went well, and except for the 'too frequent submissions' issue, we were by and large happy.


By then it was already 1 and we ended our session with a few rounds of Mines, and our stomachs were rumbling when we left the hall. We quickly collected our Directi T-shirts for this year and then headed off to lunch. After lunch we had initially decided that we'd go back to the room and watch a movie – something like Into the Wild, but we turned it down in favour of browsing the internet. After a brief check around the place for where the Internet Cafe was, we sat down to some. I checked my mail and a little bit of facebook, while Nikhil and Rudy began solving the Kanpur regional. Later I called Ankita and wished her for her birthday and spoke about arbit stuff for a while, before getting back to the cafe and joining them in the problems. We just met Arijit and Srivatsan before leaving the lab, and we wished Arijit a belated birthday too.


On the way back, we stopped by Amma's and bought some biscuits and Lays in the vague intent that we would watch a movie and the snacks would come in handy. However, when we got back, we ate the snacks, and then began discussing a problem or two, during which time I fell dead asleep.


I woke up finally in time for dinner – even a bit late as such, and we went there to find it an outdoor buffet. The food was good, especially the Gobi Manchurian, which I have never had in Delhi and which I largely miss about Bangalore. Apart from the Gobi Manchurian, they also had paneer (which sucked), rice, noodles, sweet (which I thought was soup; or maybe it was some sort of sweet soup), and ice-cream. Rudy had had three rounds of ice cream by the time me and Nikhil went for our first. When we went, they had changed the containers they were being served in, since the plastic cups that they had been using were over. When I got back to Rudy with the steel cup in my hand, he was like, “Oh, you're getting what now? Gulab Jamun?” and seeing the opportunity was too good to pass by, I played along with him for a while, disappointing him that he could not have his fourth scoop.


In the end though, I did mention it to him, at which point he promptly ran off to get his scoop. Somewhat around this time, a Chennai team came to us and said “Hi! You must be Rudradev... you must be Pradeep – naiveAlgorist” etc etc. I knew it was inevitable that we'd be known by various people we would not know, but having such an encounter was still a bit unpredictable! After they left, Rudy said that he wanted a fifth ice cream, which Nikhil and me felt was pushing it too hard, and he carried on, “But isn't four the unlucky number? Like in The Atlantis Complex, Artemis Fowl feels four is unlucky, whereas five is lucky” and with that he trudged off for his fifth. The dinner ended with the three of us sitting and discussing Bangalore restaurants – the Spanish place that Rudy had a Microsoft intern party at, the Fraser town places that Nikhil loved, and ice cream joints like Corner House and Ideals (which is in Mangalore, but anyway).


We got back, and Rudy went off for a bath, while me and Nikhil began discussing his smart phone. He mentioned at this time that he had a tuner which could tell you what note you were singing. I was astounded and very happy with this and insisted we try it out at the earliest. We managed to get even a Perfect Ear training app on it which interval determining exercises and other awesome things that I keep doing in my piano class. Finally, we start playing this 'reaction-game' on his phone which is kind of like Jam, except that its not with grammatical errors but rather with a whole range of spatial, general, mathematical, and reflex action questions. I then head off for a bath myself, noticing that I'd left my soap in the bathroom from last night, and then start filling in this entry before sleeping.

Sunday, December 11, 2011

Act III, Scene 1: Goodbye Delhi, Hello Amrita

10th Dec, 2011.

I begin with our contest the night before – the final contest before the Amrita ICPC Regionals. We decided to have it at 9, and I had got my mom's guesthouse to book me a taxi from there to IIT after dinner. However, the taxi decided he'll make himself a bit late, and turned up himself at around 920. However, seemingly in penance for his lateness, he decided he'd drop me off at IIT as soon as possible, thus embarking on one of the most frightful drives I have ever been in. He wormed his way between traffic at high speeds – honking, accelerating, braking, and accelerating again; changing lanes while I sat behind swinging with the centrifugal forces and having my heart all the way up my throat.


After having dropped me at IIT at 930, I went to my room and decided to say a few late goodbyes to friends. They all were very oh-hi-how-are-you-now, what-are-you-doing-here, and other bouts of embracing and hand-shaking. In the end, I managed to extricate myself from there at 955, after having messaged Nikhil that I'd join 'em at 10, putting my batteries on for charging and getting back my pen-drive which I'd lent out before the end-semester exams.


As soon as I arrive at the gcl, Rudy says, 'Look at problems H, I, J...' A brief glance over H, and I announce that its brute-force simulation and definitely codeable. Rudy has a second look, I explain him what is required and how I would acquire it, and then sit down to code, only to realize that – wait, I have got the conditions down, but I have not got the step from one iteration to the next. Rudy then looks at it, and we start weighing different options, before he comes up with a simple, fairly elegant, and workable solution to the problem. Before he starts searching for a better more elegant method, I overrule him and tell him this'll work.


About 5 to 10 minutes later, we are sitting pretty on H solved as well. I look at problem I, work around with one vague idea, see it doesn't lead much anywhere, and then go to J. Now the problem J looked like a very slight modification of a standard algorithm, and after consulting with Rudy for a moment, we formulate a robust method of running. 10 minutes later, we have coded it, submitted it, and found it gave a TLE. As soon as we saw that, Rudy said, “Oh this is due to the negative cycles in the graph” and despite our efforts to work around it, we find ourselves hitting dead ends.


In the meanwhile, Nikhil has been working on problem B. He has working and working and has very nearly got it. There are a few bugs in his Java code, but otherwise, it would not take much time to get it working alright. With Rudy bearing down on the code, we get clear of all the bugs and make a submission: TLE. Seeing this, we try to convert the log(n) matching of the map to a O(1) matching of a hashmap. However, we are unsure of the syntax of writing hash functions and need to do a little research on it. After all this, we code it, and submit: Runtime Error.


By now, we are wondering what could it be, and we start trying various optimization approaches to help save our hide. Somewhere along the line, Rudradev says that maybe it is overusing Java's stack and causing an overflow error, that c++'s stack is much better and that we should shift to it.


Thus began one of our most strangest shifts from Java. We coded C++ pointers – something that we hadn't done since 12th std. except for a recent foray of Rudy and Nikhil in their placement interviews, and transpose the code line by line to C++. What manifests is a mountain of errors. Each attempt at clearing the errors seem to alert the compiler of newer classes of errors that it hadn't even bothered to check in the earlier compilation. What seemed like a battle against outnumbering forces, we fought our way through until it finally managed a compilation. Running the code on the sample gave no error, so we submit it. And get a TLE. Finally, we decide that we need to clear the pointers that we are using, and hence we do so. After a hesitant, “Should we submit?” we do so, and find ourselves shockingly surprised to get it AC. This turned out to be the Problem of this Year's Training, having us encompass knowledge of C++ pointers and memory allocation techniques which we have never had to resort to earlier.


In this spurt, we see a fractal problem, and after little discussion on displacement, distance, rotation and scaling, we set about coding it. The code is simple – straightforward, workable, and on the whole very doable. After a little while we run the code, and it gives us wrong answers. Fearing a change in our angles being of the wrong sign, we try other permutations of changing the signs of the angles involved to little effect. Finally, Rudy spots the error in the number of iterations of the fractal, and we find that it is now giving us perfect answers. We submit, and get it AC as well.


With just 5 minutes to go, we decide that okay, lets return to hostel and think over some problem on the way. So we discuss the problem I, where we have construct any non-intersecting polygon from n vertices. We discuss some basic strategies which we were trying to implement, but were failing on. One of which was, whenever we come across a segment intersection, we 'do a switch' so that the segments don't intersect. This somehow rang a bell with Nikhil, and he said, “Why don't we just go for TSP approximation? The bitonic path thing?” and me and Rudy look at each other and see that this is indeed good enough to give us our answer!


We reach back to our respective hostels at around 230; they go to Nil, and me to Jwala. I go to the night mess and order a Maggi, since it would be a long time since I would get it again – not that it is anything great or anything. After the Maggi, I go back up to my wing, and find blaring music of Alter Bridge's Open Your Eyes. Knowing only one person could be playing it, I go down to Raghu's room, and after he doesn't respond to my knocking, I start singing some of the lyrics from outside his room, at which point he opens it and we have our hi-byes. He says he needs some Fin Math notes and I give him whatever I have from my room.


Next is Gainda in his room; with Akash. We go there and find them just beginning to watch this Tarantino movie – True Romance (or something like that) and we sit down with them to watch it. After about 10 minutes or so though, I get a call saying that the taxi has arrived at Nil, and go to pack up by battery charger and everything and go.


The taxi arrived at around 315. We left IIT at around 330. We reached the airport before I could even close my eyes, at about 340. I remember commenting to Nikhil how I had set a timed message for 3:46 on my mobile to send to my mom that we were in the taxi, and about how it was ironic that it wasn't even 3:45 and we were already in the queue for the boarding pass!


At around this time, me and Rudy got into a discussion on Inheritance. We mainly covered the point that Eragon was Brom's son, and how people had speculated this from the first book, and how I had gotten clues and where I had gotten them from and everything. We discussed various aspects such as the Vault of Souls being a trove of Eldunari and other such fanciful theories about the final dragon egg which would have completely ticked off Nikhil, who was interested in getting the internet working and doing some coding.


We then decided we'd better get ourselves a bit considering we were unsure of doing so in the flight. So up to the food court we make our way, only to find that all the shops would open at 520, while our flight was at 555. At this time, I decided I couldn't stay awake any longer, and promptly put my head on the table and had a nap, while Rudy and Nikhil were if I am not mistaken, discussing a problem from the previous day's contest. I wake to find Nikhil gone to the toilet, while Rudy was saying that our boarding call has come with two trays of KFC food in front of him – for myself, him, and Nikhil. When Nikhil gets back, the 3 of us make our way down to the gate, with the food in our hands, virtually rushing since the call had already come while I was napping.


Our seats were right in the middle of the flight unfortunately. With the window view showing mainly the wings. Of the flight itself, there was hardly anything eventful, except for in the beginning during the sunrise Rudy pointed out the colours of the rainbow in all their vivid glory on the horizon and I began to wish that I'd had my camera in my hand baggage instead of checking it in. We had a talkative pilot on our way to Mumbai, who began telling us how happy he was to have us on the flight, that we were over Jaipur, and that this was the first time his dad was traveling in the flight piloted by him, his son. Of most of the remainder of the journey, I fell into a deep sleep, with my mouth wide open and my legs wide open and my knees jutting into the aisle due to the leg space being cramped in front by the laid back seats of the people ahead.


Apart from a few spurs of wakefulness during the journey, I finally woke up about an hour before landing in Kochi. We were then flying over Mangalore and the pilot there made note of that fact to us. It was then that me and Nikhil got into a discussion about writing techniques and stuff and he showed me this book by Ursula Le Guin about how to write with all its exercises and everything. I looked at it, and went straight to the chapter on POV having George RR Martin's Song of Ice and Fire series in mind. We discussed various aspects of Nikhil's story, that he'd sent it to his English teacher who spotted the Machiavellian in the narrator while the rest of us could not, and about using a different POV for the same situation and what would it entail to the reaction of the reader.


The flight took off early, and landed even earlier. We found ourselves waiting just outside the airport for our pickup. The corridor was long at the other end there was a crowd, so I thought that maybe he'd be there. However when reaching there, I found that was the departure gate, and I found it indeed funny that there would a crowd of people waiting outside the departure gate peering inside while the arrival gate was empty except for people from previous flights waiting outside for their own respective pickups.


When our pickup did arrive, we bundled ourselves in, and found that we barely had enough space for the three of us and our luggage. Then the volunteer who came and picked us up told us that we'd be picking up another team of 2 from IIT Bombay! In any case, we managed to squeeze here and there and adjust ourselves as best we could before stopping for lunch. Here Rudy and me had masala dosa, while Nikhil had a biriyani, and after that we topped it off with good ol' South Indian hot coffee. The rest of the journey took about 3 hours and was a bit more comfortable, and we landed up at the accommodation at around 3.


After relaxing in the room for a little bit of a while, we decide to go and find the main building and explore the old haunts. There we bump into Vallath Nandakumar, the Regional Director and we discuss various things like the ICPC Committee arriving for the event, that India would be bidding for a chance to host the World Finals some time, and a slight look at our possible competition from the site.


On the way back from the main building, we stopped at Amma (restaurant) and picked up some snacks consisting of a Lays, some biscuits and a Mirinda. After getting back to our room, we start munching on our snacks while simultaneously discussing another problem from the contest. After making much headway into it from various directions we find ourselves slightly stuck yet at the same time with somewhat a good solution in hand. Later Nikhil checks the official solutions and finds that it is one of the approaches that we had discussed.


At around 6, with about 2 hours to go for dinner, we decide to watch a movie. So taking Nikhil's external, we browse through the movies, stopping at one Fever Pitch which seemed nice it had a school environment in it somewhere. It was not a great movie, by far. But considering that it was about football fandom, and that I could not relate to it, makes me feel like I do not have the right to judge its merit as a movie. After the movie we went for dinner and registration, only to find that it had closed. Post dinner, we are too tired to do anything. I talk to Sandeep over the phone about his upcoming interview for nearly half and hour, and then decide to write this and sleep.

Intermission

Hey, wait - what?

Sorry folks, the show's been postponed. But don't worry, we are going to fast forward you a few acts and when time permits will get back to filling in the nitty-gritty's of all that you're missing out on. Stay tuned...

Act 1 - Orlando
Act 2 - Mumbai interns
Act 3 - Amritapuri Regionals.