Search found 15 matches

by mhayter1
Sun Oct 21, 2007 6:29 am
Forum: Volume 105 (10500-10599)
Topic: 10520 - Determine it
Replies: 15
Views: 8258

Hi, I've past all test cases on the forum, and I use a 64 bit data type without success. Could anyone help? #include<iostream> #include<algorithm> using namespace std; const unsigned long long SIZE=500; unsigned long long memo[SIZE][SIZE]; bool found[SIZE][SIZE]; unsigned long long n; inline void up...
by mhayter1
Mon Aug 06, 2007 12:27 am
Forum: Volume 108 (10800-10899)
Topic: 10819 - Trouble of 13-Dots
Replies: 67
Views: 36337

Hi! I've modified my code and I pass all the test cases given on the forums. I submit my code but it gets WA. Could someone please help me? Here's my code: #include<iostream> using namespace std; struct item { int cost; int findex; }; const int NITEMS=110; const int MAXSUM=10210; item items[NITEMS];...
by mhayter1
Mon Apr 02, 2007 10:35 pm
Forum: Volume 101 (10100-10199)
Topic: 10191 - Longest Nap
Replies: 75
Views: 23446

What's the Longest nap?

Can someone please help me. This problem is supposed to be easy, but I'm having a very tough time with it. My output seem right. Can someone point out the error in my code or give my inputs to break it. Thank you! #include<iostream> #include<string> #include<sstream> #include<algorithm> #include<vec...
by mhayter1
Fri Jan 19, 2007 3:06 am
Forum: Volume 110 (11000-11099)
Topic: 11015 - 05-2 Rendezvous
Replies: 48
Views: 16935

Could someone please give me test cases or something. Please :D
by mhayter1
Fri Jan 19, 2007 2:57 am
Forum: Algorithms
Topic: programming challenges source code
Replies: 1
Views: 1770

programming challenges source code

Can someone explain to me how the code in the Programming challenges book is used? The code seems to reference other code that it does not include. Is anyone familiar with this book? I'm trying to study algorithms and I was hoping to learn.

Thanks.
by mhayter1
Sat Jan 13, 2007 11:02 pm
Forum: Volume 110 (11000-11099)
Topic: 11015 - 05-2 Rendezvous
Replies: 48
Views: 16935

Test cases

Could someone give me some test cases for this problem. Apparently I don't understand the problem. I'm also a newbie when it comes to algos. I out which algo to use, which is a big success, but I not getting AC. Here's my code: /* ID:mhayter1 PROG:ride LANG:C++ */ #include <iostream> #include <fstre...
by mhayter1
Sat Aug 12, 2006 3:32 am
Forum: Volume 109 (10900-10999)
Topic: 10924 - Prime Words
Replies: 44
Views: 22422

Thank you for your reply. It is very strange. I just recompiled my code and submitted it and it was accepted. Why did it get WA in the first place?
Thanks anyway!!
by mhayter1
Sat Aug 12, 2006 3:23 am
Forum: Volume 100 (10000-10099)
Topic: 10079 - Pizza Cutting
Replies: 44
Views: 10147

Unusual

On the problem cutting pizza. This works:

Code: Select all

cout<<((n*(n+1))/2)+1<<endl;
but this doesn't

Code: Select all

cout<<n*n*.5+n*.5+1<<endl;
you must change it to this:

Code: Select all

cout<<(long long)n*n*.5+n*.5+1<<endl;
does anyone know why this is?
by mhayter1
Fri Aug 11, 2006 10:58 pm
Forum: Volume 7 (700-799)
Topic: 713 - Adding Reversed Numbers
Replies: 142
Views: 40448

Input:

100 200

999999999999999 1

00010 9

1 9

1 9

5 5

456 654

0 0

Output:

3

1

9001

1

1

1

111

0
by mhayter1
Fri Aug 11, 2006 9:20 am
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31406

I would but I don't know how. Could someone tell me?
by mhayter1
Fri Aug 11, 2006 9:19 am
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31406

Please remove your code from the forum.
by mhayter1
Fri Aug 11, 2006 9:18 am
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31406

Gee!!Thanks for your reply!

I got AC!!
by mhayter1
Fri Aug 11, 2006 9:17 am
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31406

You need to change this portion of code.

Code: Select all

if(lookup[str1[i]]=='\0') 
       { 
           mirror[i]=str1[i]; 
           return 0;
       } 
by mhayter1
Wed Aug 09, 2006 10:19 am
Forum: Volume 109 (10900-10999)
Topic: 10924 - Prime Words
Replies: 44
Views: 22422

I too have have problems with this problem(WA). There are no test cases posted other than the ones on the problem, which my program outputs correctly. Can anyone give me test cases or find a problem in my code? #include<iostream> #include<string> using namespace std; bool isprime(int n) { if(n==1) r...
by mhayter1
Sun Jul 30, 2006 3:08 am
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31406

Palindromes problems (401)

Given the test cases available on the forum, I think I only got one wrong. This is my output: NOTAPALINDROME -- is not a palindrome. ISAPALINILAPASI -- is a regular palindrome. 2A3MEAS -- is a mirrored string. ATOYOTA -- is a mirrored palindrome. MAIAM -- is a mirrored palindrome. 123ESI -- is not a...

Go to advanced search