锘??xml version="1.0" encoding="utf-8" standalone="yes"?>国产欧美日韩在线观看,美女尤物久久精品,99国产精品久久久久久久成人热http://m.shnenglu.com/kuangbin/http://www.cnblogs.com/kuangbin/ zh-cnFri, 26 Sep 2025 08:59:42 GMTFri, 26 Sep 2025 08:59:42 GMT60[瀵煎叆]VK Cup 2012 Qualification Round 1 E. Phone Talkshttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167571.htmlkuangbinkuangbinMon, 05 Mar 2012 08:31:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167571.htmlhttp://m.shnenglu.com/kuangbin/comments/167571.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167571.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167571.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167571.html
E. Phone Talks
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Cool J has recently become a businessman Mr. Jackson, and he has to make a lot of phone calls now. Today he has n calls planned. For each call we know the moment ti (in seconds since the start of the day) when it is scheduled to start and its duration di (in seconds). All ti are different. Mr. Jackson is a very important person, so he never dials anybody himself, all calls will be incoming.

Mr. Jackson isn't Caesar and he can't do several things at once. If somebody calls him while he hasn't finished the previous conversation, Mr. Jackson puts the new call on hold in the queue. In this case immediately after the end of the current call Mr. Jackson takes the earliest incoming call from the queue and starts the conversation. If Mr. Jackson started the call at the second t, and the call continues for d seconds, then Mr. Jackson is busy at seconds t, t + 1, ..., t + d - 1, and he can start a new call at second t + d. Note that if Mr. Jackson is not busy talking when somebody calls, he can't put this call on hold.

Mr. Jackson isn't Napoleon either, he likes to sleep. So sometimes he allows himself the luxury of ignoring a call, as if it never was scheduled. He can ignore at most k calls. Note that a call which comes while he is busy talking can be ignored as well.

What is the maximum number of seconds Mr. Jackson can sleep today, assuming that he can choose an arbitrary continuous time segment from the current day (that is, with seconds from the 1-st to the 86400-th, inclusive) when he is not busy talking?

Note that some calls can be continued or postponed to the next day or even later. However, the interval for sleep should be completely within the current day.

Input

The first input line contains a pair of integers n, k (0 ≤ k ≤ n ≤ 4000) separated by a space. Following n lines contain the description of calls for today. The description of each call is located on the single line and consists of two space-separated integers ti and di, (1 ≤ ti, di ≤ 86400). All ti are distinct, the calls are given in the order of strict increasing ti.

Scheduled times of calls [ti, ti + di - 1] can arbitrarily intersect.

Output

Print a number from 0 to 86400, inclusive — the maximally possible number of seconds for Mr. Jackson to sleep today.

Sample test(s)
Input
3 2
30000 15000
40000 15000
50000 15000
Output
49999
Input
5 1
1 20000
10000 10000
20000 20000
25000 10000
80000 60000
Output
39999
Note

In the first sample the most convenient way is to ignore the first two calls.

In the second sample it is best to ignore the third call. In this case Mr. Jackson will have been speaking:

  • first call: from 1-st to 20000-th second,
  • second call: from 20001-st to 30000-th second,
  • fourth call: from 30001-st to 40000-th second (the third call is ignored),
  • fifth call: from 80000-th to 139999-th second.

 

Thus, the longest period of free time is from the 40001-th to the 79999-th second.

 

 

 

DP錛涳紱錛?/p>

#include<stdio.h>
#include<iostream>
#include<string>
#include<string.h>
using namespace std;
int dp[4005][4005];
struct node
{
int s,d;
};
node a[4005];
int main()
{
int i,j,n,k,ans;
while(scanf("%d%d",&n,&k)!=EOF)
{
for(i=0;i<n;++i)
{
scanf("%d%d",&a[i].s,&a[i].d);
}



ans=0;
for(i=0;i<=n;++i)
{

for(j=0;j<=k;++j)
{
dp[i][j]=86401;
}
}


dp[0][0]=1;
for(i=0;i<n;++i)
{
for(j=0;j<=k;++j)
{
if(j!=k)
dp[i+1][j+1]=min(dp[i+1][j+1],dp[i][j]);
if(dp[i][j]<a[i].s)
{
ans=max(ans,a[i].s-dp[i][j]);
dp[i+1][j]=min(dp[i+1][j],a[i].s+a[i].d);
}
else
{
dp[i+1][j]=min(dp[i+1][j],dp[i][j]+a[i].d);
}
}
}



for(j=0;j<=k;++j)
{
ans=max(ans,86401-dp[n][j]);
}
printf("%d\n",ans);
}

return 0;


}

 


鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/03/05/2380629.html

kuangbin 2012-03-05 16:31 鍙戣〃璇勮
]]>
[瀵煎叆]VK Cup 2012 Qualification Round 1 D. Ice Sculptureshttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167572.htmlkuangbinkuangbinMon, 05 Mar 2012 08:30:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167572.htmlhttp://m.shnenglu.com/kuangbin/comments/167572.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167572.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167572.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167572.html
D. Ice Sculptures
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

The Berland University is preparing to celebrate the 256-th anniversary of its founding! A specially appointed Vice Rector for the celebration prepares to decorate the campus. In the center of the campus n ice sculptures were erected. The sculptures are arranged in a circle at equal distances from each other, so they form a regular n-gon. They are numbered in clockwise order with numbers from 1 to n.

The site of the University has already conducted a voting that estimated each sculpture's characteristic of ti — the degree of the sculpture's attractiveness. The values of ti can be positive, negative or zero.

