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

Автор gamegame, история, 4 года назад, По-английски

There has been less and less data structure problems in 2020. I think that it is inevitable because interesting data structure problems are hard to create. Still, I feel very sad about this. Let's share interesting data structure problems that you enjoyed in 2020!

For me, I especially love GP of Tokyo A, GP of Tokyo L and GP of Moscow D

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

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

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

I found the problems very cool! However, nobody is talking about it, so I decided to make a blog.

Tasks: https://boi2019.epy.gr/?p=747

Also, can someone post the scoreboard? I used to have a link http://147.102.38.13:8123/Ranking.html but the site died already...

How to do Roadtrip? It feels like doing a weird bfs storing a number of best paths in some form for each node, something like JOI Spring Camp 2017 Wild Boar

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

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

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

https://codeforces.net/contest/1185/submission/55779719

I'm getting ILE and i don't know why.

My code doesn't work on this test.

I tested it a lot of times and it works

LGMs and reds pls help :))

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

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

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

Problem source (Traditional Chinese): https://tioj.ck.tp.edu.tw/problems/2073

Basically, the problem asks to write a program to check whether the T<=5000 numbers (<=1e9) are prime. Moreover, your program must be in C++ and fits the following format:

#include <cstdio>

bool IsPrime(int n) {
  int r=1___f_____r__f___f____n___=0__%__f);
  return_____4_n__;
}

int main() {
  int x;
  while (~scanf("%d", &x)) printf("%d\n", (int)IsPrime(x));
}

You can edit each '_' with any character with ASCII code between 32 to 126.

I have tried to solve this problem for a long time and couldn't solve it. I have created a "solution", but it only works without -O2 optimization. Link: https://pastebin.com/K9sCXXn2

I desperately wanted to know the solution to this problem. Can somebody drop hints or solutions to this problem? Thanks!

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

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

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

I have seen a problem about bipartite matching on a special weighted graph and i would like to know the solution. The graph is similar to 875F - Royal Questions where nodes in one sides have at most 2 neighbours and the weight of these two edges are the same. However, each edge has 2 weights Ai and Bi, and the total weight is (sum of A)*(sum of B). The task is to find a maximum matching with highest total weight. N<=10000 and A,B<=30 where N is the number of nodes. Could someone give hints/solutions about this problem? Million thanks!

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

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

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

I recently participated on Codeforces Round 402 (Div. 1) and my code to problem A passed pretests with this.

http://codeforces.net/contest/778/submission/25032443

On line 31 there is this

"mid=(left+right)+1/2;"

My whole binary search is wrong but it still passed pretests

Should the pretest be set such that at least codes with this kind of mistakes shouldn't pass the pretests?

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

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