Profesora's blog

By Profesora, history, 6 years ago, In English

Hello, i have a problem with http://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 ! :(

Full text and comments »

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

By Profesora, history, 7 years ago, In English

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 !

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it