When the university rector came to evaluate the work, he said that this might be not the perfect arrangement. He suggested to melt some of the sculptures so that:

  • the remaining sculptures form a regular polygon (the number of vertices should be between 3 and n),
  • the sum of the ti values of the remaining sculptures is maximized.

 

Help the Vice Rector to analyze the criticism — find the maximum value of ti sum which can be obtained in this way. It is allowed not to melt any sculptures at all. The sculptures can not be moved.

Input

The first input line contains an integer n (3 ≤ n ≤ 20000) — the initial number of sculptures. The second line contains a sequence of integers t1, t2, ..., tn, ti — the degree of the i-th sculpture's attractiveness ( - 1000 ≤ ti ≤ 1000). The numbers on the line are separated by spaces.

Output

Print the required maximum sum of the sculptures' attractiveness.

Sample test(s)
Input
8
1 2 -3 4 -5 5 2 3
Output
14
Input
6
1 -2 3 -4 5 -6
Output
9
Input
6
1 2 3 4 5 6
Output
21
Note

In the first sample it is best to leave every second sculpture, that is, leave sculptures with attractivenesses: 2, 4, 5 懈 3.

 鏆村姏姹傝В鐨勩傘傘?/p>

灝辨槸絳夐棿闅斿彇鏁幫紝姹傚叾鍜屾渶澶у鹼紒錛侊紒

#include<stdio.h>
int aa[20110];


int main()
{


int n;
int res;
int sum;
while(scanf("%d",&n)!=EOF)
{
for(int i=1;i<=n;i++)
scanf("%d",&aa[i]);
res=-200000000;
for(int i=1;i<=n/3;i++)
{
if(n%i!=0)continue;
if(n/i<3)continue;
for(int j=1;j<=i;j++)
{
sum=0;
for(int k=j;k<=n;k+=i)
sum+=aa[k];
if(sum>res) res=sum;
}
}


printf("%d\n",res);


}
return 0;
}

 


鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/03/05/2380627.html

kuangbin 2012-03-05 16:30 鍙戣〃璇勮
]]>
[瀵煎叆]VK Cup 2012 Qualification Round 1 B. Taxihttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167573.htmlkuangbinkuangbinMon, 05 Mar 2012 08:28:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167573.htmlhttp://m.shnenglu.com/kuangbin/comments/167573.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167573.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167573.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167573.html
B. Taxi
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

After the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that the i-th group consists of si friends (1 ≤ si ≤ 4), and they want to go to Polycarpus together. They decided to get there by taxi. Each car can carry at most four passengers. What minimum number of cars will the children need if all members of each group should ride in the same taxi (but one taxi can take more than one group)?

Input

The first line contains integer n (1 ≤ n ≤ 105) — the number of groups of schoolchildren. The second line contains a sequence of integers s1, s2, ..., sn (1 ≤ si ≤ 4). The integers are separated by a space, si is the number of children in the i-th group.

Output

Print the single number — the minimum number of taxis necessary to drive all children to Polycarpus.

Sample test(s)
Input
5
1 2 4 3 3
Output
4
Input
8
2 3 4 4 2 1 3 1
Output
5
Note

In the first test we can sort the children into four cars like this:

  • the third group (consisting of four children),
  • the fourth group (consisting of three children),
  • the fifth group (consisting of three children),
  • the first and the second group (consisting of one and two children, correspondingly).

 

There are other ways to sort the groups into four cars.

 

 

 

姘撮錛?涓漢鐨勫崟鐙?/p>

3鍜?鎼厤錛?/p>

2鍜?鎼厤銆?/p>

3鏈夊鐨勮瘽鍙兘鍗曠嫭浜嗐?/p>

2鍙互鍔犲叆1涓殑

#include<stdio.h>
int aa[5];



int main()
{



int n;
int t;
while(scanf("%d",&n)!=EOF)
{
for(int i=0;i<5;i++)aa[i]=0;
while(n--)
{
scanf("%d",&t);
aa[t]++;
}
int res=0;
res+=aa[4];
if(aa[1]==aa[3])
{
res+=aa[1];
aa[1]=0;
aa[3]=0;
if(aa[2]%2==0)
{
res+=aa[2]/2;
}
else
{
res=res+aa[2]/2+1;
}
}
else if(aa[1]<aa[3])
{
res+=aa[1];
aa[3]-=aa[1];
aa[1]=0;

res+=aa[3];

if(aa[2]%2==0)
{
res+=aa[2]/2;
}
else
{
res=res+aa[2]/2+1;
}
}
else
{
res+=aa[3];
aa[1]-=aa[3];
aa[3]=0;

if(aa[2]%2==0)
{
res+=aa[2]/2;
}
else
{
res=res+aa[2]/2+1;
aa[1]-=2;
}

if(aa[1]>=1)
{
if(aa[1]%4==0) res+=aa[1]/4;
else
res=res+aa[1]/4+1;
}
}



printf("%d\n",res);
}



return 0;
}

 


鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/03/05/2380624.html

kuangbin 2012-03-05 16:28 鍙戣〃璇勮
]]>
[瀵煎叆]VK Cup 2012 Qualification Round 1 A. Next Roundhttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167574.htmlkuangbinkuangbinMon, 05 Mar 2012 08:26:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167574.htmlhttp://m.shnenglu.com/kuangbin/comments/167574.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/03/05/167574.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167574.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167574.html
A. Next Round
time limit per test
3 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

