ural 1023 Buttons
2011-02-03 13:34
267 查看
看到这个题, 不难让我们回忆起小学接触过的拿硬币问题(是甲和乙拿的, 还是别人拿的, 随便),
假设一次最多能拿N个, 那么后者的策略就是拿的硬币数=N+1-前者的.
这道题就是让你找到最小的N被给定值整除即可.
至于为什么要整除, 显然.
假设一次最多能拿N个, 那么后者的策略就是拿的硬币数=N+1-前者的.
这道题就是让你找到最小的N被给定值整除即可.
至于为什么要整除, 显然.
]#include<iostream> using namespace std; int main() { int i,j,k; int n; scanf("%d",&n); for(i=3;i<=n;i++) if(n%i==0) break; printf("%d/n",i-1); return 0; }
相关文章推荐
- URAL 1023 Buttons
- E - Buttons URAL - 1023
- URAL 1023 Buttons
- Ural 1023. Buttons
- URAL 1023 Buttons 博弈
- URAL 1023 Buttons 博弈
- URAL 1023 Buttons(巴什博弈水题)
- POJ 2368|URAL 1023|Buttons|博弈论
- Ural 1023. Buttons
- URAL1023
- 1023. Buttons
- URAL 1023 Background 分析
- URAL1005 Stone Pile
- ural 1010 Discrete Function
- URAL 1601. AntiCAPS (strings)
- 1023:坑爹的黑店 分数: 1
- 二分图最大匹配(匈牙利算法) URAL 1721 Two Sides of the Same Coin
- hdu 1023 卡特兰数
- URAL 2027 URCAPL, Episode 1 (模拟)
- 1023. Have Fun with Numbers (20)