| Run ID | User | Problem | Result | Memory | Time | Language | Code Length | Submit Time |
| 5067669 | kingpro | 1003 | Accepted | 292K | 0MS | C++ | 359B | 2009-04-29 18:22:00 |
PKU 1003 Hangover
1 #include <iostream>
2 using namespace std;
3
4 int main()
5 {
6 double length[278]={
7 0,0.5,0.833333,1.08333,1.28333,1.45,1.59286,1.71786,1.82897,1.92897,2.01988,2.10321,2.18013,2.25156,2.31823,2.38073,2.43955,2.49511,2.54774,2.59774,2.64536,2.69081,2.73429,2.77596,2.81596,2.85442,2.89146,2.92717,2.96165,2.99499,3.02725,3.0585,3.0888,3.11821,3.14678,3.17456,3.20159,3.2279,3.25354,3.27854,3.30293,3.32674,3.35,3.37273,3.39495,3.41669,3.43796,3.4588,3.47921,3.49921,3.51881,3.53804,3.55691,3.57543,3.59361,3.61147,3.62901,
8 3.64625,3.6632,3.67987,3.69626,3.71239,3.72827,3.74389,3.75928,3.77443,3.78935,3.80406,3.81855,3.83284,3.84692,3.86081,3.87451,3.88802,3.90136,3.91451,3.9275,3.94032,3.95298,3.96548,3.97782,3.99002,4.00207,4.01397,4.02574,4.03737,4.04886,4.06022,4.07146,4.08257,4.09356,4.10443,4.11518,4.12582,4.13635,4.14676,4.15707,4.16728,4.17738,4.18738,4.19728,
9 4.20708,4.21679,4.22641,4.23593,4.24536,4.25471,4.26397,4.27314,4.28223,4.29124,4.30017,4.30902,4.31779,4.32649,4.33511,4.34366,4.35213,4.36053,4.36887,4.37713,4.38533,4.39346,4.40152,4.40952,4.41746,4.42533,4.43315,4.4409,4.44859,4.45622,4.4638,4.47132,4.47878,4.48619,4.49354,4.50084,4.50809,4.51528,4.52243,4.52952,4.53656,4.54355,4.5505,4.55739,4.56424,4.57105,4.5778,
10 4.58451,4.59118,4.5978,4.60438,4.61092,4.61741,4.62386,4.63027,4.63664,4.64297,4.64926,4.65551,4.66172,4.6679,4.67403,4.68013,4.68619,4.69221,4.6982,4.70415,4.71007,4.71595,4.7218,4.72761,4.73339,4.73914,4.74486,4.75054,4.75619,4.76181,4.76739,4.77295,4.77847,4.78397,4.78943,4.79487,4.80027,4.80565,
11 4.811,4.81631,4.82161,4.82687,4.8321,4.83731,4.84249,4.84765,4.85278,4.85788,4.86296,4.86801,4.87303,4.87803,4.88301,4.88796,4.89288,4.89778,4.90266,4.90752,4.91235,4.91716,4.92194,4.9267,4.93144,4.93616,4.94085,4.94553,4.95018,4.95481,4.95942,4.964,4.96857,4.97311,4.97764,4.98214,4.98663,4.99109,4.99554,4.99996,5.00437,5.00875,5.01312,5.01747,5.0218,5.02611,5.0304,
12 5.03467,5.03893,5.04316,5.04738,5.05159,5.05577,5.05994,5.06409,5.06822,5.07233,5.07643,5.08051,5.08458,5.08863,5.09266,5.09668,5.10068,5.10466,5.10863,5.11258,5.11652,5.12044,5.12434,5.12824,5.13211,5.13597,5.13982,5.14365,5.14747,5.15127,5.15506,5.15883,5.16259,5.16634,5.17007,5.17378,5.17749,5.18118,5.18485,5.18852,5.19217,5.1958,5.19943,5.20304,5.20663
13 };
14
15
16 double num=0.00;
17 while(1)
18 {
19 cin>>num;
20 if(num==0.00)
21 break;
22 int j=0;
23 while(length[j++]<num);
24 cout<<j-1<<" card(s)"<<endl;
25 }
26 return 0;
27 }
2 using namespace std;
3
4 int main()
5 {
6 double length[278]={
7 0,0.5,0.833333,1.08333,1.28333,1.45,1.59286,1.71786,1.82897,1.92897,2.01988,2.10321,2.18013,2.25156,2.31823,2.38073,2.43955,2.49511,2.54774,2.59774,2.64536,2.69081,2.73429,2.77596,2.81596,2.85442,2.89146,2.92717,2.96165,2.99499,3.02725,3.0585,3.0888,3.11821,3.14678,3.17456,3.20159,3.2279,3.25354,3.27854,3.30293,3.32674,3.35,3.37273,3.39495,3.41669,3.43796,3.4588,3.47921,3.49921,3.51881,3.53804,3.55691,3.57543,3.59361,3.61147,3.62901,
8 3.64625,3.6632,3.67987,3.69626,3.71239,3.72827,3.74389,3.75928,3.77443,3.78935,3.80406,3.81855,3.83284,3.84692,3.86081,3.87451,3.88802,3.90136,3.91451,3.9275,3.94032,3.95298,3.96548,3.97782,3.99002,4.00207,4.01397,4.02574,4.03737,4.04886,4.06022,4.07146,4.08257,4.09356,4.10443,4.11518,4.12582,4.13635,4.14676,4.15707,4.16728,4.17738,4.18738,4.19728,
9 4.20708,4.21679,4.22641,4.23593,4.24536,4.25471,4.26397,4.27314,4.28223,4.29124,4.30017,4.30902,4.31779,4.32649,4.33511,4.34366,4.35213,4.36053,4.36887,4.37713,4.38533,4.39346,4.40152,4.40952,4.41746,4.42533,4.43315,4.4409,4.44859,4.45622,4.4638,4.47132,4.47878,4.48619,4.49354,4.50084,4.50809,4.51528,4.52243,4.52952,4.53656,4.54355,4.5505,4.55739,4.56424,4.57105,4.5778,
10 4.58451,4.59118,4.5978,4.60438,4.61092,4.61741,4.62386,4.63027,4.63664,4.64297,4.64926,4.65551,4.66172,4.6679,4.67403,4.68013,4.68619,4.69221,4.6982,4.70415,4.71007,4.71595,4.7218,4.72761,4.73339,4.73914,4.74486,4.75054,4.75619,4.76181,4.76739,4.77295,4.77847,4.78397,4.78943,4.79487,4.80027,4.80565,
11 4.811,4.81631,4.82161,4.82687,4.8321,4.83731,4.84249,4.84765,4.85278,4.85788,4.86296,4.86801,4.87303,4.87803,4.88301,4.88796,4.89288,4.89778,4.90266,4.90752,4.91235,4.91716,4.92194,4.9267,4.93144,4.93616,4.94085,4.94553,4.95018,4.95481,4.95942,4.964,4.96857,4.97311,4.97764,4.98214,4.98663,4.99109,4.99554,4.99996,5.00437,5.00875,5.01312,5.01747,5.0218,5.02611,5.0304,
12 5.03467,5.03893,5.04316,5.04738,5.05159,5.05577,5.05994,5.06409,5.06822,5.07233,5.07643,5.08051,5.08458,5.08863,5.09266,5.09668,5.10068,5.10466,5.10863,5.11258,5.11652,5.12044,5.12434,5.12824,5.13211,5.13597,5.13982,5.14365,5.14747,5.15127,5.15506,5.15883,5.16259,5.16634,5.17007,5.17378,5.17749,5.18118,5.18485,5.18852,5.19217,5.1958,5.19943,5.20304,5.20663
13 };
14
15
16 double num=0.00;
17 while(1)
18 {
19 cin>>num;
20 if(num==0.00)
21 break;
22 int j=0;
23 while(length[j++]<num);
24 cout<<j-1<<" card(s)"<<endl;
25 }
26 return 0;
27 }
嘿嘿...直接搜...事先写一个程序吧所有的结果计算出来...(太卑鄙了)
Author: CriusWuBlog: http://kingpro.cnblogs.comContact: kingpro@live.cn
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

posted on
浙公网安备 33010602011771号