"Contestant who earns a score equal to or greater than the k-th place finisher's score will advance to the next round, as long as the contestant earns a positive score..." — an excerpt from contest rules.

A total of n participants took part in the contest (n ≥ k), and you already know their scores. Calculate how many participants will advance to the next round.

Input

The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 50) separated by a single space.

The second line contains n space-separated integers a1, a2, ..., an (0 ≤ ai ≤ 100), where ai is the score earned by the participant who got the i-th place. The given sequence is non-increasing (that is, for all i from 1 to n - 1 the following condition is fulfilled: ai ≥ ai + 1).

Output

Output the number of participants who advance to the next round.

Sample test(s)
Input
8 5
10 9 8 7 7 7 5 5
Output
6
Input
4 2
0 0 0 0
Output
0
Note

In the first example the participant on the 5th place earned 7 points. As the participant on the 6th place also earned 7 points, there are 6 advancers.

In the second example nobody got a positive score.

 

 

 

 

寰堢畝鍗曠殑棰樼洰~~~~~

#include<stdio.h>
int mm[120];
int main()
{


int n,k;


while(scanf("%d%d",&n,&k)!=EOF)
{
for(int i=1;i<=n;i++)
scanf("%d",&mm[i]);
int res=k;
if(mm[k]>0)
{
for(int i=k+1;i<=n;i++)
{
if(mm[i]<mm[k])break;
res++;
}
}
else
{
res--;
for(int i=k-1;i>=1;i--)
{
if(mm[i]>0) break;
res--;
}
}

printf("%d\n",res);
}


return 0;
}

 


鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/03/05/2380621.html

kuangbin 2012-03-05 16:26 鍙戣〃璇勮
]]>
[瀵煎叆]榪庢帴2012鏂拌禌瀛b斺擧DOJ緋誨垪鐑韓璧涳紙2錛? Problem E HDU4165 Pillshttp://m.shnenglu.com/kuangbin/archive/2012/03/03/167575.htmlkuangbinkuangbinSat, 03 Mar 2012 05:25:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/03/03/167575.htmlhttp://m.shnenglu.com/kuangbin/comments/167575.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/03/03/167575.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167575.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167575.html 

Problem E

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 0    Accepted Submission(s): 0


Problem Description
Aunt Lizzie takes half a pill of a certain medicine every day. She starts with a bottle that contains N pills.

On the first day, she removes a random pill, breaks it in two halves, takes one half and puts the other half back into the bottle.

On subsequent days, she removes a random piece (which can be either a whole pill or half a pill) from the bottle. If it is half a pill, she takes it. If it is a whole pill, she takes one half and puts the other half back into the bottle.

In how many ways can she empty the bottle? We represent the sequence of pills removed from the bottle in the course of 2N days as a string, where the i-th character is W if a whole pill was chosen on the i-th day, and H if a half pill was chosen (0 <= i < 2N). How many different valid strings are there that empty the bottle?
 

 

Input
The input will contain data for at most 1000 problem instances. For each problem instance there will be one line of input: a positive integer N <= 30, the number of pills initially in the bottle. End of input will be indicated by 0.
 

 

Output
For each problem instance, the output will be a single number, displayed at the beginning of a new line. It will be the number of different ways the bottle can be emptied.
 

 

Sample Input
6 1 4 2 3 30 0
 

 

Sample Output
132 1 14 2 5 3814986502092304
 
 
鐩稿綋浜庢眰N涓猈錛屽拰N涓狧鐨勬帓鍒楁暟錛岃屼笖瑕佹眰鍓嶉潰浠繪剰涓腑蹇呴渶H鐨勪釜鏁頒笉澶т簬W鐨勪釜鏁皛~~~
涓嶇煡閬撳摢浜涘ぇ紲炴槸鎬庝箞鏍峰仛鍑烘潵鐨勶紝濂藉揩鐨勯熷害灝卞仛鍑烘潵浜唦~~~
 
鎴戞兂浜嗗ソ涔呴兘娌℃湁鎯沖埌DP鐨勬柟娉曪紝
鏈鍚庢兂鍑烘潵浜嗭紝鎰熻鏂規(guī)硶姣旇緝絎▇~~~
 
杞寲鎴愪簡鍥撅紝W(xué)琛ㄧず寰涓嬭蛋錛孒琛ㄦ槸寰鍙寵蛋錛?/div>
鍒欏繀欏誨湪宸︿笅瑙掍腑銆?/div>
N涓猈鍜孒鐨勬椂鍊欏氨鏄埌N-1琛岀殑璺緞鏁?/div>
濡侼=1鏃訛紝涓篸p[0,0]
N=2鏃朵負(fù)dp[1,0]+dp[1,1]
N=3鏃朵負(fù)dp[2,0]+dp[2,1]+dp[2,2]
 
 
搴旇浼?xì)鏈夋洿濂界殑鏂规硶鐨剘~~~~
鎴戠殑鎬濊礬鏈夌偣韞変簡~~~~浣嗗垢濂藉仛鍑烘潵浜嗭紒
 
