锘??xml version="1.0" encoding="utf-8" standalone="yes"?>午夜日韩在线观看,亚洲天天影视,亚洲高清不卡avhttp://m.shnenglu.com/kuangbin/http://www.cnblogs.com/kuangbin/ zh-cnSun, 16 Nov 2025 23:03:01 GMTSun, 16 Nov 2025 23:03:01 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鐨勬柟娉曪紝
鏈鍚庢兂鍑烘潵浜嗭紝鎰熻鏂規硶姣旇緝絎▇~~~
 
杞寲鎴愪簡鍥撅紝W琛ㄧず寰涓嬭蛋錛孒琛ㄦ槸寰鍙寵蛋錛?/div>
鍒欏繀欏誨湪宸︿笅瑙掍腑銆?/div>
N涓猈鍜孒鐨勬椂鍊欏氨鏄埌N-1琛岀殑璺緞鏁?/div>
濡侼=1鏃訛紝涓篸p[0,0]
N=2鏃朵負dp[1,0]+dp[1,1]
N=3鏃朵負dp[2,0]+dp[2,1]+dp[2,2]
 
 
搴旇浼氭湁鏇村ソ鐨勬柟娉曠殑~~~~~
鎴戠殑鎬濊礬鏈夌偣韞変簡~~~~浣嗗垢濂藉仛鍑烘潵浜嗭紒
 
浠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鐨勬柊鐢ㄦ硶,璧勬簮鎼滅儲鍔熻兘銆傝緭鍏ヤ竴浜涘叧閿瘝鍚庡彲浠ユ悳绱㈠嚭鐩稿叧鍏變韓鐨勫ソ璧勬簮錛屽簵闀垮緱鐭ュ悗鍙堟槸嬈e枩鑻ョ媯銆傚悓鏃?鏁欎富鍙堝彂鏄庝竴涓父鎴忥紝鏄笂嬈$殑鍗囩駭鐗?榪欐緇欏嚭涓浜涚敱瀛楁瘝鍜屾暟瀛楃殑鐜╁叿鐨勫悓鏃訛紝鍏抽敭瀛椾笉鍐嶆槸vagaa浜嗭紝闇瑕佽嚜宸辯粰鍑?鐪嬫渶鍚庤兘緇勬垚澶氬皯涓叧閿瓧銆?/p> Input

姣忚杈撳叆涓涓瓧絎︿覆鐢卞皬鍐欏瓧姣嶅拰鏁板瓧緇勬垚錛屾瘡涓瓧絎︿唬琛ㄤ竴涓帺鍏? 绱ф帴鐫杈撳叆涓涓叧閿瓧錛屽悓鏍風敱瀛楁瘝鍜屾暟瀛楃粍緇勬垚錛屽瓧絎︿覆闀垮害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暣鏁幫紝鎴戜滑鍙互鎶婄嫭鏈ㄦˉ涓婇潚铔欏彲鑳藉埌杈劇殑鐐圭湅鎴愭暟杞翠笂鐨勪竴涓叉暣鐐癸細0錛?錛?hellip;…錛孡錛堝叾涓璍鏄ˉ鐨勯暱搴︼級銆傚潗鏍囦負0鐨勭偣琛ㄧず妗ョ殑璧風偣錛屽潗鏍囦負L鐨勭偣琛ㄧず妗ョ殑緇堢偣銆傞潚铔欎粠妗ョ殑璧風偣寮濮嬶紝涓嶅仠鐨勫悜緇堢偣鏂瑰悜璺寵穬銆備竴嬈¤煩璺冪殑璺濈鏄痵鍒皌涔嬮棿鐨勪換鎰忔鏁存暟錛堝寘鎷瑂,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錛夛紝鍒嗗埆琛ㄧず鐙湪妗ョ殑闀垮害錛岄潚铔欎竴嬈¤煩璺冪殑鏈灝忚窛紱伙紝鏈澶ц窛紱伙紝鍙婃ˉ涓婄煶瀛愮殑涓暟銆傜浜岃鏈塶涓笉鍚岀殑姝f暣鏁板垎鍒〃紺鴻繖n涓煶瀛愬湪鏁拌醬涓婄殑浣嶇疆錛堟暟鎹繚璇佹ˉ鐨勮搗鐐瑰拰緇堢偣澶勬病鏈夌煶瀛愶級銆傛墍鏈夌浉閭葷殑鏁存暟涔嬮棿鐢ㄤ竴涓┖鏍奸殧寮銆?/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;//鏈夌煶瀛愪負1錛屽惁鍒欎負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騫達紝鎬繪劅瑙夎嚜宸卞緱鍒頒簡寰堝錛屼篃澶卞幓浜嗗緢澶氾紝涔熺暀涓嬩笉灝界殑閬楁喚銆備粛璁板緱2011騫村埌鏉ョ殑鏃跺欙紝鎴戣嚜宸卞鑷繁璇磋繖涓騫村皢浼氭槸鎴戝叧閿殑涓騫達紝緇欒嚜宸卞畾涓嬩簡寰堝鐩爣~~~~榪欎簺鐩爣鍙兘璇存槸澶ц嚧瀹炵幇浜嗗惂錛屼篃寰堝閬楁喚錛?/span>

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

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

