Search found 12 matches

by ggggqqqqihc
Tue May 25, 2004 4:13 pm
Forum: Algorithms
Topic: A Simple Problem, But...
Replies: 0
Views: 849

A Simple Problem, But...

It is from URAL: http://acm.timus.ru/problem.aspx?space=1&num=1048 Simply stated, just plus. In order to compress the data, every element stores a number which is less than 100. I have try many times, all are right, but cannot be accept online, return "Wrong answer". Er, What's the matter? Here is m...
by ggggqqqqihc
Fri Jan 30, 2004 4:59 am
Forum: Algorithms
Topic: Number Triangles. Help me...
Replies: 8
Views: 2162

Although my compiler TCC find many mistakes. Thank you all the same.
I understand.
by ggggqqqqihc
Thu Jan 29, 2004 4:22 pm
Forum: Algorithms
Topic: Number Triangles. Help me...
Replies: 8
Views: 2162

Yes, it is from USACO. But I don't know why C[i,j]=max(C[i-1,j],C[i-1,j-1])+s[i,j]. What's the meaning? Could you give me some code to explain it?

It is the last problem in Chapter 1, so I hope to solve it as soon as possible.
by ggggqqqqihc
Thu Jan 29, 2004 5:07 am
Forum: Algorithms
Topic: Number Triangles. Help me...
Replies: 8
Views: 2162

Oh, I'm very sorry. The number triangles should be like

Code: Select all

        3
      2   8
    2   6   0
  8  2    5   2
2  3   7    2   1
It means if the present number is 6, the next number must be 2 or 5. I think you misunderstood the meaning.
by ggggqqqqihc
Wed Jan 28, 2004 4:03 pm
Forum: Algorithms
Topic: Number Triangles. Help me...
Replies: 8
Views: 2162

Could you give me more? It doesn't seem clear. How to use DP?
by ggggqqqqihc
Wed Jan 28, 2004 11:59 am
Forum: Algorithms
Topic: Number Triangles. Help me...
Replies: 8
Views: 2162

Number Triangles. Help me...

I am a beginner and I am learning search techniques. But there is a little difficult problem. I copied it: Consider the number triangle shown below. Write a program that calculates the highest sum of numbers that can be passed on a route that starts at the top and ends somewhere on the base. Each st...
by ggggqqqqihc
Thu Jan 08, 2004 1:09 pm
Forum: Off topic (General chit-chat)
Topic: Best wishes
Replies: 0
Views: 1269

Best wishes

I'm from China. January 22 is the most important day, Spring Festival. It's like Christmas. We are going to visit our friends and relatives and give them the best wishes.
You are my friends. Happy Spring Festival!
:D
by ggggqqqqihc
Mon Dec 08, 2003 12:27 pm
Forum: Pascal
Topic: input problem
Replies: 12
Views: 12454

But when I use Program(input,output), how to end input?
Any file ends up with ^Z, but when I type Ctrl+Z, the problem will crash.
by ggggqqqqihc
Mon Dec 08, 2003 11:53 am
Forum: Pascal
Topic: How to use Readln?
Replies: 1
Views: 4988

How to use Readln?

Look at the following program:
[pascal]var
a:integer;
c:char;
begin
readln(a,c);
writeln(a,c);
end.[/pascal]
I type '12 a'(not including" ' ") while the program is running. But c<>'a'. Why is it? How to solve it? I don't want to change the way of input.
Thank you.
by ggggqqqqihc
Sun Dec 07, 2003 12:45 pm
Forum: Pascal
Topic: A question on the number of lines
Replies: 4
Views: 6183

Good idea. Thanks. :lol:
by ggggqqqqihc
Sun Dec 07, 2003 12:30 pm
Forum: Pascal
Topic: A question on the number of lines
Replies: 4
Views: 6183

Or simply stated. When I have inputted all the numbers, press ENTER twice, the program will stop. How can I do?
by ggggqqqqihc
Sun Dec 07, 2003 11:00 am
Forum: Pascal
Topic: A question on the number of lines
Replies: 4
Views: 6183

A question on the number of lines

For example
Input:
Each line has two integral numbers, and there are some lines, but I don't know the number of lines. When the program has read the last line, I want it to stop. How can I do that?
I'm a beginner. Thanks.

Go to advanced search