浠g爜濡備笅錛?/div>
#include<stdio.h>
long long dp[31][31];
void init()
{
dp[0][0]=1;
for(int i=1;i<31;i++)
{
dp[i][0]=1;
for(int j=1;j<i;j++)
dp[i][j]=dp[i-1][j]+dp[i][j-1];
dp[i][i]=dp[i][i-1];
}
}
int main()
{
int N;
init();
while(scanf("%d",&N),N)
{
printf("%I64d\n",dp[N][N]);
}
return 0;
}
瑕佹眰鐨勫叾瀹炲氨鏄粠錛?錛?錛夊埌(N,N)鐨勮礬寰勬暟錛屽彧鑳藉線涓嬫垨鑰呭線鍙寵蛋錛岃屼笖涓嶈兘璧板埌鍙充笂閮ㄥ垎鍘匯?/div>
鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/03/03/2378248.html

kuangbin 2012-03-03 13:25 鍙戣〃璇勮
]]>[瀵煎叆]榪庢帴2012鏂拌禌瀛b斺擧DOJ緋誨垪鐑韓璧涳紙2錛?Problem A HDU 4161 Iterated Differencehttp://m.shnenglu.com/kuangbin/archive/2012/03/03/167576.htmlkuangbinkuangbinSat, 03 Mar 2012 05:11:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/03/03/167576.htmlhttp://m.shnenglu.com/kuangbin/comments/167576.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/03/03/167576.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167576.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167576.htmlProblem A

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 0    Accepted Submission(s): 0


Problem Description
You are given a list of N non-negative integers a(1), a(2), ... , a(N). You replace the given list by a new list: the k-th entry of the new list is the absolute value of a(k) - a(k+1), wrapping around at the end of the list (the k-th entry of the new list is the absolute value of a(N) - a(1)). How many iterations of this replacement are needed to arrive at a list in which every entry is the same integer?

For example, let N = 4 and start with the list (0 2 5 11). The successive iterations are:

2 3 6 11
1 3 5 9
2 2 4 8
0 2 4 6
2 2 2 6
0 0 4 4
0 4 0 4
4 4 4 4
Thus, 8 iterations are needed in this example.
 

 

Input
The input will contain data for a number of test cases. For each case, there will be two lines of input. The first line will contain the integer N (2 <= N <= 20), the number of entries in the list. The second line will contain the list of integers, separated by one blank space. End of input will be indicated by N = 0.
 

 

Output
For each case, there will be one line of output, specifying the case number and the number of iterations, in the format shown in the sample output. If the list does not attain the desired form after 1000 iterations, print 'not attained'.
 

 

Sample Input
4 0 2 5 11 5 0 2 5 11 3 4 300 8600 9000 4000 16 12 20 3 7 8 10 44 50 12 200 300 7 8 10 44 50 3 1 1 1 4 0 4 0 4 0
 

 

Sample Output
Case 1: 8 iterations Case 2: not attained Case 3: 3 iterations Case 4: 50 iterations Case 5: 0 iterations Case 6: 1 iterations
 
 
 
 
 
姘撮~~~~~
榪唬灝卞彲浠ヤ簡錛?/div>
#include<stdio.h>
#include<math.h>
#include<iostream>
using namespace std;
int a[50];
int main()
{
int N,res,j;
int iCase=0;
while(scanf("%d",&N),N)
{
iCase++;
for(int i=0;i<N;i++)
{
scanf("%d",&a[i]);
}
for(j=0;j<N-1;j++)
{
if(a[j]!=a[j+1])break;
}
if(j>=N-1)
{
printf("Case %d: 0 iterations\n",iCase);
continue;

}
for(res=1;res<=1000;res++)
{
a[N]=a[0];
for(int i=0;i<N;i++)
{
a[i]=abs(a[i]-a[i+1]);
}
for(j=0;j<N-1;j++)
{
if(a[j]!=a[j+1])break;
}
if(j>=N-1)break;
}
if(res<=1000)printf("Case %d: %d iterations\n",iCase,res);
else printf("Case %d: not attained\n",iCase);
}
return 0;
}

鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/03/03/2378235.html

kuangbin 2012-03-03 13:11 鍙戣〃璇勮
]]>[瀵煎叆]搴楅暱鎺ㄨ崘鈪~~~http://m.shnenglu.com/kuangbin/archive/2012/02/27/167577.htmlkuangbinkuangbinMon, 27 Feb 2012 12:03:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/02/27/167577.htmlhttp://m.shnenglu.com/kuangbin/comments/167577.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/02/27/167577.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167577.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167577.html 搴楅暱鎺ㄨ崘鈪?/td>
Time Limit: 1000 MS Memory Limit: 65536 K
Total Submit: 97(31 users) Total Accepted: 28(24 users) Special Judge: No
Description

鎯沖繀澶у宸茬粡棰嗙暐浜嗗簵闀跨殑璋冪毊,鑷粠搴楅暱鐭ラ亾浜唙agaa涔嬪悗灝變竴鐩存矇榪鋒湡涓笉鑳借嚜鎷?鏁欎富鐪嬪埌鍚庡緢鏄激蹇冿紝鐜╃墿涓у織鍟?浜庢槸鏁欎富鏁欏簵闀夸簡涓涓獀agaa鐨勬柊鐢ㄦ硶,璧勬簮鎼滅儲(chǔ)鍔熻兘銆傝緭鍏ヤ竴浜涘叧閿瘝鍚庡彲浠ユ悳绱㈠嚭鐩稿叧鍏變韓鐨勫ソ璧勬簮錛屽簵闀垮緱鐭ュ悗鍙堟槸嬈e枩鑻ョ媯銆傚悓鏃?鏁欎富鍙堝彂鏄庝竴涓父鎴忥紝鏄笂嬈$殑鍗囩駭鐗?榪欐緇欏嚭涓浜涚敱瀛楁瘝鍜屾暟瀛楃殑鐜╁叿鐨勫悓鏃訛紝鍏抽敭瀛椾笉鍐嶆槸vagaa浜嗭紝闇瑕佽嚜宸辯粰鍑?鐪嬫渶鍚庤兘緇勬垚澶氬皯涓叧閿瓧銆?/p> Input

