New Speakers! :D

I recently got new speakers.

Sony SRS D5 Speakers. They are really awesome , although the volume is not that loud, but this has really some bass.

BTW! I have recently solved “Name that Number” USACO Problem. Here is the solution:


/*
ID: gautam11
PROG: namenum
LANG: C++
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define P(s) printf("%s\n",s)
#define Pint(n) printf("%d",n)
#define Sint(n) scanf("%d",&n)
#define TEST printf("Test Called!")
#define NL printf("\n")
typedef struct node{
	int value;
	struct node *next;
}node;

typedef struct BinaryTree{
	int value;
	struct BinaryTree *left;
	struct BinaryTree *right;
}BinaryTree;

using namespace std;

string getChars(char num)
{
	switch(num)
	{
		case '2': return "ABC";
		case '3': return "DEF";
		case '4': return "GHI";
		case '5': return "JKL";
		case '6': return "MNO";
		case '7': return "PRS";
		case '8': return "TUV";
		case '9': return "WXY";
	}
}

/*bool LinearSearch(string S)
{
	ifstream fin ("dict.txt");
	string temp;
	for(int i=0;!fin.eof();i++)
	{
		fin>>temp;
		if(!S.compare(temp))
			return 1;
	}
	return 0;
}*/

bool match(string N,string test)
{
	string chars;
	for(int i=0;i>N;
	string test;
	bool flag=0;
	for(int i=0;!fdict.eof();i++)
	{
		fdict>>test;
		if(test.length()==N.length() && match(N,test))
		{
			flag=1;
			fout<<test<<endl;
		}
	}
	if(!flag)
		fout<<"NONE"<<endl;
	return 0;
}


Now, I am working on Code Chef November 2012 Challenge! I’ll post the solution to the problem I am able to solve(although the chances are really low ) here.

Well, I just got Coin Flip done. Here is my code:


#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define P(s) printf("%s\n",s)
#define Pint(n) printf("%d",n)
#define Sint(n) scanf("%d",&n)
#define TEST printf("Test Called!")
#define NL printf("\n")
typedef struct node{
	int value;
	struct node *next;
}node;

typedef struct BinaryTree{
	int value;
	struct BinaryTree *left;
	struct BinaryTree *right;
}BinaryTree;

using namespace std;

int main()
{
	int T;
	Sint(T);
	while(T--)
	{
		int G;
		Sint(G);
		while(G--)
		{
			int I,Q;
			long long int N;
			scanf("%d %lld %d",&I,&N,&Q);
			if(I==Q)
				printf("%lld\n",N/2);
			else
			{
				if(N%2)
					printf("%lld\n",N/2+1);
				else
					printf("%lld\n",N/2);
			}
		}
	}
	return 0;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s