Posts
2015
hdoj 2436 Collision Detection
Collision Detection # **Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1207 Accepted Submission(s): 367 **
hdu 5233 Gunner II (bc #42 B) (离散化)
Gunner II # **Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1433 Accepted Submission(s): 540 **
bc #43(hdu 5265) pog loves szh II (单调性优化)
pog loves szh II # **Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2115 Accepted Submission(s): 609 **
sgu 455. Sequence analysis (floyd 判圈算法,O(1)空间复杂度求循环节)
455. Sequence analysis # 比赛的时候逗了,往看空间限制了….
SGU 456 Annuity Payment Scheme
水题,推个公式出来,注意精度…一遍A
1 2 /************************************************************************* 3 > File Name: code/2015summer/#5/D.cpp 4 > Author: 111qqz 5 > Email: rkz2013@126.com 6 > Created Time: 2015年07月30日 星期四 13时17分26秒 7 ************************************************************************/ 8 9 #include<iostream> 10 #include<iomanip> 11 #include<cstdio> 12 #include<algorithm> 13 #include<cmath> 14 #include<cstring> 15 #include<string> 16 #include<map> 17 #include<set> 18 #include<queue> 19 #include<vector> 20 #include<stack> 21 #define y0 abc111qqz 22 #define y1 hust111qqz 23 #define yn hez111qqz 24 #define j1 cute111qqz 25 #define tm crazy111qqz 26 #define lr dying111qqz 27 using namespace std; 28 #define REP(i, n) for (int i=0;i<int(n);++i) 29 typedef long long LL; 30 typedef unsigned long long ULL; 31 const int inf = 0x7fffffff; 32 int s,m,p; 33 double ans; 34 35 double cal(double x,int n) 36 { 37 double res = 1.0; 38 for ( int i = 1 ; i <= n ; i++ ) 39 { 40 res = res * x; 41 } 42 // cout<<"res:"<<res<<endl; 43 return res; 44 } 45 int main() 46 { 47 cin>>s>>m>>p; 48 double sum = 0; 49 double per = p*1.0/100+1; 50 for ( int i = 1 ; i <= m; i++ ) 51 { 52 sum=sum+1.0/cal(per,i); 53 // cout<<"sum:"<<sum<<endl; 54 } 55 // cout<<sum<<endl; 56 cout<<fixed<<setprecision(5)<<s*1.0/sum<<endl; 57 58 return 0; 59 }
poj 2823 Sliding Window (单调队列)
Sliding Window
看这个问题:An array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves rightwards by one position.Your task is to determine the maximum and minimum values in the sliding window at each position.
(bc #45) A - Dylans loves numbers (hdu 5272)
·2 分钟
快要炸了..
tle成狗
因为是tle,看了下自己没有写cin cout,估计就是算法的问题…
codeforces 442C. Artem and Array
C. Artem and Array
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Artem has an array of n positive integers. Artem decided to play with it. The game consists of n moves. Each move goes like this. Artem chooses some element of the array and removes it. For that, he gets min(a, b) points, where a and b are numbers that were adjacent with the removed number. If the number doesn’t have an adjacent number to the left or right, Artem doesn’t get any points.
cf 442B Andrey and Problem
B. Andrey and Problem
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Andrey needs one more problem to conduct a programming contest. He has n friends who are always willing to help. He can ask some of them to come up with a contest problem. Andrey knows one value for each of his fiends – the probability that this friend will come up with a problem if Andrey asks him.
cf 443B Kolya and Tandem Repeat
·1 分钟
B. Kolya and Tandem Repeat
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Kolya got string s for his birthday, the string consists of small English letters. He immediately added k more characters to the right of the string.
(BC 一周年) hdu 5312 Sequence
比赛的时候没做出来.这道题需要用到的一个重要的性质是,任意一个自然数可以表示成至多三个三角形数(1,3,6,10,15…..)的和(orz高斯)然后也有推广到任意自然数可以表示成k个k角形数的和的结论(费马提出了猜想,柯西给了证明)然后官方题解说的比较好:
(BC 一周年)hdu 5311 Hidden String
·2 分钟
http://acm.hdu.edu.cn/showproblem.php?pid=5311 题意:问能否从一个给定的字符串中拿出三个不相交的字串(原串可以有剩余),组成字符串“anniversary” 思路:暴力。