Блог пользователя Profesora

Автор Profesora, история, 7 лет назад, По-английски

Hello, i have a problem with http://mirror.codeforces.com/problemset/problem/279/C to see my code here is it https://ideone.com/LNijT4 my logic as following first i got my input then i did accumulate to got the number of increases happened i think it's clear idea then according to the definition of ladders "explained in the problem" that ladder must be increasing then at point it start to decrease. what i do in each query is to find the number of increases that happened in the given range "from l to r" according to ladder definition i add number of increases "happened in range" to the begin of the range "L" i should get x such that after x the whole segment must be decreasing and before it must be increasing then if i find the number of increase before x is equal to the number of increase in the whole range it should be "Yes" else "No"

now what's wrong with this idea i am sure that it must work ?? help please ! :(

Полный текст и комментарии »

  • Проголосовать: нравится
  • -16
  • Проголосовать: не нравится

Автор Profesora, история, 7 лет назад, По-английски

Hello, Problem:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=646&page=show_problem&problem=1401 Code:https://ideone.com/YKNCzG Time complexity For the previous Code IS O(n!) n<=26 which gives me TLE every time i submit it it's seems to be madness to write such a backtracking code to solve this problem with such a big complexity,but sadly i don't know what should i do ! So would you please Help me !

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится