Search found 10 matches

by N@$!M
Wed Nov 24, 2010 4:27 pm
Forum: Volume 108 (10800-10899)
Topic: 10810 - Ultra-QuickSort
Replies: 36
Views: 20486

10810 - Ultra-QuickSort (Data type 'long' is enough)

I've used the Merge Sort approach and got Accepted with the long datatype. So, now a days I think long long is not necessary for this problem.
( <---- 24 November, 2010)

Also got Accepted in the BST approach... but it took greater runtime.
by N@$!M
Sat Nov 13, 2010 2:13 pm
Forum: Volume 1 (100-199)
Topic: 127 - "Accordian" Patience
Replies: 83
Views: 8953

Re: 127 ...

I just added two arrays next[52] and prev[52] for each piles and used those in the previous code. Now its Runtime is 0.256 sec that places me within the Top 20 List for this problem. And I am satisfied with this. :D
by N@$!M
Sat Nov 13, 2010 12:26 pm
Forum: Volume 1 (100-199)
Topic: 127 - "Accordian" Patience
Replies: 83
Views: 8953

Re: 127 ...

I also had started with STL stack & vector like stcheung and got TLE. Then I used a data structure like: struct pile{ char card[52][2]; int top; } piles[52]; I just skipped the empty piles while traversing. though it took 1.552 sec , but I got Accepted. :wink: Now I am trying to improve the efficien...
by N@$!M
Tue Sep 18, 2007 12:07 pm
Forum: Volume 100 (10000-10099)
Topic: 10099 - The Tourist Guide
Replies: 91
Views: 28234

What is wrong :( with my code ? #include<stdio.h> #include<math.h> #define num 105 long w[num][num], cost; long min(long a,long b) { return ( (a<b) ? a : b ) ; } long max(long a,long b) { return ( (a>b) ? a : b ) ; } void MaxMinWarshall(long n) { long i,j,k; for (k=1; k<=n; k++) for (i=1; i<=n; i++...
by N@$!M
Mon Sep 17, 2007 11:53 am
Forum: Volume 108 (10800-10899)
Topic: 10806 - Dijkstra, Dijkstra.
Replies: 24
Views: 17684

10806 Wrong Answer

I have used Dijkstra. I have Read the Post of Misof in the board But didn't understand How to initialize the cost/weight-matrix . I have Initialized The Weight-Matrix as follows: For each edge (a,b) I have set W[a] = W [a] = dist :-? Then I have (tried to) find the first shortest path using Dijkstr...
by N@$!M
Wed Jun 27, 2007 5:56 pm
Forum: Volume 108 (10800-10899)
Topic: 10856 - Recover Factorial
Replies: 17
Views: 13587

W. A. 10856

I have tried the I/Os of the Board. Those are all OK.
But I get WA.
by N@$!M
Sun Jun 24, 2007 4:12 pm
Forum: Volume 3 (300-399)
Topic: 362 - 18,000 Seconds Remaining
Replies: 75
Views: 25818

362 P.E.

Here is My Code For Which I Have got P.E. #include<stdio.h> #include<math.h> int main(void) { double tb,takenTotal,takenPrev5,take; long t,dataset = 1; bool tag = false; scanf("%lf",&tb); while(tb!=0) { if(tag == false) tag = true; else printf("\n"); ... ... ... ... ... dataset++; } return 0; } .......
by N@$!M
Fri Jan 12, 2007 8:53 pm
Forum: Volume 100 (10000-10099)
Topic: 10010 - Where's Waldorf?
Replies: 42
Views: 17810

10010 W.A. Help Please

Pleeeee...........ase Help me. :roll: I am getting WA in it. Can Anyone give me some critical I/O Sets.? Here Is My Code : #include<stdio.h> #include<string.h> struct point{ int x,y; }; bool compare(char a,char b) { if(a>='A' && a<='Z'){ a=a+32; } if(b>='A' && b<='Z'){ b=b+32; } if(a==b) return tru...
by N@$!M
Wed Jan 10, 2007 8:49 pm
Forum: Volume 100 (10000-10099)
Topic: 10062 - Tell me the frequencies!
Replies: 235
Views: 35827

10062 P.E. -Solved

:D
I've Submitted The Code again Using 'gets()' instead of 'scanf(" %[^\n]")',.......AND GOT Accepted ! ':wink:'
by N@$!M
Wed Jan 10, 2007 7:45 pm
Forum: Volume 100 (10000-10099)
Topic: 10062 - Tell me the frequencies!
Replies: 235
Views: 35827

10062 P.E.,Help Plea...............se !

:roll: Shouldn't There Be ANY '\n' After The last output line? I'm getting P.E. With this code : #include<stdio.h> #include<string.h> void main() { int freq[128],i,j,highest_freq,len,tag1=0,tag2; char arr[1001]; while(scanf(" %[^\n]",arr)==1){ if(tag1==0) tag1=1; else printf("\n"); len=strlen(arr); ...

Go to advanced search