Post some poj super questions (AC) (1)

Source: Internet
Author: User

Poj1002: The number corresponding to the buttons on the phone. Now give n calls and sort them. Same category
Poj1003: Calculate the minimum n so that 1 + 1/2 + 1/3 +... + 1/N is greater than the given real number.
Poj1004: calculate the average of a bunch of real numbers
Poj1005: Starting from the coordinate (0, 0), with a semi-circle as the shape of 50 m ^ 2 each year, how long does it take to start from (0, 0) to (x, y) end?
Poj1006: three periods are constants. Now, when three periods of peak appear, ask when the next peak occurs.
Poj1007: Sort strings
Poj1008: a calendar that calculates the number of days.
Poj1012: Joseph Problem
Poj1013
Poj1016: a data string changes like this: its successor is: it contains several 1 s, including several 2...
Poj1017: Products of 1 × 2, 3 × 3 × 4 × 4 × 5, 6 × 6 are placed in 6 × 6 × H boxes. Evaluate the minimum value of H.
Poj1028: Simulate web browsing
Poj1031: Find whether a point is in the convex bag
Poj1032: Divide N into the sum of several different numbers and obtain the maximum product.
[2 + 3 +... If it comes out, add 1 starting from the largest number]
Poj1045: mathematical formula
Poj1046: Give 16 background colors, and then give several colors. Which is the minimum distance from the front?
Poj1051: A string with each letter replaced by one. Now I have replaced the original string with some replacement.
Poj1056: give several strings and ask if one is another prefix?
[Trie can be used, but brute force is acceptable]
Poj1061?
Poj1065: Process n wooden sticks. Each wooden stick has two parameters. If the previous one is not larger than it, you do not need to change the time. Otherwise, it takes one time. Ask the minimum conversion time?
Poj1083: 400 rooms in total, 200 rooms in the south and 200 rooms in the north. It takes 10 minutes to move from one room to another. During this period, no one else can move in or out at most once.
Count the number of times each route passes for Max]
Poj1118: calculate the number of points in a straight line containing the most vertices for several points
Poj1146: returns a lexicographically ordered string.
[Next_permutation function]
Poj1183: arctan (1/a) = arctan (1/B) + arctan (1/C), returns a, and calculates the minimum solution of B + C.
Mathematical derivation]
Poj1207: perform the following operations on each number: For an even number/2, for an odd number * 3 + 1. The number of operations that can be operated the most in a range
[Just Do It]
Poj1218: calculate the number of shards between 1-n.
Poj1256: Find the full arrangement of a string
[Next_permutation function]
Poj1298: letter Replacement Problem
Poj1517: I = 0-9 E = Σ 0 <= I <= N1/I! Value
Poj1657: Give the start point and end point on the board the shortest distance of the King, the rear, the car, and the elephant.
Poj1833: Find a Lexicographic Order
[Next_permutation function]
Poj1835: Simulate an astronaut movement. (3d, turn left, turn right, turn up, turn down, turn back, turn back)
Poj1936: give two strings S and T. Q: Can I delete some characters before t is the same as s?
Poj2027: Compare the size of two numbers
Poj2159: two passwords. Ask whether the previous one may be the original code of the last one.
[Identical letters]
Poj2262: Perform the godebach conjecture on the even number in 1000000
Poj2606: calculate the number of points in a straight line containing the maximum number of points for several points
Poj2656: There are n days, if one day's class time + extracurricular time> 8 is not happy. Find the first unhappy time of the day.
Poj2663: 2x1 Domino card to cover the number of 3 x n rectangular Q & A Solutions
Poj2739: calculates the sum of consecutive prime numbers that a number can represent.
Poj2780: calculates the number of points in a straight line containing the most vertices for several vertices.
Poj3006: Calculate the nth prime number in a series (Prime Minister's tolerances ).
Poj3087: keep shuffling. How many times can this problem be achieved?
Poj3094: output the input again.
Poj3175: to give a string, find the first n valid digits of the decimal part of the integer, that is, the string?
Poj3299: There are three variables and the derivation formula, and either of them is given a third.
Poj3589
Poj3618?
Poj3619. How long does it take to read each page?
Poj3620: Find the largest connected Block
Poj3627: Ask the least person to make their height exceed a number.
Poj3663: N digits. How many pairs of numbers and <= s
Poj3664: two rounds of voting, the first round of M-bit into the second round; the second round of the highest vote for the championship
Poj3665. Order of numbers
Poj3671: N numbers 1 and 2. How many modifications can order the entire sequence? (1 before 2 after)
Poj3672: it takes time for the uphill to go downhill. Now it takes time for you to go back to the route
Poj3673: Alternative multiplication, the sum of the product of the two bits
Poj3749: decrypts a string. Each string contains five characters after the original letter.

 

 

// Online search of water questions, suitable for beginners to familiarize themselves with the basic exercise Algorithms

 

 

 

 

 

 

// Poj 1002

# Include "stdio. H"
# Include "iostream"
Typedef struct
{
Char B [] = "22233344455566677778889999 ";
Char STR [14];
} Num;
Int map (Num A [], Int J, int K)
{
If (A [J]. Str [k]> = 0 & A [J]. Str [k] <= 9)
Return a [J]. Str [k];
If (A [J]. Str [k]> = 'A' & A [J]. Str [k] <= 'y ')
Return a [J]. B [STR [k]-'a'];
}
Int main ()
{
Num A [n], T;
Int m = 0, I, j, CNT = 0;
Cin> N;
While (M <n)
{
Cin> A [M]. Str> Endl;
Len = strlen (A [M]. Str );
For (I = 0; I <Len; I ++)
{
If (I> = 0 & I <3 | I> 3)
A [M]. Str [I] = map (a, m, I );
If (I = 3)
A [M]. Str [I] = "-";
}
}
For (I = 0; I <n-1; I ++)
For (j = I + 1; j <n; j ++)
{
If (strcpy (A [I]. STR, a [J]. Str)> 0)
{T = A [I]. STR;
A [I]. Str = A [J]. STR;
A [J]. Str = T;
}
}
For (I = 0; I <n; I ++)
{
T = A [I]. STR;
For (j = I + 1; j <n; j ++)
If (strcpy (t, a [J]. Str) = 0)
CNT ++;
Else break;
Cout <t <"" <CNT <Endl;
}
Return 0;
}

 

 

 

 

 

 

 

 

 

 

 

 

// Poj 1003

# Include <iostream>

Using namespace STD;

Int main ()
{
Int cards;
Double Length, C;

Cin> C;
While (C! = 0.0)
{
For (CARDS = 0, length = 0.0; length <C ;)
{

Cards ++;
Length + = 1/(CARDS * 1.0 + 1 );

}

Cout <cards <"<" card (s) "<Endl;
Cin> C;
}
Return 0;
}

 

 

 

 

 

 

 

 

 

 

// Poj 1004

# Include <iostream>
# Include <stdlib. h>
# Include <iomanip>

Using namespace STD;

Int main ()
{
Float a, S = 0.0;

For (INT I = 0; I <12; I ++)
{
Cin>;
S + =;
}

Cout <"$" <setiosflags (IOs: fixed) <setprecision (2) <S/12 <Endl;

System ("pause ");
 
Return 0;

}

 

 

 

 

 

 

 

 

 

 

 

// Poj 1005

# Include <iostream>

# Define PI 3.1415926

Using namespace STD;

Int main ()
{
Int I, n, year;
Double X, Y, area;

Cin> N;

For (I = 0; I <n; I ++)
{
Cin> x> Y;
Area = pI * (x * x + y * Y)/2;
Year = (INT) (area/50) + 1;
Cout <"property" <I + 1 <": this property will begin in eroding in Year" <year <"." <Endl;
}


Cout <"End of output." <Endl;

}

 

 

 

 

 

 

 

 

 

 

// Poj 1006

# Include <iostream>
Using namespace STD;
Int main ()
{
Int P, E, I, D, Day;
Int K, j = 1, W;
Cin> P> E> I> D;
While (p + 1 & E + 1 & I + 1 & D + 1)
{
P % = 23; E % = 28; I % = 33;
For (k = 1, W = I; k <= 21253/33; k ++)
{
If (w-e) % 28 = 0 & (W-p) % 23 = 0)
{
Day = W-D;
If (day <= 0)
Day + = 23*28*33;
Cout <"case" <j ++ <":" <"the next Triple peak occurs in" <day <"days./N ";
Break;
}
W = 33 * k + I;
}
Cin> P> E> I> D;
}
Return 0;
}

 

 

 

 

 

 

 

 

 

 