姣忚杈撳叆涓涓瓧絎︿覆鐢卞皬鍐欏瓧姣嶅拰鏁板瓧緇勬垚錛屾瘡涓瓧絎︿唬琛ㄤ竴涓帺鍏? 绱ф帴鐫杈撳叆涓涓叧閿瓧錛屽悓鏍風(fēng)敱瀛楁瘝鍜屾暟瀛楃粍緇勬垚錛屽瓧絎︿覆闀垮害0<n<=10000錛屽叧閿瓧闀垮害0<m<=200

澶勭悊鍒版枃浠剁粨鏉?/p> Output

杈撳嚭鑳藉緇勬垚鍏抽敭瀛楃殑鏁伴噺

鎸夌収鏍蜂緥杈撳嚭鏍煎紡杈撳嚭騫舵崲琛?

Sample Input

vagaadsfaagav  ga
asgvasdfzxcades  dea

Sample Output

Case 1: 2
Case 2: 1

Author void

 

#include<stdio.h>
#include<string.h>
int tt[40],count[40];
char str[10010];
int main()
{
int len,m;
int iCase=0;
while(scanf("%s",&str)!=EOF)
{
iCase++;
len=strlen(str);
memset(tt,0,sizeof(tt));
memset(count,0,sizeof(count));
for(int i=0;i<len;i++)
{
if(str[i]>='0'&&str[i]<='9')
{
m=str[i]-'0'+0;
tt[m]++;

}
else
{
m=str[i]-'a'+10;
tt[m]++;
}
}
scanf("%s",&str);
len=strlen(str);
for(int i=0;i<len;i++)
{
if(str[i]>='0'&&str[i]<='9')
{
m=str[i]-'0'+0;
count[m]++;

}
else
{
m=str[i]-'a'+10;
count[m]++;
}
}
int res=10000;
for(int i=0;i<=9+26;i++)
{
if(count[i]>0)
{
int tmp=tt[i]/count[i];
if(tmp<res) res=tmp;
}
}
printf("Case %d: %d\n",iCase,res);
}
return 0;
}

 


鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/02/27/2370325.html

kuangbin 2012-02-27 20:03 鍙戣〃璇勮
]]>
[瀵煎叆]闈掕洐榪囨渤~~~~http://m.shnenglu.com/kuangbin/archive/2012/02/27/167578.htmlkuangbinkuangbinMon, 27 Feb 2012 07:16:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/02/27/167578.htmlhttp://m.shnenglu.com/kuangbin/comments/167578.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/02/27/167578.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167578.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167578.html 闈掕洐榪囨渤
Time Limit: 1000 MS Memory Limit: 65535 K
Total Submit: 29(11 users) Total Accepted: 9(9 users) Special Judge: No
Description 鍦ㄦ渤涓婃湁涓搴х嫭鏈ㄦˉ錛屼竴鍙潚铔欐兂娌跨潃鐙湪妗ヤ粠娌崇殑涓渚ц煩鍒板彟涓渚с傚湪妗ヤ笂鏈変竴浜涚煶瀛愶紝闈掕洐寰堣鍘岃俯鍦ㄨ繖浜涚煶瀛愪笂銆傜敱浜庢ˉ鐨勯暱搴﹀拰闈掕洐涓嬈¤煩榪囩殑璺濈閮芥槸姝f暣鏁幫紝鎴戜滑鍙互鎶婄嫭鏈ㄦˉ涓婇潚铔欏彲鑳藉埌杈劇殑鐐圭湅鎴愭暟杞翠笂鐨勪竴涓叉暣鐐癸細(xì)0錛?錛?hellip;…錛孡錛堝叾涓璍鏄ˉ鐨勯暱搴︼級銆傚潗鏍囦負(fù)0鐨勭偣琛ㄧず妗ョ殑璧風(fēng)偣錛屽潗鏍囦負(fù)L鐨勭偣琛ㄧず妗ョ殑緇堢偣銆傞潚铔欎粠妗ョ殑璧風(fēng)偣寮濮嬶紝涓嶅仠鐨勫悜緇堢偣鏂瑰悜璺寵穬銆備竴嬈¤煩璺冪殑璺濈鏄痵鍒皌涔嬮棿鐨勪換鎰忔鏁存暟錛堝寘鎷瑂,t錛夈?span style="color: #e53333;">褰撻潚铔欒煩鍒版垨璺寵繃鍧愭爣涓篖鐨勭偣鏃訛紝灝辯畻闈掕洐宸茬粡璺沖嚭浜嗙嫭鏈ㄦˉ銆?/span>


