AlexArdelean's blog

By AlexArdelean, history, 5 weeks ago, In English

In the vibrant world of rhythm and beats, where music pulses through every player's veins, there existed a young enthusiast named Alexandru Ardelean. His love for music led him to Ohio State University's rhythm gaming community, where he immersed himself in the electrifying atmosphere of competitive gameplay.

One fateful evening, amidst the flashing lights and thumping bass of an intense match, Alexandru found himself facing a formidable opponent: a skilled player known as Lily. As their fingers danced across the buttons, a fierce yet friendly rivalry ignited between them, each determined to claim victory.

With each match, Alexandru and Lily's admiration for each other's skills grew, and they soon found themselves spending more time together outside of the game, bonding over their shared passion for music and gaming. Late nights turned into early mornings as they challenged each other to matches, traded tips and tricks, and shared stories of their favorite songs and artists.

As their connection deepened, Alexandru realized that his feelings for Lily went beyond just friendship. With butterflies in his stomach and a pounding heart, he mustered the courage to invite her to a real-life meetup at a local café near the university.

Nervously sipping their drinks, Alexandru and Lily laughed and chatted as if they had known each other for years. It was in that cozy café, surrounded by the warmth of their budding romance, that Alexandru knew he had found someone truly special.

Their love story continued to flourish, with music serving as the soundtrack to their journey. From impromptu jam sessions in Alexandru's dorm room to heartfelt conversations under the stars, Alexandru and Lily's bond only grew stronger with each passing day.

And so, in the midst of Ohio State University's vibrant music gaming community, Alexandru found not only a fierce competitor but also the love of his life. Together, they continued to conquer challenges, set new high scores, and dance to the rhythm of their own love story.

Full text and comments »

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

By AlexArdelean, history, 3 years ago, In English

Hello! I have encountered a problem that boils down to finding maximum matching on a graph that unfortunately is not bipartite. Fortunately though, I observed that the complementary graph is! Is it possible to find maximum matching in polytime on such a graph? I can unfortunately not link the problem.

Full text and comments »

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

By AlexArdelean, 3 years ago, In English

After numerous participations in national and international programming competitions(well, not that many international because I don't qualify), I have come to a conclusion. I am stupid. But now, for a change, instead of trying to get better I have decided to try and cope with it. I am simply a mistake. My mom might be gay, my sister may be a mister, and I really am just stupid. I hope this inspired all of you in some way! Maybe there are other people out there who should just accept that they are stupid

Full text and comments »

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

By AlexArdelean, history, 4 years ago, In English

I am interested in the date of the competition.

Full text and comments »

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

By AlexArdelean, history, 4 years ago, In English

So not quite recently I have learned that the number of distinct subtrees of a tree is O(N) (3 * N — 2 to be precise because a subtree can be determined either by simply a vertex being set as the root of the tree and the entire tree is a subtree or by a node and a father, mainly an edge determines two subtrees (I know this is not a very good explanation but I don't know how to make a drawing of it and upload it here and I am too lazy to learn)).

Using this knowledge you can solve a lot of problems in which your solution would have to calculate some kind of Dp by setting each node as the root of the tree.

I didn't really implement a lot of problems using this but for those few that I actually coded I used the following default code(code is in c++ since it is the only language I know and will probably only know for quite some time):

vector < int > dp[N]///I would set the size of dp[node] as the size of adj[node] + 1 and also set them to a constant NOT_VIZ
vector < pair < int, int > > adj[N]///<neighbor, the position in which our node is in our neighbor's adj>

int compute(int node, int ind_father) {///call this function with ind_father = adj[node].size() if you want node = root
    if (dp[node][ind_father] != NOT_VIZ)
        return dp[node][ind_father];
    dp[node][ind_father] = 0;///idk.. do smth such that it will surely not remain NOT_VIZ or hurt anything else
    for (int i = 0; i < adj[node].size(); ++i) {
        if (i == ind_father)
            continue;
        ///do your thing with compute(adj[node][i].first, adj[node][i].second), even put results in a vector if you need
    }
    return dp[node][ind_father];
}

A good example is the problem "Ludo" form this year's IATI.

In this problem, two players play a game with a pawn. The pawn is moved across edges and the pawn can't pass through a node in which it has already been. It's explained that once you pass through a node the node is marked and once it is marked you will not be able to pass through that node in the remainder of the game. The players move the pawn alternatively and the player who can't move loses. You are asked for a given graph what are the nodes in which if you start you have a winning strategy no matter what the opponent plays.

Let's, for example, solve the problem for a fixed root. For a fixed root you can simply define dp[node] = "if the pawn arrived in the subtree of the node node can you, as the player who got it there, win the game?".

The recurrence is simple since if you arrive in a subtree you will never be able to get up and out of it dp[node] = 1 if for every child of node dp[child] = 0(if any one of them has the property dp[child] = 1 then the second one to move can simply go in the subtree of child and by the definition of dp, win!).

The only problem is that the root is not fixed so we can simply use the default code and solve the problem.

Now the downside I have encountered to this is that I constantly get TLE(for that problem I had to use all sorts of stuff like pragmas, fast IO and having N = 2e5 to manage to squeeze the solution in the TL for the first 4 subtasks) but the official solution easily fits in the TL from what I know.

Most of the problems I solved using this technique can be solved by having more complicated dp or using the change-root techique and those solutions are much faster. I am asking you if you know something I can do to make this faster all together.

(I can add more example problems if y'all want but don't have the time now)

Thank you for the attention :)

Full text and comments »

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

By AlexArdelean, history, 5 years ago, In English

For three weeks from now i have access to a computer on which i can navigate the internet but can't download anything(like codeblocks) so I am asking you, what is the best site in your opinion to code on

Btw i only care about c++

Full text and comments »

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

By AlexArdelean, history, 6 years ago, In English

hello ,

i know i didn't totally listen to the editorial but i don't understand why my implementation could be wrong and why i get WA at test 9 on problem E of contest 896.

My implementation is 33780827.

i thought about keeping the square in which my element 1 and element 2 are and i am keeping it using a global variable k which i use to mark the square in which my element is. i am introducing new squares by increasing k and increasing by it, removing a square with a matrix whatwasthere and decreasing by the value of whatwasthere[line][column] of the first element of the query , and display yes if the square in which the first element is equals to the square in which the second element of the query is

Full text and comments »

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

By AlexArdelean, history, 6 years ago, In English

i started simulating round 445 8 minutes after i registered , but then when i submitted my solution to problem A i was sent to a bad gateway 504 time-out (servers in maintenance or something). after that it all froze, and i left the simulation but i want to know why did this happen to me

504 Gateway Time-out

nginx/1.12.1

Full text and comments »

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