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

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

sometimes I saw — unfortunately, I can't remember where I saw that — problems like below. I simplified the statement for clarity.

Problem)

You're given an array A with N elements, (A[0], A[1], ..., A[N-1]). and there are two kinds of queries

  • 1 x y : change A[x] to y

  • 2 l r : count the number of different elements in A[l], A[l+1], ..., A[r].

Condition)

  • 1<=N, Q<=100,000 (Q: total number of queries)

  • 1<=A[i]<=10^9 + 9 (A[i] : integer)

I tried to approach with segment tree but still have no idea.. How can I solve this kind of problems?

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

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

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

Today, I saw an weird situation in Codeforces. When I enter the site, it showed me a usual site for a moment. But after that, it turned to blank webpage with only a string "What does this code do?". I saw the webpage's HTML code and found out there's an unusual javascript snippet in the blog entry. I thought it's kind of an XSS attack and tried again with "block javascript" option on.(and then I could see the usual site)

I'm not sure why this happened, but hope this won't last long. If the administrator of the Codeforce can see this, please fix it soon.

p.s. The author of that article(with harmful script) is "10minutemail", it seems he(or she) used a temporal mail. But I believe that Codeforces' server log can help find out who he/she is.

p.s.2. I'm not sure if the "Add Images" work without Javascript, so I add the imgur link for what I found ( http://imgur.com/a/vSEOT )

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

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