PhatDapChai's blog

By PhatDapChai, history, 6 weeks ago, In English

Link: https://codeforces.com/problemset/problem/46/F

Anyone who solved this problem before please help me. I don't sure I understood the problem's statement so I can't recap its statement, sorry about this.

I don't know how test case 6 has the answer "NO".

Test case 6's input:

3 3 3
1 2
2 3
3 1
a 1 1 1
b 2 1 3
c 3 1 2
b 1 1 2
c 2 1 3
a 3 1 1

Illustration of initial state:

Illustration of input graph

The black-ink art is the graph and the red number on each edge is its index. The green-ink art is the information of the person: the green string is the name of that person and the small green numbers near it is that person's keys. In the initial state of this test case: person 'a' was at node number 1 and had the only key to open the 1-index edge; person 'b' was at node number 2 and had the only key to open the 3-index edge; person 'c' was at node number 3 and had the only key to open the 2-index edge.

I think the process will happen as follow:

  • First, 'a' use his key to open edge 1-2.

  • Next, since edge 1-2 was open, 'b' go to node number 1 and use his key to open edge 3-1.

  • Finally, 'c' can go to node number 1 and swap his key with 'b'. After this 'b' has the key 2 and 'c' has the key 3. Then, 'c' go to node number 2 and a go to node number 3 to reach the expected state.

That's what I thought and I think the answer for this test case is "YES", but jury's answer is "NO". I don't know where I gone wrong. Please help correcting me!

And here is my submission: https://codeforces.com/contest/46/submission/193789491

Full text and comments »

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

By PhatDapChai, history, 7 months ago, In English

This is an important milestone for me. I, therefore, decided to mark this day. I was really happy to have my color changed.

By the way, I did a challenge with Aladdin_drink_H2O. If I reach specialist before he reach pupil, I will win. Who loses this challenge will have to solve 13 arbitrary-difficulty problems. So, you should do it soon, Aladdin_drink_H2O.

Full text and comments »

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

By PhatDapChai, history, 7 months ago, In English

I would like to ask about a problem which is not on Codeforces but on AtCoder platform (sorry about this inconvenient). The problem is AtCoder Beginner Contest — E — Wrap.

In the problem's tutorial, it said that the time complexity is $$$O(n^3)$$$ but I don't know why. I think this complexity might come up to the number of $$$3^{300}$$$. I would like to ask why the programme can execute with the complexity $$$O(n^3)$$$? Please help, I really appreciate all the responses.

Full text and comments »

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

By PhatDapChai, history, 7 months ago, In English

Hi everyone, I want to ask when I got a wrong answer, can I see what is the difference between my output and answer. In small testcase, I can see the total input, output data and answer, but, in large one, I can only see partially and the three dots "...". Is it possible for me to see the full input and answer?

UPDATE: I have my own answer now that is it is impossible to see it on Codeforces. Thanks for your replies <3!

Full text and comments »

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

By PhatDapChai, history, 9 months ago, In English

Please help me with this CRYPTO1 problem. I have no idea where to start thinking. Can you give me some hints? That problem could be summarized as follow: Given the value of $$$x^2$$$ $$$\%$$$ $$$4000000007$$$. Find the value of $$$x$$$.

Full text and comments »

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

By PhatDapChai, 14 months ago, In English

Hi everyone!

I want to ask what was happened when I assign (1<<32) to a long long var and int64_t var in C++ and print it out. Why is the output is 0? Thank you... This is what I tried to do and its output:

My code:

#include<bits/stdc++.h>
using namespace std;
long long A = (1<<32);
int64_t B = (1<<32);
long long const C = (1<<32);
int64_t const D = (1<<32);
main()
{
    cout << A << endl
    << B << endl
    << C << endl
    << D;
}

And, its output:

0
0
0
0
=====
Used: 0 ms, 0 KB

Full text and comments »

  • Vote: I like it
  • -18
  • Vote: I do not like it