码迷,mamicode.com
首页 >  
搜索关键字:ans    ( 3741个结果
hdu 1443 Joseph
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1443先把神级代码双手奉上....虽然看不懂吧...囧 1 #include 2 3 int ans[14]={0}; 4 5 int joseph(int k) 6 { 7 int cnt,...
分类:其他好文   时间:2014-07-29 13:46:28    阅读次数:199
Codeforces 452A Eevee
#include using namespace std; string m[]={"vaporeon","jolteon","flareon","espeon","umbreon","leafeon","glaceon","sylveon"}; int len[]={8,7,7,6,7,7,7,7}; int main() { int n,ans; char s[20]; ...
分类:其他好文   时间:2014-07-29 13:09:27    阅读次数:200
UVa127,"Accordian" Patience
注意1堆的时候,pile后面没有s!!!!因为这个WA了一次,否则就1A了犯了一个很幼稚很幼稚的错误,申请ans[]后玩了吧ans置0,结果调了好长好长时间,本来是敲完就能过的T T啊啊啊啊啊啊,一个多小时没了啊附上我调试时写的代码(把每一次运转都输出了= =一个一个看的,真心用了好长时间,头都大了...
分类:其他好文   时间:2014-07-29 12:19:06    阅读次数:237
旋转卡壳部分模板
凸包直径旋转卡壳凸包直径详解//计算凸包直径,输入凸包ch,顶点个数为n,按逆时针排列,输出直径的平方int rotating_calipers(int n){ int q = 1; int ans = 0; ch[n] = ch[0]; for(int i = 0 ; i ...
分类:其他好文   时间:2014-07-29 11:17:17    阅读次数:351
POJ 3047 Fibonacci
DEBUG很辛苦,且行, 且珍惜原代码: ans[0][0] = (ans[0][0] * a[flag][0][0] + ans[0][1] * a[flag][1][0]) % 10000; ans[0][1] = (ans[0][0] * a[...
分类:其他好文   时间:2014-07-28 23:51:24    阅读次数:374
CSUOJ 1217 奇数个的那个数
Description给定些数字,这些数中只有一个数出现了奇数次,找出这个数。Input每组数据第一行n表示数字个数,1 2 int main() 3 { 4 int n, x, ans; 5 while (scanf("%d", &n) != EOF) 6 { 7 ...
分类:其他好文   时间:2014-07-28 23:39:24    阅读次数:481
筛选法求素数
一:素数的基本求法:bool pd(int x){ if(x==1)return false; for(int i=2;i*i1。那么必然存在点(x/k,y/k),会挡住(x,y)。问题就变成了:求1-N中,所有与N互质的数的个数。这不就是欧拉函数....so,ans=(euler(1)...
分类:其他好文   时间:2014-07-28 11:30:40    阅读次数:240
Primes on Interval
AC代码:#include#include#include#includeusingnamespacestd;constintmaxn=1001000;#defineinf(1ans)ans=tmp;tmp=p[s+k-1]-a+1;if(tmp>ans)ans=tmp;for(inti=s;i+k...
分类:其他好文   时间:2014-07-27 23:32:49    阅读次数:227
FZU 1901
#include #include 考查了对next数组的了解using namespace std;#define max 1000005int next[max],l,ans[max];char s[max];void getNext(){ int j,k; next[0]=-1; j=0;k=...
分类:其他好文   时间:2014-07-27 23:26:49    阅读次数:174
uva 122 - Trees on the level(一棵看着书都写不利索的树……)
#include #include #include #include #include #include using namespace std; const int maxn = 1000; char s[maxn]; bool failed; vector ans; struct node { bool have_value; int v; node *left,*...
分类:其他好文   时间:2014-07-27 11:54:43    阅读次数:198
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!