Skip to content

Instantly share code, notes, and snippets.

View ylogx's full-sized avatar
🤘
<div><ståtús/></div>

Shubham Chaudhary ylogx

🤘
<div><ståtús/></div>
View GitHub Profile
@ylogx
ylogx / base.cpp
Last active December 26, 2015 08:09
base file for online competition
/*
* Team Fork
*/
#include <list>
#include <utility>
#include <functional>
#include<algorithm> //min(), max(), reverse(), sort(), next_permutation(), prev_permutation(), swap()
#include<iostream>
#include<cassert> //assert()
@ylogx
ylogx / trans.c
Last active December 24, 2015 22:59
P1 - translator
/*
* foobar - Shubham Chaudhary
* Nitul Datt
TranslatorIn a country of Neverland there are two types of programmers, People who program using a language X(X people) and people who program using a language Y(Y people). Both are equally good languages but there is no translator that could translate X language to Y and vice versa.Apologists of X and Y can argue for hours proving each other that their programming language is the best one. Y people will tell that their programs are clearer and less prone to errors, while X people will laugh at their inability to instantiate an array of generics or tell them that their programs are slow and have long source code.Another issue that X and Y people could never agree on is identifier naming. In Y a multiword identifier is constructed in the following manner: the first word is written starting from the small letter, and the following ones are written starting from the capital letter, no separators are used. All other letters are small. Examples of a Y identi
@ylogx
ylogx / pymate.c
Last active December 24, 2015 22:59
P2 - Pythagorean Math Test
/*
* foobar - Shubham Chaudhary
* Nitul Datt
Pythagorean Math TestPythagoras is teaching mathematics to a class of N students. He wants to test if his students understood his new theorem. He gives his students the length of the sides of a triangle and they have to tell him if it is a right triangle.InputFirst line an integer N, the number of students. 0<N<=50Next N lines each containing 3 integers a, b and c which are the length of the sides of the triangle. 0<a,b,c. (DO NOT PRINT ANY PROMPT MESSAGE TO READ THE INPUT.)OutputIf the given triangle is right angled print "RIGHT TRIANGLE" in a single line. If the given triangle is not right angled print "NOT RIGHT TRIANGLE" in a single line. (DO NOT PRINT ANY MESSAGE OTHER THAN THE SPECIFIED OUTPUT.)Sample input23 5 43 2 1Sample outputRIGHT TRIANGLENOT RIGHT TRIANGLE
*/
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
@ylogx
ylogx / psmapa.c
Created October 7, 2013 23:20
psmapa.c - Aspiration 2020 Contest Problem
/*
* foobar - Shubham Chaudhary
* Nitul Datt
*/
#include <stdio.h>
#include <stdlib.h>
int fastread()
{
unsigned int input;
@ylogx
ylogx / decipher.c
Last active December 24, 2015 22:59
P3 - Decypher
/*
* foobar - Shubham Chaudhary
* Nitul Datt
Alice and Bob are being held at Azkaban(Prison). They want to escape and join Dumbledore's Army. Alice wants to tell Bob about the details of the plan but wants to keep their escape plan from Dementors(the guards). So Alice encrypts the message before passing the chits to Bob's cell. However Bob was careless and he disposed the chits in his cell's waste paper bin. The clever Dementor found the chits but couldn't make out what they said. So he hired a computer programmer to decode the message for him. Please help the Dementor to decypher the message.The code key that Alice used for this simple coding is a one for one character substitution based upon a single arithmetic manipulation of the printable portion of the ASCII character set.INPUTThe Encrypted message in a single line. The maximum number of charaters in a message is 100. (DO NOT PRINT ANY PROMPT MESSAGE TO ENTER THE ENCRYPTED MESSAGE.)OUTPUTThe decrypted message in a single line. (Do not print a