poj2505:A multiplication game(Hash)
来源:互联网 发布:js怎么隐藏标签 编辑:程序博客网 时间:2024/05/22 10:46
传送门
题意:
给一个
题解:
好像大家都是用的不太严谨的做法。。
因为层数是
#include<cstdio>#include<iostream>#include<cstring>#include<string>#include<algorithm>#include<cmath>#include<cstdlib>#include<map>typedef long long ll;using namespace std;const int N=1e3+50;map<ll,int>SG;inline ll rd(){ char ch=getchar();int i=0,f=1; while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();} while(isdigit(ch)){i=(i<<1)+(i<<3)+ch-'0';ch=getchar();} return i*f;}ll n;inline bool sg(ll x){ if(x>=n)return 0; if(SG.find(x)!=SG.end())return SG[x]; for(int j=2;j<=9;j++){ if(!sg(x*j))return SG[x]=1; } return SG[x]=0;}int main(){ while(scanf("%d",&n)!=EOF){ SG.clear(); puts(sg(1)?"Stan wins.":"Ollie wins."); }}
阅读全文
0 0
- poj2505:A multiplication game(Hash)
- poj2505 - A multiplication game
- 【poj2505】A multiplication game
- [POJ2505]A multiplication game(博弈)
- A Multiplication Game (博弈)
- poj 2505 A multiplication game(博弈)
- (挑战编程_5_5)A multiplication game
- HDU(1517)A Multiplication Game(博弈)
- A Multiplication Game 1517 (博弈+规律)
- HDU 1517 A Multiplication Game(博弈)
- HDU 1517 A Multiplication Game(博弈)
- POJ 2505 A multiplication game(博弈)
- hdoj 1517 A Multiplication Game(博弈)
- 【HDU1517】A Multiplication Game(博弈论)
- A Multiplication Game (博弈,规律)
- hdu 1517 A Multiplication Game(规律)
- A Multiplication Game
- HDU1517-A Multiplication Game
- poj日记(2632)
- MyBatis框架配置与使用1
- C语言等待一秒,延时函数sleep()
- 【计算方法笔记】python四阶Runge-Kutta法
- 为项目整合Spring Boot Acuator
- poj2505:A multiplication game(Hash)
- 9. java.util.Collections
- 在ROS中使用中文语音交互(百度语音baidu_speech)
- Okhttp2同步,异步 get,post
- Effective TensorFlow Chapter 9: TensorFlow模型原型的设计和利用python ops的高级可视化
- android中getWidth()和getMeasuredWidth()之间的区别
- 数据挖掘学习------------------4-分类方法-7-支持向量机(SVM)
- UE 通用小功能代码集合《一》
- 面试知识点—多线程同步【1】之CountDownLatch