Search found 106 matches

by sapnil
Thu Oct 18, 2007 8:12 am
Forum: Volume 4 (400-499)
Topic: 490 - Rotating Sentences
Replies: 212
Views: 19466

To jjtse Trying this case: Input: aaa aaa aaa aaa aaa a aaaaaaaaaaaaaaaaaaaaaaa Output: aaaaaa a aaaa a aaaa a a a a a a a a a a a a a a a a a a a a a a a ** Every input line have same length. Thanks Keep posting Sapnil
by sapnil
Wed Oct 17, 2007 2:21 pm
Forum: Volume 5 (500-599)
Topic: 543 - Goldbach's Conjecture
Replies: 109
Views: 23621

To shimon

>> At first calculate all primes <1000000 (Using sieve)
Then the isPrime function will be

Code: Select all

int isPrime(long n)
{
long i,root;
root=sqrt(n);
for(i=0;prime[i]<=root;i++)
{
     if(n%prime[i]==0)
    {
           return 0;
    }
}

return 1;
}
Thanks
Keep posting
Sapnil
by sapnil
Wed Oct 17, 2007 2:09 pm
Forum: Volume 6 (600-699)
Topic: 612 - DNA Sorting
Replies: 122
Views: 15564

>> At first count the number of swap to sort each row
>> Sort them ascending order according to the number of swap of each row.

Thats all

Thanks
Keep posting
Sapnil
by sapnil
Wed Oct 17, 2007 1:33 pm
Forum: Volume 112 (11200-11299)
Topic: 11286 - Conformity
Replies: 19
Views: 8747

>>sapnil
r u sure that these outputs r correct??
My AC code gives the following output.

Code: Select all

4 
5 
4
To mmonish

Yes me AC code returns this output!

Thanks
Keep posting
Sapnil
by sapnil
Wed Oct 17, 2007 1:29 pm
Forum: Volume 112 (11200-11299)
Topic: 11286 - Conformity
Replies: 19
Views: 8747

vgjgfjg
by sapnil
Tue Oct 09, 2007 8:43 am
Forum: Volume 109 (10900-10999)
Topic: 10903 - Rock-Paper-Scissors Tournament
Replies: 27
Views: 11105

Try this case: Input: 2 12 1 rock 2 paper 1 scissors 2 paper 1 rock 2 rock 2 rock 1 scissors 1 rock 2 paper 1 scissors 2 paper 1 rock 2 rock 2 rock 1 scissors 1 rock 2 paper 1 scissors 2 paper 1 rock 2 rock 2 rock 1 scissors 2 8 1 rock 2 paper 1 scissors 2 paper 1 rock 2 rock 2 rock 1 scissors 1 roc...
by sapnil
Tue Oct 09, 2007 8:32 am
Forum: Volume 109 (10900-10999)
Topic: 10948 - The primary problem
Replies: 27
Views: 17866

Try this case:

Code: Select all

Input:
1000000
999999
99999
1
2
3
11
121
100
Output:
1000000:
17+999983
999999:
NO WAY!
99999:
NO WAY!
1:
NO WAY!
2:
NO WAY!
3:
NO WAY!
11:
NO WAY!
121:
NO WAY!
100:
3+97
Thanks
Keep posting
Sapnil
by sapnil
Tue Oct 09, 2007 8:03 am
Forum: Volume 112 (11200-11299)
Topic: 11286 - Conformity
Replies: 19
Views: 8747

Try this case Hope it will works Input: 4 100 101 102 103 104 104 103 100 101 102 200 201 202 203 204 204 203 200 201 202 5 100 101 102 103 104 100 101 102 103 104 100 101 102 103 104 100 101 102 103 104 100 101 102 103 104 5 100 101 102 103 104 100 101 102 103 104 100 101 102 103 104 100 101 102 10...
by sapnil
Mon Oct 08, 2007 1:04 pm
Forum: Volume 3 (300-399)
Topic: 371 - Ackermann Functions
Replies: 196
Views: 28053

I get Acc in 0.42
I done this like problem no 100 (3n+1)

Thanks
Keep posting
Sapnil
by sapnil
Mon Oct 08, 2007 12:56 pm
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 19532

For input: 2 1.000000000
My acc code return: 0/1

Thanks
Keep posting
Sapnil
by sapnil
Mon Oct 08, 2007 12:24 pm
Forum: Volume 2 (200-299)
Topic: 264 - Count on Cantor
Replies: 47
Views: 13421

Try this case: Input: 1 10000000 1000000 100000 10000 1000 100 10 9999999 999999 99999 9999 999 99 Output: TERM 1 IS 1/1 TERM 10000000 IS 2844/1629 TERM 1000000 IS 1009/406 TERM 100000 IS 129/319 TERM 10000 IS 12/130 TERM 1000 IS 36/10 TERM 100 IS 9/6 TERM 10 IS 4/1 TERM 9999999 IS 2843/1630 TERM 99...
by sapnil
Mon Oct 08, 2007 11:01 am
Forum: Volume 113 (11300-11399)
Topic: 11308 - Bankrupt Baker
Replies: 17
Views: 7361

To Lomir

I get WR first because i print \n between two binder.
But after that i print \n for each binder & get Acc.

I miss this line:

Code: Select all

Print a blank line after each binder.
Thanks
Keep posting
Sapnil
by sapnil
Sun Oct 07, 2007 7:46 pm
Forum: Volume 113 (11300-11399)
Topic: 11308 - Bankrupt Baker
Replies: 17
Views: 7361

Finally i got acc


Thanks
keep posting
Sapnil
by sapnil
Sun Oct 07, 2007 7:33 pm
Forum: Volume 100 (10000-10099)
Topic: 10013 - Super long sums
Replies: 212
Views: 38804

to rossi kamal

*** The array size is 1000000
*** print blank line between two tast case
*** all data type is long
*** Declare data out of for loop

Thanks
keep posting
Sapnil
by sapnil
Sun Oct 07, 2007 7:05 pm
Forum: Volume 111 (11100-11199)
Topic: 11151 - Longest Palindrome
Replies: 65
Views: 32608

To rossi kamal

YES


Thanks
keep posting
Sapnil

Go to advanced search