鍔犳補錛?/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硶鍚庤嚜宸卞啓鍑烘潵浜嗐?/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 /> //鍥犱負緇濆鍊肩殑寮忓瓙寰楀埌鐨勪袱涓尯闂磋騫訛紝鑰屼笁涓笉鍚岃〃杈懼紡鐨勫尯闂磋浜わ紝鏁呰繖鏍峰仛銆?
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>
              日韩午夜av| 欧美伊人久久| 欧美激情免费在线| 一本大道久久a久久精品综合| 日韩午夜在线电影| 久久精品国产欧美激情 | 一本一本a久久| 免费观看日韩av| 国产欧美一区二区精品秋霞影院 | 国产欧美丝祙| 亚洲系列中文字幕| 亚洲国产精品一区二区第四页av | 亚洲一区二区三区在线| 老司机精品视频一区二区三区| 国产精品99一区| 亚洲欧洲在线一区| 久久久亚洲一区| 中文精品视频| 欧美日韩国产二区| 中文日韩欧美| 亚洲精品一区二区三区福利| 美日韩精品免费| 国产一区二区三区久久久久久久久 | 国产视频一区在线观看| 一区二区三区**美女毛片| 另类尿喷潮videofree | 免费不卡在线观看av| 亚洲国产成人午夜在线一区| 久久久久一区二区三区| 亚洲一区激情| 国产精品一卡二| 久久视频精品在线| 久久成年人视频| 国语自产精品视频在线看| 欧美怡红院视频| 久久久久9999亚洲精品| 黄色成人av在线| 久久先锋影音| 久久精品亚洲精品国产欧美kt∨| 亚洲第一精品夜夜躁人人爽| 久久综合久久美利坚合众国| 久久精品视频va| 黄色精品免费| 欧美国产91| 国产精品日韩精品欧美在线| 欧美一区二视频| 欧美在线你懂的| 亚洲第一色在线| 一区二区三区色| 国产农村妇女毛片精品久久莱园子 | 亚洲免费电影在线| 国产精品欧美经典| 久久国产乱子精品免费女| 欧美在线播放| 亚洲啪啪91| 亚洲乱码国产乱码精品精98午夜| 欧美系列亚洲系列| 亚洲美女av网站| 正在播放欧美视频| 韩国精品一区二区三区| 亚洲高清视频中文字幕| 久久精品视频va| 亚洲欧美日本精品| 欧美在线地址| 亚洲精选国产| 亚洲黄色视屏| 红桃视频国产一区| 99国产精品视频免费观看一公开| 国产精品永久在线| 久久精品亚洲一区| 欧美三级资源在线| 久久久欧美精品| 欧美人与性动交cc0o| 欧美伊人久久| 欧美午夜一区二区三区免费大片 | 亚洲精品一区二区在线观看| 国产香蕉久久精品综合网| 在线精品视频一区二区| 一区二区三区视频观看| 1204国产成人精品视频| 亚洲一区日韩在线| 最新69国产成人精品视频免费| 欧美伊人久久久久久午夜久久久久| 亚洲精品视频中文字幕| 西西人体一区二区| 亚洲视频一区二区| 欧美日韩三区| 欧美成人一品| 国产视频在线观看一区二区| 一区二区三区四区五区精品| 日韩写真在线| 裸体一区二区三区| 久久人人看视频| 好看的日韩视频| 久久久久久夜| 欧美激情1区| 亚洲人成网在线播放| 欧美黄色一区| 日韩视频免费在线观看| 中国女人久久久| 国产精品99免费看 | 亚洲一二三区在线观看| 亚洲一区二区三区免费观看 | 欧美色网在线| 亚洲午夜激情网页| 欧美一区午夜精品| 国内综合精品午夜久久资源| 久久精品官网| 欧美第一黄色网| 亚洲黄色一区| 免费看亚洲片| 亚洲理论在线| 亚洲欧美日韩在线高清直播| 国产情人节一区| 欧美一区二区三区免费大片| 久久久99免费视频| 一色屋精品视频免费看| 免费不卡中文字幕视频| 亚洲美女区一区| 亚洲欧美日韩国产| 国产一区二区在线观看免费| 久久一区中文字幕| 日韩一二在线观看| 久久成人免费日本黄色| 亚洲欧洲中文日韩久久av乱码| 欧美日韩精品欧美日韩精品| 亚洲无限av看| 另类图片综合电影| 亚洲图片欧洲图片日韩av| 国产亚洲a∨片在线观看| 欧美电影免费观看大全| 亚洲中字黄色| 欧美激情一二区| 午夜精品久久久久影视 | 亚洲激情视频网| 亚洲欧美一区二区三区久久| 激情视频一区二区三区| 欧美理论片在线观看| 新67194成人永久网站| 欧美激情精品久久久久久变态| 亚洲免费视频网站| 亚洲黄页一区| 国产日韩精品在线| 欧美国产日韩一二三区| 性色av一区二区三区| 91久久精品国产91性色| 欧美中文字幕在线播放| 99精品福利视频| 在线不卡中文字幕| 国产精品免费观看在线| 欧美成人精品影院| 亚洲一区免费网站| 亚洲乱码国产乱码精品精| 欧美国产日本| 久久亚洲国产成人| 久久精品av麻豆的观看方式| 在线中文字幕不卡| 最新国产拍偷乱拍精品 | 亚洲素人一区二区| 最新国产成人av网站网址麻豆| 国产在线精品一区二区夜色| 国产精品久久二区| 欧美区一区二| 欧美成年视频| 麻豆成人综合网| 久久精品中文字幕一区| 亚洲女人天堂成人av在线| 亚洲精品日产精品乱码不卡| 欧美aⅴ一区二区三区视频| 久久精品日韩| 欧美中在线观看| 欧美亚洲在线观看| 亚洲欧美日韩国产一区| 亚洲图色在线| 亚洲字幕在线观看| 亚洲午夜电影网| 中文日韩在线| 亚洲欧美日韩天堂一区二区| 亚洲一区二区在线看| 国产精品99久久久久久久vr| 99爱精品视频| 亚洲一区高清| 性色av一区二区三区红粉影视| 亚洲一区图片| 午夜精品av| 欧美一区免费| 久久精品成人欧美大片古装| 久久精品国产99| 久久一二三四| 欧美激情免费观看| 日韩视频精品在线观看| 日韩一级在线| 亚洲线精品一区二区三区八戒| 亚洲一区二区在线观看视频| 亚洲欧美日本视频在线观看| 久久er99精品| 免费亚洲一区| 欧美日韩亚洲一区二区三区四区| 欧美天堂亚洲电影院在线播放 | 久久婷婷综合激情|