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

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

In my icpc regionals they put this problem (link below), but no one came up with a correct solution that runs in time. Does anyone know a solution? The time limit is 60 seconds.

Do you think it can be solved in time? The official solution is a silly heuristic and it is easy to find test cases to make it give wrong answer.

http://localdoc.scusa.lsu.edu/problems-regional/prb.php?prob=10

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

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

Автор PeterNaut, 9 лет назад, По-английски

Something like Div 2. A or B. Sometimes they can be fun to solve :P

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

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

Автор PeterNaut, 9 лет назад, По-английски

The answer is trivial and left as an exercise to the reader.

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

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

Автор PeterNaut, 9 лет назад, По-английски

I want to share a funny thing I found.

Recently, I was watching very inspirational address speeches of important tech people such as Steve Jobs in Stanford University, Steve Wozniak in Berkeley, Bill Gates in Harvard, and so on. I was feeling very enthusiastic about all of these fabulous talks, so I decided to look on Youtube for an address speech of Mark Zuckerberg.

I clicked on the first video which was "Mark Zuckerberg speech to 8th graders." Clearly, the 8th graders were talking to each other, not caring much about Mark, and the speaker introduced him as "Mark ZuckerMan." All of these while Mark had an expression of "How did I get here?"

Oh Mark, what happened? At least you got your address speech :P

Link to video: http://www.youtube.com/watch?v=c5m2f4bGtDg

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

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

Автор PeterNaut, 9 лет назад, По-английски

Do strings in c++ always end with null? If I have a string str = "hey";, will str[3] always be null? I only care about the index following the last character of the string, that is, I don't care what the value for str[4] is. :P

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

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

Автор PeterNaut, 10 лет назад, По-английски

You want to send a message that contains 12 distinct signals and 45 spaces. You want that for any pair of signals in the message, there should be at least 3 spaces between them. How many different messages can you send?

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

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

Автор PeterNaut, 10 лет назад, По-английски

Is there even a date yet? Thanks!

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

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

Автор PeterNaut, 10 лет назад, По-английски

Is Marrakesh, Morocco a nice place to visit? Will it be a great ICPC?

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

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

Автор PeterNaut, 10 лет назад, По-английски

In order to swap two arrays in O(1) you can do this using pointers:

#include <algorithm>
int AA[100], *A=AA, BB[100], *B=BB;
swap(A, B);

But how can you do that for matrixes in C++?

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

Теги c++
  • Проголосовать: нравится
  • -18
  • Проголосовать: не нравится

Автор PeterNaut, 10 лет назад, По-английски

Which task needs a straight forward interval tree for its solution? With interval tree I mean the data structure that stores a set of lines and has queries asking which lines touch a certain point x? With no neccesity for updates.

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

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

Автор PeterNaut, 10 лет назад, По-английски

Is it wise and feasible to implement an interval tree in a Codeforces round (two hours long)? What about in a 5 hour long contest (ioi)?

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

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

Автор PeterNaut, 10 лет назад, По-английски

In a weighted tree, how to find for every node the distance to its farthest node (in linear time)?

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

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

Автор PeterNaut, 11 лет назад, По-английски

Which programming problems have you enjoyed the most solving or you like its solution best, etc.?

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

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

Автор PeterNaut, 11 лет назад, По-английски

I got two questions:

1) What's the point on clicking the option to make a contest or a problem 'favourite' if you can't see a list of favorites problems/contests?

2) Why do it says 'favourite' instead of 'favorite'? Is it an error or is it something else?

Just wondering :P

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

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

Автор PeterNaut, 11 лет назад, По-английски

Hello, I've been waiting for the editorial for this contest and specifically for that problem. Can somebody please tell me the solution? Thx

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

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

Автор PeterNaut, 11 лет назад, По-английски

A happy world in which after each Codeforces contest, editorials are immediately published for all problems in both Russian and English. :)

It's hard to think of a better improvement than that one.

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

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