问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

couponarific广告弹窗怎么也删不掉,怎么办

发布网友 发布时间:2022-04-14 22:21

我来回答

2个回答

懂视网 时间:2022-04-15 02:43

Problem L Arif inDhaka(First Love Part 2) Input: standard input Output: standard output Time Limit: 2 seconds Our hero Arif is now inDhaka(Look at problem10244 – First Loveif you want to know more about Arif, but that information is not n

Problem L

Arif in Dhaka (First Love Part 2)

Input: standard input

Output: standard output

Time Limit: 2 seconds

Our hero Arif is now in Dhaka (Look at problem 10244 – First Love if you want to know more about Arif, but that information is not necessary for this problem. In short, Arif is a brilliant programmer working at IBM) and he is looking for his first love. Days pass by but his destiny theory is not working anymore, which means that he is yet to meet his first love. He then decides to roam around Dhaka on a rickshaw (A slow vehicle pulled by human power), running DFS (by physical movement) and BFS (with his eyes) on every corner of the street and market places to increase his probability of reaching his goal. While roaming around Dhaka he discovers an interesting necklace shop. There he finds some interesting necklace/bracelet construction sets. He decides to buy some of them, but his programmer mind starts looking for other problems. He wants to find out how many different necklace/bracelet can be made with a certain construction set. You are requested to help him again. The following things are true for a necklace/bracelet construction set.

a) All necklace/bracelet construction sets has a frame, which has N slots to place N beads.

b) All the slots must be filled to make a necklace/bracelet.

c) There are t types of beads in a set. N beads of each type are there in the box. So the total number of beads is tN (t multiplied by N), of which exactly N can be used at a time.


Fig: Different types of necklace for t=2 and different value of N

The figure above shows necklaces for some different values of N (Here, t is always 2). Now let’s turn out attentions to bracelets. A bracelet is a necklace that can be turned over (A junior programmer in Bangladesh says that wrist watch is a necklace (Boys!!! Don’t mind :-))). So for abracelet the following two arrangements are equivalent. Similarly, all other opposite orientation or mirror images are equivalent.

So, given the description of a necklace/bracelet construction set you will have to determine how many different necklace and bracelet can be formed with made with that set

Input

The input file contains several lines of input. Each line contains two positive integers N(0

Output

For each line of input produce one line of output which contains two round numbers NN and NB separated by a single space, where NN is the number of total possible necklaces and NB is the number of total possible bracelets for the corresponding input set.

Sample Input

5 2

5 3

5 4

5 5

Sample Output

8 8

51 39

208 136

629 377

改代码需要处理一下数的幂不然在运算过程中会有数据的溢出影响结果

关于详解看书;

因为i可以从1到n得到n个置换 所以结果要除以n

又因为对于手镯存在翻转 奇数有n个对称轴即n个置换

偶数有n/2 + n/2共n个对称轴也是n个置换


(注:本题中注明了n和t大于0,如果在一般题目中没有注明,那么一定要考虑n==0的情况)

所以结果要除以2n

#include 
#include 
#include 
#include 
using namespace std;
typedef long long LL;
LL power[20];//power[i] = pow(t,i)
int gcd(int x,int y)
{
 while(x!=y)
 {
 if(x>y)
 x = x - y;
 else
 y = y - x;
 }
 return x;
}
int main()
{

 int n,t;
 while(scanf("%d%d",&n,&t)==2)
 {
 LL sum = 0;
 power[0] = 1;
 for(int i = 1;i<=n;++i)
  power[i] = power[i-1]*t;
 for(int i = 1;i<=n;++i)
  sum += power[gcd(i,n)];
 LL sum1 = 0;
 if(n%2==1)
 {
  sum1 = n*power[(n+1)/2];

 }else
 {
  sum1 = n/2*power[n/2+1] + n/2*power[n/2];

 }
 printf("%lld %lld
",sum/n,(sum + sum1)/2/n);
 }
 return 0;
}

热心网友 时间:2022-04-14 23:51

试试360安全卫士设置中的弹窗设置,把它设置成自动处理模式。
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
长沙到西昌。坐火车先从长沙到成都、成都东,再到西昌,哪个方便一些 S先生与P先生谜题的题面 为什么首都设在襄阳 改姓可以不随父母性吗 韩艺瑟怎么改姓? 纸、墨、笔、砚是中国传统的文房四宝,墨的使用最早在 [ ] A.商代后期... 想问下创维光伏E企赢模式有哪些优势,到底值不值得投资啊?有没有合作... 太平洋太享e保百万医疗值得入手吗?每年花多少钱? 爱e满分适合哪些人买?注意哪些问题? 太平洋太享e保百万医疗适合哪些人买?价格多少? 稳这打怎么打拼音 稳行高处的拼音怎么写 稳字的拼音怎么打? 稳,稍,盏,绝的拼音 稳拼音是什么 稳定的稳的拼音 稳字的拼音怎么念? 稳这个字怎么读 在QQ上聊天,交朋友现实吗、? 埃斯顿估值大吗?埃斯顿后市股价走向?埃斯顿后期走势? 埃斯顿股票为什么股价变成28了 埃斯顿后续走势?埃斯顿股票分析公告?关于埃斯顿的股价怎么看? 埃斯顿现阶段怎么样?埃斯顿明天可能走势?埃斯顿股价为何大跌? 埃斯顿业绩发布?埃斯顿股价低?埃斯顿股 大跌? 埃斯顿业绩表?埃斯顿股价变化?埃斯顿跌的原因? 埃斯顿为什么这么多人少钱?埃斯顿2021业绩大涨原因?埃斯顿股票吧 新浪网? 埃斯顿股票为什么还以前股价高?埃斯顿半年报披露时间?埃斯顿多少钱一股可以进入? 埃斯顿股票上市以来的最高股价是多少?埃斯顿股票价格历史行情?埃斯顿什么时候能涨? 埃斯顿走势技术分析?埃斯顿2021年的股价走势?埃斯顿股价低于发行价? 埃斯顿现在估值多少?埃斯顿原来股价怎么这么高?埃斯顿最新消息002747? 婚庆外展设计,展台特装搭建,特装展览设计哪家好 婚庆场地如何设计? 婚庆公司办公室装修设计该怎么做 怎么看自己的什么时候注册的 手机看视频卡怎么办? 智能手机播放视频很慢是怎么回事 我是用华为的手机,连上WiFi但是能加载出字,图片和视频加载得很慢或者加载不出来。 怎么查别人注册多长时间? 刚刚注册的时间怎么查? 周大福项链上CTF 18k是什么意思? 怎么查看用多久 怎么查看自己的用了多久 驻车制动器处于制动状态标志是什么? 同价位的电饭煲哪个牌子的比较好呢? TOKIT这个牌子的电饭煲外观好好看啊,不知道使用怎么样,用过的分享下 tokit电饭煲和钛古电饭煲哪个好? 操作方便的电饭煲有适合的选择吗? 手刹标志是“叹号”还是“P”? 我163的身高55公斤的体重BREAKING能跳吗 奥普浴霸温度上不来什么原因?