棰樼洰緇欏嚭鐙湪妗ョ殑闀垮害L錛岄潚铔欒煩璺冪殑璺濈鑼冨洿s,t錛屾ˉ涓婄煶瀛愮殑浣嶇疆銆備綘鐨勪換鍔℃槸紜畾闈掕洐瑕佹兂榪囨渤錛屾渶灝戦渶瑕佽俯鍒扮殑鐭沖瓙鏁般?/span> Input 鏈夊緇勬祴璇曟暟鎹?/span>
瀵逛簬姣忕粍嫻嬭瘯鏁版嵁錛岀涓琛屽洓涓鏁存暟L, s, t, n錛? <= L <= 10^5, 1 <= s <= t <= 10錛? <= n <= 100錛夛紝鍒嗗埆琛ㄧず鐙湪妗ョ殑闀垮害錛岄潚铔欎竴嬈¤煩璺冪殑鏈灝忚窛紱伙紝鏈澶ц窛紱伙紝鍙?qiáng)妗ヤ笂鐭冲瓙鐨勪釜鏁般傜浜岃鏈塶涓笉鍚岀殑姝f暣鏁板垎鍒〃紺鴻繖n涓煶瀛愬湪鏁拌醬涓婄殑浣嶇疆錛堟暟鎹繚璇佹ˉ鐨勮搗鐐瑰拰緇堢偣澶勬病鏈夌煶瀛愶級銆傛墍鏈夌浉閭?cè)潥勬暣鏁颁箣闂寸敤涓涓┖鏍奸殧寮銆?/span> Output 姣忕粍嫻嬭瘯鏁版嵁浠呰緭鍑轟竴琛岋紝鍖呮嫭涓涓暣鏁幫紝琛ㄧず闈掕洐榪囨渤鏈灝戦渶瑕佽俯鍒扮殑鐭沖瓙鏁般?/span> Sample Input 10 2 3 5
2 3 5 6 7 Sample Output

2

                     

#include<stdio.h>
#include<string.h>
const int MAXN=100020;
int flag[MAXN];
int dp[MAXN];
int main()
{
int L,s,t,n;
int a;
while(scanf("%d%d%d%d",&L,&s,&t,&n)!=EOF)
{
memset(flag,0,sizeof(flag));
memset(dp,-1,sizeof(dp));//鍒濆鍖栵紝-1涓轟笉鑳藉埌杈劇殑
//dp[i]琛ㄧず鍒板簳 i 鐐歸渶瑕佺粡榪囩殑鏈灝戠煶瀛愭暟錛?1琛ㄧず涓嶈兘鍒拌揪
for(int i=0;i<n;i++)
{
scanf("%d",&a);
flag[a]=1;//鏈夌煶瀛愪負(fù)1錛屽惁鍒欎負(fù)0
}
dp[0]=0;
for(int i=s;i<=L+t-1;i++)
{
for(int j=i-t;j<=i-s;j++)// j 鐐硅煩鍒?i 鐐?
{
if(j>=0&&dp[j]!=-1)//j 鐐硅兘澶熻煩鍒?
{
if(dp[i]==-1)dp[i]=dp[j]+flag[i]; //絎竴嬈?鐩?鎺?緇?鍊?
else if(dp[i]>dp[j]+flag[i]) dp[i]=dp[j]+flag[i];//鎵懼皬鐨勫?

}
}
}
int res=10000;
for(int i=L;i<=L+t-1;i++)//L 鍒?L+t-1 涓渶灝忕殑闈?-1 鍊?
{
if(dp[i]!=-1&&dp[i]<res) res=dp[i];
}
printf("%d\n",res);
}
return 0;
}

 


鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/02/27/2369901.html

kuangbin 2012-02-27 15:16 鍙戣〃璇勮
]]>
[瀵煎叆]鍛婂埆2011錛岃繋鎺?012http://m.shnenglu.com/kuangbin/archive/2012/01/03/167579.htmlkuangbinkuangbinMon, 02 Jan 2012 16:18:00 GMThttp://m.shnenglu.com/kuangbin/archive/2012/01/03/167579.htmlhttp://m.shnenglu.com/kuangbin/comments/167579.htmlhttp://m.shnenglu.com/kuangbin/archive/2012/01/03/167579.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167579.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167579.html       2011宸茬粡閫濆幓錛?012宸茬粡鍒版潵~~~~

2011騫達(dá)紝鎬繪劅瑙夎嚜宸卞緱鍒頒簡寰堝錛屼篃澶卞幓浜嗗緢澶氾紝涔熺暀涓嬩笉灝界殑閬楁喚銆備粛璁板緱2011騫村埌鏉ョ殑鏃跺欙紝鎴戣嚜宸卞鑷繁璇磋繖涓騫村皢浼?xì)鏄垜鍏抽敭鐨勪竴騫達(dá)紝緇欒嚜宸卞畾涓嬩簡寰堝鐩爣~~~~榪欎簺鐩爣鍙兘璇存槸澶ц嚧瀹炵幇浜嗗惂錛屼篃寰堝閬楁喚錛?/span>

涓轟簡榪庢帴2012騫達(dá)紝鎬繪劅瑙夎嚜宸卞簲璇ュ啓鐐逛笢瑗匡紝鏉ユ葷粨鑷繁鐨?011錛岃鍒掍笅2012.浣嗘槸涓鐩存娊涓嶅嚭鏃墮棿鏉ュ啓銆傜瓑鏈夋椂闂翠簡鍐嶅啓涓綃囨潵鎬葷粨2011鍚э紒

浜虹敓搴旇澶勪簬涓嶆柇鐨勫鏂楀綋涓紒2012騫達(dá)紝鎴戣鍙栧緱鎴愬姛錛?012騫達(dá)紝鎴戜竴瀹氫細(xì)鍋氬緱鏇村ソ錛?/span>

鍔犳補(bǔ)錛?/span>

                     ————————————————————————————————————by kuangbin


鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2012/01/03/2310575.html