// Poj 1007

# Include <iostream>
# Include <stdlib. h>

Using namespace STD;

Struct ele
{
Int num;
Char STR [50];

} S [101];

Int CMP (const void * a, const void * B)
{
Return (* (Ele *) a). Num> (* (Ele *) B). Num? 1:-1;
}

Int main ()
{
Int I, Len, N, J, K;

Cin> Len> N;

For (I = 0; I <n; I ++)
{
S [I]. num = 0;
Cin> S [I]. STR;

For (j = 1; j <Len; j ++)
For (k = 0; k <j; k ++)
{
If (s [I]. Str [J] <s [I]. Str [k])
S [I]. Num ++;
}
}

Qsort (S, N, sizeof (s [0]), CMP );

For (I = 0; I <n; I ++)
Cout <s [I]. Str <Endl;

System ("pause ");
 
Return 0;

 

}

 

 

 

 

 

 

 

 

 

// Poj 1008

# Include <iostream>
# Include <string. h>
# Include <stdlib. h>
# Include <iomanip>

Using namespace STD;

Char * H [19] = {"pop", "no", "Zip", "zotz", "tzec ",
"XUL", "yoxkin", "mol", "Chen", "Yax ",
"Zac", "CEH", "Mac", "kankin", "muan ",
"Pax", "koyab", "cumhu", "uayet "};

Char * t [20] = {"imix", "ik", "akbal", "kan", "chicchan", "CIMI ",
"Manik", "lamat", "muluk", "OK", "Chuen", "Eb ",
"Ben", "IX", "mem", "CIB", "caban", "eznab ",
"Canac", "ahau "};

Int main ()
{
Int I, j, N;
Int date = 0, year = 0;
Int Total = 0;
Char mon [19];
Char C;

Cin> N;
Cout <n <Endl; // This question contains several wrong entries. Well, if you don't see the output clearly, you need 3. No language ~~~
 
For (I = 0; I <n; I ++)
{
Cin> date> C> mon> year;
// Cout <mon;
 
For (j = 0; j <19; j ++)
If (strcmp (Mon, H [J]) = 0)
Break;

Total = date + J * 20 + year * 365;

Cout <Total % 13 + 1 <"" <t [Total % 20] <"" <total/260 <Endl;
}
System ("pause ");
Return 0;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.