nyan101's blog

By nyan101, history, 7 years ago, In English

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?

Full text and comments »

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

By nyan101, history, 8 years ago, In English

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 )

Full text and comments »

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