kuangbin 2012-01-03 00:18 鍙戣〃璇勮
]]>
[瀵煎叆]HDU 1006 Tick and Tickhttp://m.shnenglu.com/kuangbin/archive/2011/12/04/167580.htmlkuangbinkuangbinSun, 04 Dec 2011 07:17:00 GMThttp://m.shnenglu.com/kuangbin/archive/2011/12/04/167580.htmlhttp://m.shnenglu.com/kuangbin/comments/167580.htmlhttp://m.shnenglu.com/kuangbin/archive/2011/12/04/167580.html#Feedback0http://m.shnenglu.com/kuangbin/comments/commentRss/167580.htmlhttp://m.shnenglu.com/kuangbin/services/trackbacks/167580.html棰樼洰閾炬帴錛?a >http://acm.hdu.edu.cn/showproblem.php?pid=1006

 

榪欓鍋氫簡濂戒箙浜嗭紝瀛︿範(fàn)浜嗙綉涓婄殑瑙f硶鍚庤嚜宸卞啓鍑烘潵浜嗐?/p>

灝辨槸鏋氫婦12*60鍒嗛挓錛岀湅涓鍒嗛挓鍐呮湁澶氬皯縐掓槸happytime錛屼竴鍒嗛挓鍐呰В涓変釜涓嶇瓑寮忓緱鍒板尯闂淬?/p>

鍏蜂綋鐪嬩唬鐮併?/p>

浠g爜鏈夋敞閲婂緢璇︾粏鐨勩?/p>

#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
using namespace std;
struct qujian
{
double l,r;
};
double D;
qujian solve(double a,double b)//瑙f柟紼?D<=a*x+b<=360-D ,騫朵笖鍜?[0,60] 鍙栦氦闆?/span>
{
qujian p;
if(a>0)
{
p.l=(D-b)/a;
p.r=(360-D-b)/a;
}
else
{
p.l=(360-D-b)/a;
p.r=(D-b)/a;
}
if(p.l<0)p.l=0;
if(p.r>60)p.r=60;
if(p.l>=p.r) p.l=p.r=0;
return p;
}
qujian jiao(qujian a,qujian b)
{
qujian p;
p.l=max(a.l,b.l);
p.r=min(a.r,b.r);
if(p.l>=p.r) p.l=p.r=0;
return p;
}
/*
hh=30*h+m/2+s/120;
mm=6*m+s/10;
ss=6*s;
D<=|hh-mm|<=360-D;
D<=|hh-ss|<=360-D;
D<=|mm-ss|<=360-D;
hh-mm=
*/
double happytime(int h,int m)//璁$畻 h 鏃訛紝m 鍒?婊¤凍棰樻剰鐨勭鏁?/span>
{
double a,b;
qujian s[3][2];
qujian s1;

//瑙f柟紼?D<=|hh-mm|<=360-D
//hh=30*h+m/2+s/120;
//mm=6*m+s/10;
a=1.0/120-0.1;
b=30*h+m/2.0-6*m;
s[0][0]=solve(a,b);
s[0][1]=solve(-a,-b);

//瑙f柟紼? D<=|hh-ss|<=360-D
//hh=30*h+m/2+s/120;
//ss=6*s;
a=1.0/120-6.0;
b=30*h+m/2.0;
s[1][0]=solve(a,b);
s[1][1]=solve(-a,-b);

//瑙f柟紼? D<=|mm-ss|<=360-D
//mm=6*m+s/10;
//ss=6*s;
a=0.1-6;
b=6*m;
s[2][0]=solve(a,b);
s[2][1]=solve(-a,-b);

double res=0;
//鍏釜鍖洪棿錛岄変笁涓彇浜ら泦銆?br /> //鍥犱負(fù)緇濆鍊肩殑寮忓瓙寰楀埌鐨勪袱涓尯闂磋騫訛紝鑰屼笁涓笉鍚岃〃杈懼紡鐨勫尯闂磋浜わ紝鏁呰繖鏍峰仛銆?
for(int i=0;i<2;i++)
for(int j=0;j<2;j++)
for(int k=0;k<2;k++)
{
s1=jiao(jiao(s[0][i],s[1][j]),s[2][k]);
res+=s1.r-s1.l;
}
return res;
}

int main()
{
while(scanf("%lf",&D))
{
if(D==-1) break;
double res=0;
int h,m;
for(h=0;h<12;h++)
{
for(m=0;m<60;m++)
{
res+=happytime(h,m);
}
}
printf("%.3lf\n",res*100.0/(60*60*12));
}
return 0;
}

 


鏂囩珷鏉ユ簮:http://www.cnblogs.com/kuangbin/archive/2011/12/04/2275470.html

