首页 > TAG信息列表 > TKO
TKO 6-7DP入门之搬寝室
搬寝室 涉及数学公式的证明以及一些贪心思想: Problem Description 搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆,因为n是一个小于2000的整数,实在是太多了,于是xhd决定随便搬2k件TKO 2-2需要考虑周全的贪心问题--田忌赛马
Problem Description Here is a famous story in Chinese history. “That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and others.” “Both of Tian and the king have three horsesTKO 1-2基本快速幂的基本操作(熟背)
以余数为例: #include using namespace std; int power(int a,int b,int p) { int ans=1%p; for(;b;b>>=1){ if(b&1) ans=(long long)ansa%p; a=(long long)aa%p; } return ans; } int main(){ int a,b,p; while(cin>>a&&a!=0){ cout<<“请输入指数:”<&