Tparsa's blog

By Tparsa, history, 9 years ago, In English

Hi everybody !

I got Time limit exceeded on test 5 on D — Mr. Kitayuta's Colorful Graph this is my code please help me.

tnQ! :)

  • Vote: I like it
  • +11
  • Vote: I do not like it

»
9 years ago, # |
  Vote: I like it -14 Vote: I do not like it

Why nobody answer me?! :((

»
9 years ago, # |
  Vote: I like it +13 Vote: I do not like it

You have memset(mark, 0, sizeof mark); n^2 times! This may be the reason!

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

    I tried this code but still Tle on test 5

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

      I dont know why are you using cin and cout and scanf too stick to one of them !

      cin and cout are very slow when they sync with scanf and printf and stdio functions !

      Try reading about it or simply change each cin cout with scanf printf!

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

        Oops tnQ ! :D that's my mistake

»
9 years ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

also i got TLE on test 6 !