kuangbin 2011-12-04 15:17 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              国产精品久久网| 亚洲一区在线免费观看| 在线视频国内自拍亚洲视频| 欧美日韩一区二区欧美激情 | 99re热这里只有精品视频| 欧美精品成人一区二区在线观看| 亚洲综合欧美日韩| 在线视频亚洲欧美| 中文精品在线| 99riav1国产精品视频| 亚洲精品一区在线观看| 奶水喷射视频一区| 蜜桃伊人久久| 亚洲第一精品电影| 免费日韩成人| 亚洲国产一区二区a毛片| 亚洲欧洲精品一区二区三区波多野1战4 | 欧美精品激情在线| 欧美人与禽猛交乱配| 欧美日本韩国一区| 国产精品卡一卡二卡三| 国产日产欧美一区| 国产亚洲一区二区三区| 欧美日韩国产在线播放| 欧美性大战xxxxx久久久| 欧美视频一二三区| 国产女同一区二区| 亚洲国产婷婷综合在线精品| 一个人看的www久久| 亚洲三级免费电影| 亚洲高清激情| 亚洲天堂免费观看| 久久中文字幕一区| 一区二区三区国产| 麻豆国产va免费精品高清在线| 欧美剧在线观看| 国产欧美一二三区| 亚洲精品九九| 久久不射网站| 日韩视频免费| 久久久中精品2020中文| 欧美无乱码久久久免费午夜一区 | 小处雏高清一区二区三区| 国产精品99久久久久久宅男| 久久久999精品免费| 欧美日韩美女一区二区| 国产在线麻豆精品观看| 一本综合久久| 女生裸体视频一区二区三区| 宅男精品视频| 蜜臀va亚洲va欧美va天堂| 久久久久.com| 国产精品一区二区久久久| 亚洲美女在线一区| 久久影视精品| 欧美成人高清| 亚洲欧美久久久久一区二区三区| 亚洲欧美精品一区| 久久国产精品亚洲va麻豆| 亚洲人被黑人高潮完整版| 久久不射电影网| 国产精品麻豆va在线播放| 亚洲第一精品在线| 欧美一区日韩一区| 欧美91精品| 久久久九九九九| 樱桃视频在线观看一区| 午夜视频一区二区| 日韩午夜视频在线观看| 亚洲欧美日韩人成在线播放| 欧美精品免费看| 亚洲日本视频| 亚洲日本理论电影| 欧美一站二站| 国内外成人在线视频| 欧美亚洲视频| 亚洲欧美日韩另类| 国产人成精品一区二区三| 亚洲欧美中文另类| 亚洲一区二区三区涩| 玖玖玖国产精品| 亚洲第一中文字幕在线观看| 奶水喷射视频一区| 欧美成人在线影院| 日韩一区二区免费看| 亚洲黄一区二区| 欧美日韩18| 亚洲欧美日韩一区在线| 中文精品一区二区三区 | 国产精品视频免费| 久久成人综合网| 欧美亚洲三级| 国产精品久久久久久久久久免费| 亚洲一二三区精品| 亚洲你懂的在线视频| 国产无一区二区| 欧美成人激情在线| 欧美日韩国产bt| 午夜在线不卡| 欧美在线视频免费观看| 国产视频一区二区在线观看| 久久9热精品视频| 久久综合久色欧美综合狠狠| 一区二区三区产品免费精品久久75| 一本色道久久88亚洲综合88| 国产精品成人免费| 亚洲欧美成人网| 久久久午夜电影| 日韩视频二区| 亚洲综合色视频| 1024亚洲| 亚洲无线视频| 亚洲黄色片网站| 亚洲一区二区精品在线| 亚洲精品在线视频| 久久综合久久综合这里只有精品| 久久aⅴ国产欧美74aaa| 日韩亚洲欧美在线观看| 国产精品夜夜夜| 久久久xxx| 中文在线一区| 校园春色国产精品| 欧美精品久久99| 欧美成va人片在线观看| 国产日韩三区| 亚洲欧美日韩精品综合在线观看| 在线一区二区三区做爰视频网站| 免费不卡中文字幕视频| 免费成人性网站| 国产一区二区精品久久99| 亚洲一区二区在线视频| 亚洲伊人观看| 国产精品久久久久久久久婷婷| 亚洲全部视频| 99精品视频网| 欧美激情91| 亚洲人线精品午夜| 亚洲视频在线视频| 欧美亚韩一区| 亚洲综合999| 久久香蕉精品| 亚洲人体1000| 欧美伦理在线观看| 亚洲免费观看高清完整版在线观看熊| 亚洲人成毛片在线播放女女| 欧美电影打屁股sp| 日韩亚洲欧美中文三级| 小辣椒精品导航| 一区在线观看视频| 另类人畜视频在线| 亚洲高清免费视频| 这里只有精品电影| 国产精品免费福利| 久久精品国产77777蜜臀| 免费看的黄色欧美网站| 亚洲精选久久| 国产乱码精品一区二区三区五月婷| 性欧美办公室18xxxxhd| 免费在线观看一区二区| 日韩亚洲视频在线| 国产美女精品免费电影| 久久免费国产| 亚洲精品裸体| 香蕉久久夜色| 亚洲国产精品va| 国产精品看片资源| 蜜臀av在线播放一区二区三区 | 美女国产一区| 亚洲免费精品| 国产一区91| 欧美激情在线有限公司| 亚洲在线观看免费视频| 免费久久精品视频| 欧美一区二区高清| 亚洲免费观看高清完整版在线观看熊| 国产麻豆精品视频| 欧美成人免费在线视频| 亚洲男人的天堂在线| 亚洲第一精品电影| 久久精品视频亚洲| 中文网丁香综合网| 影音先锋日韩有码| 国产精品入口| 欧美乱大交xxxxx| 久久中文字幕导航| 亚洲自拍偷拍视频| 一区二区久久| 狠狠色丁香婷婷综合久久片| 欧美人与性动交α欧美精品济南到| 午夜精品免费| 9人人澡人人爽人人精品| 久久综合中文| 久久成人羞羞网站| 亚洲午夜精品网| 亚洲黄色毛片| 亚洲激情网站免费观看| 狠狠久久亚洲欧美专区| 国产日韩欧美一二三区| 国产精品毛片| 欧美人与禽性xxxxx杂性|