-
Let's build a house on vijos! Take a look at my solution:
The problem is the largest house that can be built, which is actually a classic problem of the dynamic rule, the largest sub-matrix.
In this problem, we can take the row as a stage, each unit of land is the state, and the optimal function f[i,j] refers to the maximum house unit that can be built with (i,j) as the vertex of the lower right corner of the square.
Seems a bit messy, for example, if the map is.
Then f is. f[1,1],f[1,2],f[2,1] are all 1 because they can only build a house with unit 1 with them at the vertex of the lower right corner of the square, while f[2,2] can build a house with unit 2 (the four vertices of the house are (1,1),(1,2),(2,1),(2,2)).
It is not difficult to infer that f[i,j] is closely related to f[i-1,j],f[i,j-1],f[i-1,j-1], and if f[i,j]=2, then f[i,j-1],f[i-1,j]f[i-1,j-1] must be greater than or equal to 1.
So the equation is.
f[i,j]=map[i,j]*(min+1);
At this point, the problem is solved.
0ms is no problem.
By the way, there are borders.
f[i,1]=map[i,1]
f[1,j]=map[1,j]
-
What's the question?? Illustrated? I don't understand.
-
Judge slowly. And then.. Output.. And then.. There is no then.
#include
#include
#include
#include
#include
using namespace std;
long long c=0,word[6]=,out=0;
if(s=="two"||s=="both"||s=="second")
if(s=="three"||s=="third")if(s=="four")
if(s=="five")
if(s=="six")
if(s=="seven")
if(s=="eight")
if(s=="nine")
if(s=="eleven")
if(s=="twelve")
if(s=="thirteen")
if(s=="fourteen")
if(s=="fifteen")
if(s=="sixteen")
if(s=="seventeen")
if(s=="eightteen")
if(s=="nineteen")
int main()
sort(word,word+c);
for(int i=0;icout/system("pause");}
-
Can you take a look at an example?
This kind of myth is really ...
Rule (2) I don't understand.
-
It's the equivalent of a table.
0 1 2 3 4 5 6 7 (k)
x*x) can be extended indefinitely.
var n,m,i,j,k,t:longint;
a:array[0..1001,0..1001]of longint;
beginreadln(m,n);
n:=n*n mod 1000;
-
Ideas: 1. The first one is the starting point, which is the necessary point, so its value should be added to the accumulator;
2. In the future, you can only jump forward, and the rule of landing point is the largest of all the remaining points. For the study:
First time at 1 o'clock; The second time, choose the largest 3 points among the next 4 points and jump up; The third time, the greater of the remaining two points is selected and jumped up at 4 points; The fourth pick is the last 5 to jump up. Therefore: 1 5 4 3 13.
-
Embarrassment, I'm here to grab a job--I didn't debug forgive me.
vark:real;
a,b,n,i:longint;
beginreadln(n);
a:=1;b:=1;
for i:=1 to n do
begink:=k+a/b;
b:=a+b;
a:=b-a;
end;writeln(k:0:2);
end.
-
That should be right!
varch:char;
a:array[1..6] of char;
i,j:integer;
beginfor i:=1 to 5 do
a[i]:=chr(64+i);
for i:=1 to 5 do beginfor j:=1 to 5 do
write(a[j]);
writeln;
a[6]:=a[1];
for j:= 1 to 5 do
a[j]:=a[j+1];
end;end.
I tried! Pass! Used for!
-
This kind of question does not need to be looped.
The landlord does not know whether he is satisfied
program lt1;
beginwriteln('a b c d e');
writeln('b c d e a');
writeln('c d e a b');
writeln('d e a b c');
writeln('e a b c d');
end.They are all hand-beaten, and the watchtower lord adopts !!
1.Yes (the point is the center of the square).
Proof: Let the side length of the square be a and the length of ap be b(0<=b<=a). >>>More
Mr. Wu is going to ask himself again! I'm not young, and I'm still doing some unsavory things.
If a rectangle (two adjacent sides are equal), it is a square; If a diamond (with one corner is a right angle), then it is square. >>>More
120 under the root number is about equal to , so it can be said that its side length is meters, and it can also be said that its side length is 120 (meters) under the root number.
Refer to the upstairs, but upstairs doesn't know then without adding a statement? >>>More