【HDU】1848 Fibonacci again and again
and HDU again Fibonacci
2023-09-27 14:22:21 时间
http://acm.hdu.edu.cn/showproblem.php?pid=1848
题意:同nim,3堆,每次取的为fib数,n<=1000
#include <cstdio> #include <cstring> using namespace std; int f[1005], a[100]; bool b[20]; int main() { a[1]=1; a[2]=2; for(int i=3; i<=15; ++i) a[i]=a[i-1]+a[i-2]; f[0]=0; for(int i=1; i<=1000; ++i) { memset(b, 0, sizeof b); for(int j=1; j<=15; ++j) if(i>=a[j]) b[f[i-a[j]]]=1; for(int j=0; j<=16; ++j) if(!b[j]) { f[i]=j; break; } } int x, y, z; while(scanf("%d%d%d", &x, &y, &z), x|y|z) f[x]^f[y]^f[z]?puts("Fibo"):puts("Nacci"); return 0; }
好无聊= =
求出sg然后求sg和就行了= =而且是暴力哦~
相关文章
- 数位DP CF388D - Fox and Perfect Sets
- 异常解决:non-compatible bean definition of same name and class【com.xxx.xxx.XXX】
- 使用AxisHelper帮助理解View and Data API中的坐标系统
- Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.
- hdu 4315 Climbing the Hill && poj 1704 Georgia and Bob阶梯博弈--尼姆博弈
- Awesome Go精选的Go框架,库和软件的精选清单.A curated list of awesome Go frameworks, libraries and software
- svn branch and merge(svn切换分支和合并)详解
- How to Copy and Paste in the Ubuntu Gnome Terminal
- hdu 4685 Prince and Princess(匈牙利算法 连通分量)
- HDU 3046Pleasant sheep and big big wolf(切最小网络流)
- ggplot的boxplot/violin plot添加显著性 | Add P-values and Significance Levels to ggplots | 定量分析
- Windows OneDrive folder is not supported on PHP versions below 7.2.23 and 7.3.10. Upgrade your PHP