TopBoy

网易有道难题初赛

栏目:比赛历程      27,425 Views      4,472 枚回复

有道初赛分成24个Group,我在第19个,题目都非常简单

250分的题目是求从A到B之间有多少个数恰好可以被数组divisors中的K个数整除,只要简单的枚举一下就可以
关键代码如下:

int findLargest(vector <int> d, int K, int A, int B)

{

      for(int i=B; i>=A; –i)

      {

            int k=0;

            for(int j=0;j<d.size();++j)

                  if(i%d[j] == 0)k++;

            if(k==K)return i;

      }

      return -1;
}

 

500分的题目描述:

双倍超立方数是指一个正整数可以正好被拆分为两种不同的a^3+b^3的方式,其中a,b均为整数且0<a<=b。对于任何一个指定的 int n, 返回所有的小于等于n的双倍超立方数的个数。

题目也比较简单,枚举a,b,用map记录某个整数能拆分的方式数,最后统计一下能拆分成两种的个数即可,代码如下:

 

map <int, int> dict;
map <int, int>::iterator it;

int count(int n)

{

     int res=0;

     dict.clear();        

     for(int i=1;i<1010;++i)

     {

         for(int j=i;j<1010;++j)

         {

              if(i*i*i+j*j*j <= n)

                   dict[i*i*i+j*j*j]++;

         }

     }

     for(it=dict.begin();it!=dict.end();++it)

         if(it->second==2)res++;

     return res;

}

最后提交代码后分别得了244和440分,第二题写的慢了,总分684.36,system test后Group内排第2,眼观了一下整体排名应该在90多名,进决赛是没有什么希望了!

 

 


468 X 60 广告位

标签: , , , ,

转载注明:转自TopBoy

本站遵循:署名-非商业性使用-禁止演绎 3.0 共享协议

收藏分享: QQ书签 / 百度收藏 / Google书签 / 收藏到鲜果 / Digg / Del.icio.us


4,472 枚回复


  1. free samples 说:

    Great website! I am loving it!! Will come back again. I am taking your feeds also

  2. Hey friend, thank you for this site.
    I will post it on Face

  3. while the sites we link to below are completely unrelated to ours, we think they are worth a read, so have a look

  4. sms tarot 说:

    Sorry for the huge review, but I’m really loving the new Zune, and hope this, as well as the excellent reviews some other people have written, will help you decide if it’s the right choice for you.

  5. videncia 说:

    If you’re still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you’ll know which is right for you.

  6. namesps domain I had this website bookmarked a while previously but my notebook crashed. I have since gotten a new one and it took me a while to find this! I also in fact like the theme though….

    I had this website bookmarked a while previously but my notebook crashed. I have since gotten a new one and it took me a while to find this! I also in fact like the theme though….

  7. Thanks for the info, I must bookmark your website for my reference

  8. tarot sms 说:

    This is getting a bit more subjective, but I much prefer the Zune Marketplace. The interface is colorful, has more flair, and some cool features like ‘Mixview’ that let you quickly see related albums, songs, or other users related to what you’re listening to. Clicking on one of those will center on that item, and another set of “neighbors” will come into view, allowing you to navigate around exploring by similar artists, songs, or users. Speaking of users, the Zune “Social” is also great fun, letting you find others with shared tastes and becoming friends with them. You then can listen to a playlist created based on an amalgamation of what all your friends are listening to, which is also enjoyable. Those concerned with privacy will be relieved to know you can prevent the public from seeing your personal listening habits if you so choose.

  9. tarot 806 说:

    Hands down, Apple’s app store wins by a mile. It’s a huge selection of all sorts of apps vs a rather sad selection of a handful for Zune. Microsoft has plans, especially in the realm of games, but I’m not sure I’d want to bet on the future if this aspect is important to you. The iPod is a much better choice in that case.

  10. Good website! I truly love how it is simple on my eyes and the data are well written. I am wondering how I could be notified when a new post has been made. I’ve subscribed to your feed which must do the trick! Have a nice day!

  11. There are certainly a couple more details to take into consideration, but thank you for sharing this information.

  12. Yo JDM 说:

    I truly appreciate this post. I have been looking all over for this! Thank goodness I found it on Bing. You’ve made my day! Thanks again.

  13. Пригласи жриц любви из Киева, если тебе все равно, как проводить свой досуг, умудрица увидеть для себя подходящую партнершу. Интим досуг экстра классного класса – именно это сфера деятельности интима.

  14. After study a few of the blog posts on your website now, and I truly like your way of blogging. I bookmarked it to my bookmark website list and will be checking back soon. Pls check out my web site as well and let me know what you think.

  15. Kris Alveraz 说:

    I precisely desired to thank you so much all over again. I do not know the things that I might have tried in the absence of those basics documented by you

  16. [...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[...]……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……

  17. Learn to write himself, the article from another source

  18. Biuro Podrozy 说:

    Thanks for another wonderful article. The place else may just anyone get that kind of information in such a perfect method of writing? I’ve a presentation subsequent week, and I am at the search for such info.

  19. travel & vacation A interesting post there mate . Thank you for the post !…

    A interesting post there mate . Thank you for the post !…

  20. new perfumes 说:

    Smell Well And Attract Men…

    It’s a website that is new to this topic, see more if you are interested…[...]…

  21. After examine just a few of the weblog posts in your web site now, and I truly like your approach of blogging. I bookmarked it to my bookmark website checklist and will probably be checking again soon. Pls try my web site as nicely and let me know what you think.

  22. gym injury 说:

    [...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[...]……

    [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]……


发表回复


XHTML: 您可以使用如下代码:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>