原文地址:http://blog.himdd.com/?p=2286题意: if the square root of the difference between the square of its distance to the center and the square of the radius is less than1.7320508075688772935274463415058723669428052538103806280558069794519330169088000370811461867572485756756261414154067030299699450949989 Read More
posted @ 2012-04-19 12:54 Muse牧马 Views(337) Comments(0) Diggs(0) Edit
原文地址:http://blog.ac521.org/?p=212题意:给你三个硬币在测试中出现正反面的个数。问在三个硬币都使用的前提下,通过每次选举不同的硬币,最终能否组成出现正反面概率相同的情况?思路:Yes的情况:1.三个出现正面的概率都为0.5;2.三个出现正面的概率都为有大于0.5的,也有小于0.5的;其它情况:No Read More
posted @ 2012-04-19 12:48 Muse牧马 Views(182) Comments(0) Diggs(0) Edit
http://blog.ac521.org/?p=209题意:给你一个N,K;然后又有K个数i;表示从1,2,3…N个数 经过K次操作,每次操作是去掉第i小的数。求所有去掉数的之和;思路:用线段树写的,具体看代码吧#include<iostream>#include<cstdio>using namespace std;const int maxn=272144;int tree[maxn<<2];int pos;void build(int l,int r, int rt){ tree[rt]=r-l+1; if(l==r) return ; int m Read More
posted @ 2012-04-19 12:45 Muse牧马 Views(163) Comments(0) Diggs(0) Edit
http://blog.ac521.org/?p=206题意:给你一个序列,求一个连续子序列,使这个连续子序列的和的绝对值最少,输出最小是多少。先求出每一个的前n项和,然后排序,找差值最小的就可以了。#include <stdio.h>#include <string.h>#include <algorithm>using namespace std;int a[1000010];int main(){ int i,j,k,l,m,n,max,min; int T=1; scanf("%d",&n); while(n--) { m Read More
posted @ 2012-04-19 11:23 Muse牧马 Views(154) Comments(0) Diggs(0) Edit