HDU 4861 Couple doubi

Doubi Gao3 posted @ 2014年7月25日 14:29 in acm with tags math , 1941 阅读

前天刚到学校,很久没刷题,需要一段时间寻找状态。

这是22号的多校,我没赶上,现在重新写一下来帮助自己找回状态。

由于p一定是素数,打表可知循环节为p-1,并且只有p-1号球有价值。一开始题意理解错,以为必须从第一号球开始轮流拿,其实是任意顺序拿的。这样,求出总共可以拿到几次有价值的球k,如果k为奇数则代表doubiNan可以多拿一次,输出"YES",如果为偶数,那么他们拿的次数相等,输出"NO"。

 

#include <iostream>
#include <vector>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int k, p;

int main()
{
	while(~scanf("%d%d", &k, &p))
	{
		int n = k/(p-1);
		
		if(n & 1) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}
Liwovosa 说:
2021年4月21日 16:48

Hello There. I found your blog using msn. This is an extremely well written article. I will be sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll certainly comeback. 123movies

Liwovosa 说:
2021年4月24日 17:15

I love visiting sites in my free time. I have visited many sites but did not find any site more efficient than yours. Thanks for the nudge! 마진거래

jackjohnny 说:
2021年5月01日 04:50

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. disney+ for freedisney+ free trial

Liwovosa 说:
2021年5月02日 17:24

If you set out to make me think today; mission accomplished! I really like your writing style and how you express your ideas. Thank you. fx사이트

Liwovosa 说:
2021年5月03日 19:52 Superbly written article, if only all bloggers offered the same content as you, the internet would be a far better place.. 파워볼전용사이트
jackjohnny 说:
2021年5月04日 19:06

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. indian visa online

Liwovosa 说:
2021年5月04日 20:28

This particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform! how to become a payment service provider

Liwovosa 说:
2021年5月05日 17:20

Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. starting a merchant processing business

Liwovosa 说:
2021年5月05日 19:51

Thanks for another excellent post. Where else could anybody get that type of info in such an ideal way of writing? In my opinion, my seeking has ended now. how to sell merchant services

Liwovosa 说:
2021年5月06日 18:40 Excellent website! I adore how it is easy on my eyes it is. I am questioning how I might be notified whenever a new post has been made. Looking for more new updates. Have a great day! 홀덤사이트
gratis freispiele 说:
2021年5月09日 19:41

I loved your post. Much obliged.

gratis freispiele 说:
2021年5月09日 19:41

I loved your post. Much obliged.

jackjohnny 说:
2021年5月11日 18:21

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. how to get uc in pubg for free 2021

Liwovosa 说:
2021年5月17日 19:32

It is included in my habit that I often visit blogs in my free time, so after landing on your blog. I have thoroughly impressed with it and decided to take out some precious time to visit it again and again. Thanks. baccarat

Liwovosa 说:
2021年5月18日 23:16

Friend, this web site might be fabolous, i just like it. canadian online casino

Liwovosa 说:
2021年5月19日 17:34

I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues. best online casino canada

jackjohnny 说:
2021年5月19日 20:05

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me. how to make 200 dollars per day

لی ویوسوہ ہو یار 说:
2021年5月20日 19:44

Hey, this day is too much good for me, since this time I am reading this enormous informative article here at my home. Thanks a lot for massive hard work. polskie kasyno online

لی ویوسوہ ہو یار 说:
2021年5月20日 22:48 nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! online casino
لی ویوسوہ ہو یار 说:
2021年5月23日 16:27

If you set out to make me think today; mission accomplished! I really like your writing style and how you express your ideas. Thank you. casinos online

لی ویوسوہ ہو یار 说:
2021年5月23日 21:06

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. raspadinhas online

لی ویوسوہ ہو یار 说:
2021年5月26日 20:20 Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. Pro Housekeepers Vacation Rental Cleaning Guide
karamba casino 说:
2021年5月27日 01:32

Really appreciate you sharing this blog article. Thanks Again. Much obliged.

123 movies 说:
2021年6月02日 00:48

Nice to be visiting your blog once more, it has been months for me. Well this article that ive been waited for therefore long. i want this article to finish my assignment within the faculty, and it has same topic together with your article. Thanks, nice share.

order weed online 说:
2021年6月05日 12:43

Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too.

jackjohnny 说:
2021年6月05日 22:28

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. visto de turista canadá

custom made patches 说:
2021年6月08日 12:29

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post.

WatchCartoonOnline 说:
2021年6月10日 12:02

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article.

jackjohnny 说:
2021年6月10日 20:28

Thanks for a very interesting blog. What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. Citronella oil Manufacturers in India

arkseo 说:
2021年6月12日 20:26

Great content material and great layout. Your website deserves all of the positive feedback it’s been getting. <a href="https://dripivplus.com/uwatchfree-website-do-you-know-the-safest-way-where-you-can-download-the-latest-movies-from-uwatchfree/">uwatchfree</a>

jackjohnny 说:
2021年6月17日 16:09

I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... coin master hack

jackjohnny 说:
2021年6月17日 22:08

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. 먹튀검증

jackjohnny 说:
2021年6月20日 16:16

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Mobile Legends

arkseo 说:
2021年6月21日 03:48

nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! Flyttstädning Boden

arkseo 说:
2021年6月22日 13:11

Thanks for sharing this information. I really like your blog post very much. You have really shared a informative and interesting blog post with people.. Flyttstädning Boden

gutes online spiel 说:
2021年6月22日 20:45

A round of applause for your article. Thanks Again. Want more.

arkseo 说:
2021年6月23日 13:51

Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts. verzuz battle updates

jackjohnny 说:
2021年6月23日 18:16

Hello, this weekend is good for me, since this time i am reading this enormous informative article here at my home. Towelsforthebeach.com

arkseo 说:
2021年6月29日 12:37

Great things you’ve always shared with us. Just keep writing this kind of posts.The time which was wasted in traveling for tuition now it can be used for studies.Thanks starting a credit card processing company

jackjohnny 说:
2021年6月29日 20:03

I think that thanks for the valuabe information and insights you have so provided here. Visa de India

arkseo 说:
2021年6月30日 13:57

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! merchant services sales tips

spielautomaten-deuts 说:
2021年7月01日 21:11

I think this is a real great blog article. Much thanks again. Awesome.

arkseo 说:
2021年7月02日 14:52

I have bookmarked your blog, the articles are way better than other similar blogs.. thanks for a great blog! North American Bancard ISO

arkseo 说:
2021年7月03日 12:51

I love the way you write and share your niche! Very interesting and different! Keep it coming! start a payment gateway business

arkseo 说:
2021年7月04日 13:05

i am for the first time here. I found this board and I in finding It truly helpful & it helped me out a lot. I hope to present something back and help others such as you helped me. become a payment service provider

arkseo 说:
2021年7月05日 14:36

I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often. meta tag generator

jackjohnny 说:
2021年7月13日 17:07

I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. Brawl Stars Hack 2021

jackjohnny 说:
2021年7月14日 17:35

ikinci el cikma enjektör bosch kullanilmis oto enjektör satin al kullanilmis enjektör

mobilebet 说:
2021年7月14日 22:26

Wow great post. Really looking forward to read more. Fantastic.

online casinos 说:
2021年7月26日 04:08

I am thankful for the blog post. Awesome.

spielautomaten deuts 说:
2021年7月31日 00:18

A round of applause for your post. Want more.

casino germany 说:
2021年8月04日 18:36

Thank you ever so for you blog article. Really thank you! Keep writing.

Arkseo 说:
2021年8月21日 18:20

We are The Just a Single Offering 200 high quality blog comments backlinks HIGH DA PA and TF/CF Also Good Blog Comments Backlinks on ACTUAL PAGES. blog comments blog comments blog comments

Arkseo 说:
2021年8月22日 00:19

I just found this blog and have high hopes for it to continue. Keep up the great work, its hard to find good ones. I have added to my favorites. Thank You. ancient japanese weight loss tonic

Arkseo 说:
2021年8月26日 02:04

I really loved reading your blog. It was very well authored and easy to understand. Unlike other blogs I have read which are really not that good.Thanks alot! starting a credit card processing company

Arkseo 说:
2021年8月29日 13:06

I appreciate everything you have added to my knowledge base.Admiring the time and effort you put into your blog and detailed information you offer.Thanks. merchant processing ISO

XE88 apk download 说:
2021年8月30日 00:19

Initial You got a awesome blog .I determination be involved in plus uniform minutes. i view you got truly very functional matters , i determination be always checking your blog blesss.

Arkseo 说:
2021年8月30日 12:59

Im no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. Secure Search

Arkseo 说:
2021年8月30日 14:02

I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites blog site list and will be checking back soon. Please check out my site as well and let me know what you think. Search Engines

Arkseo 说:
2021年9月03日 17:58

I really appreciate the kind of topics you post here. Thanks for sharing us a great information that is actually helpful. Good day! selling credit card processing

Arkseo 说:
2021年9月04日 14:03

Awesome blog. I enjoyed reading your articles. This is truly a great read for me. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work! merchant services sales job description

Arkseo 说:
2021年9月04日 18:50

Nice post. I was checking constantly this blog and I am impressed! Extremely helpful information specially the last part I care for such info a lot. I was seeking this particular information for a very long time. Thank you and good luck. merchant sales jobs

Arkseo 说:
2021年9月04日 21:34

You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!! become a payment service provider

Arkseo 说:
2021年9月06日 12:57

I admit, I have not been on this web page in a long time... however it was another joy to see It is such an important topic and ignored by so many, even professionals. I thank you to help making people more aware of possible issues. how to sell credit card processing

Arkseo 说:
2021年9月08日 12:19

Friend, this web site might be fabolous, i just like it. white label credit card processing

Arkseo 说:
2021年9月10日 02:00

nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! merchant services partnerships

Arkseo 说:
2021年9月10日 12:38

Interesting and amazing how your post is! It Is Useful and helpful for me That I like it very much, and I am looking forward to Hearing from your next.. how much do merchant services reps make

Arkseo 说:
2021年9月11日 13:43

Thank you a bunch for sharing this with all of us you actually realize what you are talking about! Bookmarked. Please also seek advice from my site =). We could have a hyperlink change contract between us! merchant sales rep, merchant services

