Search found 150 matches

by plamplam
Sun Jun 19, 2011 6:00 pm
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 51760

Re: 10252 - Common Permutation

Okay I must admit that this problem really pissed me off. For everyone getting WA continously, listen. The input description is perfectly fine, the judge data set is correct too (May be it was incorrect before I don't know, but it is sure fixed at the time Im writing this). The input will consist o...
by plamplam
Sun Jun 19, 2011 5:57 pm
Forum: Volume 102 (10200-10299)
Topic: 10252 - Common Permutation
Replies: 150
Views: 51760

Re: 10252 - Common Permutation

Okay I must admit that this problem really pissed me off. For everyone getting WA continously, listen. The input description is perfectly fine, the judge data set is correct too (May be it was incorrect before I don't know, but it is sure fixed at the time Im writing this). The input will consist of...
by plamplam
Sun Jun 19, 2011 7:55 am
Forum: Volume 118 (11800-11899)
Topic: 11830 - Contract Revision
Replies: 20
Views: 4793

Re: Contract revision_11830

Some test cases

Code: Select all

1 91029120
3 9192013010391
5 000005555101020
5 5555555550555551555555655554

Code: Select all

902920
91920101091
101020
164
by plamplam
Sat Jun 18, 2011 8:52 pm
Forum: Volume 119 (11900-11999)
Topic: 11934 - Magic Formula
Replies: 6
Views: 3159

Re: 11934 - Magic Formula

I got Wrong Answer on my first attempt. I got AC after I changed my int variables to long long and I used the fmod function instead of the '%' operator. Don't know for which one it got AC. :D
by plamplam
Sat Jun 18, 2011 5:22 pm
Forum: Volume 119 (11900-11999)
Topic: 11909 - Soya Milk
Replies: 15
Views: 6476

Re: 11909 - Soya Milk

I solved this in my first try. I must agree with everyone else, this is a really great problem. Please don't underestimate the problem. Although the problem description says that it may not perfectly match the real-life situation, I am going to advice you to visualize this as a real-life situation. ...
by plamplam
Thu Jun 16, 2011 7:56 pm
Forum: Volume 4 (400-499)
Topic: 440 - Eeny Meeny Moo
Replies: 18
Views: 1829

Re: 440 TLE?

This is how you can get this code done in very short time. When I submitted this code for the first time, I got AC :D, but the runtime was 0.904 seconds. Then I realized that 3<=n<=150, and an idea suddenly struck my head. I removed scanf("%d",&n); and the for loop was replaced with for(n = 3; n < 1...
by plamplam
Thu Jun 16, 2011 7:43 pm
Forum: Volume 113 (11300-11399)
Topic: 11351 - Last Man Standing
Replies: 7
Views: 3534

Re: 11351 - Last Man Standing

There might be a particular algorithm for this problem, I used an integer array of size 100010 and my main function consisted of less than 20 lines. No functions, no complications and nothing. Just try to solve the problem mathematically, try it first manually, without the help of a computer. For ex...
by plamplam
Thu Jun 16, 2011 7:39 pm
Forum: Volume 113 (11300-11399)
Topic: 11351 - Last Man Standing
Replies: 7
Views: 3534

Re: 11351 - Last Man Standing

Oh dear, I don't understand a thing you wrote. Sorry Im a newbie and I don't know much about programming. I don't know how to program in c++, however I do know a little of C. Then why am I replying to you? Well, you see the problem is tricky. It is not really very hard, but yes it requires deep thin...
by plamplam
Tue Jun 14, 2011 7:35 am
Forum: Volume 113 (11300-11399)
Topic: 11371 - Number Theory for Newbies
Replies: 65
Views: 22831

Re: 11371 - Number Theory for Newbies

100 100 - 100 = 0 = 9 * 0 100102 211000 - 100012 = 110988 = 9 * 12332 910291 992110 - 101299 = 890811 = 9 * 98979 1 1 - 1 = 0 = 9 * 0 2 2 - 2 = 0 = 9 * 0 10 10 - 10 = 0 = 9 * 0 11 11 - 11 = 0 = 9 * 0 12 21 - 12 = 9 = 9 * 1 99909 99990 - 90999 = 8991 = 9 * 999 1234560789 9876543210 - 1023456789 = 885...
by plamplam
Tue Jun 14, 2011 5:17 am
Forum: Volume 9 (900-999)
Topic: 914 - Jumping Champion
Replies: 37
Views: 17509

Re: 914 - Jumping Champion

Here are some critical inputs for these problem. I found out all these inputs after I got Wrong Answer on my first try. Try these, I think these will surely help you solve this problem :) 7 0 12 The jumping champion is 2 2 12 The jumping champion is 2 7 11 The jumping champion is 4 6 12 The jumping ...
by plamplam
Sun Jun 12, 2011 10:06 pm
Forum: Volume 102 (10200-10299)
Topic: 10260 - Soundex
Replies: 30
Views: 10853

Re: 10260 - Soundex

I think this is the most common mistake that everyone makes, let S be the soundex number that you are calculating. Now, if only the string "A"(or other characters or combination of characters for which no soundex exists) is given as input, DO NOT print 0. But if you don't print anything then you get...
by plamplam
Tue Jun 07, 2011 9:03 am
Forum: Volume 109 (10900-10999)
Topic: 10940 - Throwing cards away II
Replies: 28
Views: 14310

Re: 10940 - Throwing cards away II

This is not a dynamic programming problem @DD...this is a very interesting problem that i solved using simple mathematics. I didn't even use recursions or functions in my code :D My hint is solve 10935 before attempting this Second hint is after you solve 10935, you can't solve this using the same m...
by plamplam
Wed May 25, 2011 6:18 pm
Forum: Volume 4 (400-499)
Topic: 494 - Kindergarten Counting Game
Replies: 119
Views: 22059

Re: why WA in 494?!!

I don't see any problem with your code....except for the part p=strtok(NULL," !.");....I don't have the test cases but don't you think its possible to give more punctuations like ' or ( ) or & or @ or ?. So just find a way to exclude every possible punctuations and stuff. Hint : Just include all the...
by plamplam
Tue May 24, 2011 6:29 pm
Forum: Volume 9 (900-999)
Topic: 913 - Joana and the Odd Numbers
Replies: 32
Views: 13791

913 - Joana and the Odd Numbers

#include <stdio.h> #include <math.h> int main() { long long int y, t, i, j, k, l, z, a, d, n, sum; double x; while (scanf("%lld", &n) == 1) { x = ( (n - 1) / 2.0); y = (x / 2.0) * (12.0 + ( (x - 1) * (4.0) ) ); sum = (3 * y) - 3; printf("%lld\n", sum); } return 0; }
by plamplam
Mon May 23, 2011 3:59 pm
Forum: Volume 9 (900-999)
Topic: 913 - Joana and the Odd Numbers
Replies: 32
Views: 13791

913 - Joana and the Odd Numbers

Hi, can anyone please help me here? I know this is a very easy problem and I could easily find the relation(there is a sequence) and found out the last term. And then sum of the last three terms would be (last term * 3) - 6. The judge keeps giving me Wrong Answer for apparently some strange reason, ...

Go to advanced search