Search found 38 matches

by 58050zz
Mon Sep 18, 2006 1:30 am
Forum: Volume 100 (10000-10099)
Topic: 10018 - Reverse and Add
Replies: 169
Views: 17897

Runtime Error CUP TIME is 0.002

Runtime Error CUP TIME is 0.002 can somebody tell me where is the problem really thanks #include <iostream> using namespace std; #include <fstream> #include <string> #include <cmath> //#include <iomanip> //#include <vector> //#include <list> //#include <set> // multiset class-template definition //#...
by 58050zz
Sun Apr 03, 2005 4:35 pm
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25957

thank you ,
for your help
i get AC
:D
by 58050zz
Sun Apr 03, 2005 2:56 am
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25957

do ur algorithm here

==output here
while(cin>>target)
{
cout.width(6);
cout.precision(2);
cout<<target;
if(target==0)return 0;
int tar=(int)(target*100);

cout<<setw(17)<<setiosflags(ios::right)
<<Array[tar]<<endl;
}
by 58050zz
Sun Apr 03, 2005 2:54 am
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25957

Hi, From your code it looks like you are using brute force. And that should obviously get TLE. Implementation of DP: 1) declare an int array of size 7500 2) initialize all the elements with 0 3) set Array[0] = 1; --- because there is only one way of making zero ie 'by not choosing any coin'. 4) for...
by 58050zz
Sat Apr 02, 2005 11:52 am
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25957

Re: About CLRS

Raj Ariyan wrote: Try to read this book when u will free. It will help you much. Greedy most probably in chapter 16.
Greedy is in ch16
do i use Greedy to slove this?


to sohel:
my code is not AC is TLE^^
by 58050zz
Mon Mar 21, 2005 6:24 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 22764

..

..
by 58050zz
Mon Mar 21, 2005 6:01 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 22764

my algorithm http://online-judge.uva.es/board/viewtopic.php?t=693&highlight=108 Thanks for explanation... but I will write you here a simplier (I hope :D method.... Let us make a table B... the B[i,j] = sum (from 1 to i and form 1 to j of A) that means that B[1,1]=A[1,1] B[1,2]:=A[1,1]+A[1,2]; ... B...
by 58050zz
Mon Mar 21, 2005 5:57 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 22764

108 Maximum Sum

http://acm.uva.es/p/v1/108.html help WA #include <iostream> using namespace std; void output(int a[][101],int b[][101],int n) { int i,j; for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { printf("%3d",a[i][j]); } printf("\n"); } printf("=========\n"); for(i=1;i<=n;i++) { for(j=1;j<=n;j++) { printf("%3d",b[i][j...
by 58050zz
Sat Mar 19, 2005 3:54 pm
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 22151

Re: 111 Invalid memory reference

Code: Select all

 g++ -ggdb 
and let us know.

i use
g++ -ggdb abc.cpp
it creat one a.exe
by 58050zz
Sat Mar 19, 2005 11:38 am
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 22151

Re: 111 Invalid memory reference

(no debugging symbols found)...(gdb) run Starting program: /win.exe Program received signal SIGSEGV, Segmentation fault. 0x004012ce in ?? () (gdb) where #0 0x004012ce in ?? () #1 0x00401537 in ?? () #2 0x004011c1 in ?? () #3 0x004011eb in ?? () #4 0x7c816d4f in ?? () (gdb) print The history is empt...
by 58050zz
Sat Mar 19, 2005 10:13 am
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 22151

G++ is a compiler, if you need to use a debugger, get one.G++ can't help you there.Use gdb/dbx/adb/ddd - whatever is available on your system. Usage example: compile code with debug info as: g++ -g filename.cpp -o executable gdb executable ... Regards, Suman. http://kent.dl.sourceforge.net/sourcefo...
by 58050zz
Sat Mar 19, 2005 9:20 am
Forum: Volume 1 (100-199)
Topic: 111 - History Grading
Replies: 135
Views: 22151

111 Invalid memory reference

if use VC++ no error use g++ ===>run time error if input 10 3 1 2 4 9 5 10 6 8 7 1 2 3 4 5 6 7 8 9 10 4 7 2 3 10 6 9 1 5 8 3 1 2 4 9 5 10 6 8 7 2 10 1 3 8 4 9 5 7 6<===watch this output 6 5 10 ===>Run time error if input 10 3 1 2 4 9 5 10 6 8 7 2 10 1 3 8 4 9 5 7 6<===watch this output 9 ==========...
by 58050zz
Mon Mar 14, 2005 6:14 am
Forum: Volume 6 (600-699)
Topic: 674 - Coin Change
Replies: 77
Views: 25957

Re: oh! no

sohel wrote:Please, don't post AC codes on this forum..

-- it won't help anyone in the long run.
not AC

is TLE

help me
by 58050zz
Mon Mar 14, 2005 6:13 am
Forum: Volume 1 (100-199)
Topic: 102 - Ecological Bin Packing
Replies: 485
Views: 49647

sunnycare wrote:thanks ...
but why ?
search ..i will get much
by 58050zz
Sat Mar 12, 2005 6:29 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 22764

B[i,j]:=b[i-1,j]+b[i,j-1]-b[i-1,j-1]+a[i,j] ... And the whole program complexity is O(n^4).. Try to implement this (this is quite an easy algoritm so try it ) Good Luck :wink: if u have free time plz give some help i think i use ur algo with correct way but still get WA can u give me some samples #...

Go to advanced search