which harry potter h 说:
2021年9月12日 20:07

Machos Gracias for your blog. Really thank you! Will read on...

Satta king 说:
2021年9月25日 05:27

I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.

Liwovosa 说:
2021年12月21日 22:08 Interesting post. I Have Been wondering about this issue, so thanks for posting. Pretty cool post.It 's really very nice and Useful post.Thanks 안전놀이터
Liwovosa 说:
2021年12月27日 19:17

The writer has outdone himself this time. It is not at all enough; the website is also utmost perfect. I will never forget to visit your site again and again. outlook 365

Liwovosa 说:
2021年12月29日 15:03

I have read a few of the articles on your website now, and I really like your style of blogging. I added it to my favorites blog site list and will be checking back soon. Please check out my site as well and let me know what you think. 토토사이트

Liwovosa 说:
2021年12月29日 22:27 I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. metal push button switch
Liwovosa 说:
2022年1月02日 15:04

<p>
Attractive, post. I just stumbled upon your weblog and wanted to say that I have liked browsing your blog posts. After all, I will surely subscribe to your feed, and I hope you will write again soon! <a href="https://paalaarurbanfarms.com/farmhouse-near-chennai/">Farmhouse near chennai</a></p>

DewaQQ 说:
2022年4月19日 04:55

Thank you so much for the blog post. Thanks Again. Awesome.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter