题意:纳税额为金额的最大因数(除了本身).为了逃税将金额n分为n1+n2+.......问怎样分纳税最少. 哥德巴赫猜想: 任一大于2的偶数都可写成两个质数之和. 质数情况: 任何大于5的奇数都是三个素数之和 因此,如果n是偶数,结果就是2. 如果n是奇数.奇数只能拆成一奇一偶.分为2种情况.一偶是2时,那么如果一奇是质数,结果为2.如果一奇不是质数,那么结果至少为3,由于哥德巴赫猜想,3一定可行的,因此结果就是3. 一偶不是2时,一偶至少要交税2,一奇至少交税1,同样由猜想,结果为3. //#…
D. Taxes 题目链接 http://codeforces.com/contest/735/problem/D 题面 Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to n (n ≥ 2) burles and the amount of tax he has to pay is calculated a…
题目链接:Taxes D. Taxes time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mr. Funt now lives in a country with a very specific tax laws. The total income of mr. Funt during this year is equal to…
时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 131072K,其他语言262144K64bit IO Format: %lld 题目描述 Forever97与未央是一对笔友,他们经常互相写信.有一天Forever97去邮局寄信,发现邮局的收费方式变成了按字收费,收取的费用为总字数除了其自身以外的最大因子.虽然Forever97是一个有情调的人,但他不想因新收费方式而破财,所以他打算把信分成几份寄出去来减少邮费.已知Forever97写的信共有n个字,可以拆成无数封信,也可以不拆,…
C. Tennis Championship(递推,斐波那契) 题意:n个人比赛,淘汰制,要求进行比赛双方的胜场数之差小于等于1.问冠军最多能打多少场比赛.题解:因为n太大,感觉是个构造.写写小数据,看看有没有结论. 2 3 4 5 6 7 8 9 10 11 12 (人数) 1 2 2 3 3 3 4 4 4 4 4 (比赛数) 发现比赛数的增长成斐波那契.维护一个前缀和即可. #include <bits/stdc++.h> #define ll long long using names…
A - Ostap and Grasshopper zz题能不能跳到  每次只能跳K步 不能跳到# 问能不能T-G  随便跳跳就可以了  第一次居然跳越界0.0  傻子哦  WA1 n,k = map(int,input().split()) s = input() i = 0 st = -1 def jump(st): while(st<n): st+=k if(st>=n or s[st]=='#'): return "NO" if(s[st]=='T' or s[st…
C. Tennis Championship 题目链接 http://codeforces.com/contest/735/problem/C 题面 Famous Brazil city Rio de Janeiro holds a tennis tournament and Ostap Bender doesn't want to miss this event. There will be n players participating, and the tournament will fo…
B. Urbanization 题目链接 http://codeforces.com/contest/735/problem/B 题面 Local authorities have heard a lot about combinatorial abilities of Ostap Bender so they decided to ask his help in the question of urbanization. There are n people who plan to move…
题目链接: A:Ostap and Grasshopper B:Urbanization C:Tennis Championship D:Taxes 分析:这场第一二题模拟,三四题数学题 A. 直接模拟即可 B. 排序从大到小取n1个数到城市1,n2个数到城市二,n1<=n2 C. 递推.斐波拉契数列 dp[i] 表示赢i场比赛需要多少人, 则 dp[0] = 1,dp[1] = 2,dp[3] = dp[1] +dp[0],  dp[ans] = dp[ans-1] + dp[ans-2]一次…
A.= = B. 题意:给出n个数和n1和n2,从n个数中分别选出n1,n2个数来,得到n1个数和n2个数的平均值,求这两个平均值的最大和 分析:排个序从后面抽,注意先从末尾抽个数小的,再抽个数大的 C. 题意:有n个队伍比赛,每两个队伍比赛结束后输的人退场,赢的人场次增加1,现在由你来设计比赛顺序(比赛的两个队伍的场次之差不能大于1),使得最后胜利的冠军队伍的参加场次最多,输出这个场次 分析:先开始的贪心错了,以为就是简单的每次对半打 设f(i)表示打i场最少需要f(i)个队伍 f(i)=f(…