mac_n_cheese_pog's blog

By mac_n_cheese_pog, history, 3 years ago, In English

i tried to solve a problem.i remember this problem was discussed by my teacher.he use bruteforce but why tle.c++ so stupidly slow lmao

https://codeforces.net/contest/96/problem/B

https://pastebin.com/Wb7sLbwi

  • Vote: I like it
  • -56
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

use python its faster ;)

»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

First of all, C++ is really fast, your solution is the reason why you are failing.

Second, why calculate all the numbers from 4 to 1e9? The question only ask if n is a lucky number, so just check for n only. You complicated things, calculate the solution for all numbers, thus getting TLE.

Lastly, why are you ranting here instead of asking nicely for help? Learn some basic common sense.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    asking nicely wont help.see my first blog.people will just downvote genuine newbie problem and upvote trash blog from high elo coders.i feel bad for them sometimes

    • »
      »
      »
      3 years ago, # ^ |
        Vote: I like it +13 Vote: I do not like it

      Your first blog still has a legit comment helping you out. All other blogs are either you just ranting about C++ and DP, or asking questions and expecting others to help you out. Even when you ask a question and when others answer you, you just ignore them or ask back "how is it so simple? are u a grandmaster?". I don't see a reason why you shouldn't be downvoted. Your latest blogs are all rants about binary search (which is really relevant in higher problems, for example see problem 1548B, and other blogs are about your opinions about GMs and C++. Please learn some common sense before posting like that, and if you don't then expect even more downvotes.