We will hold AtCoder Beginner Contest 376.
- Contest URL: https://atcoder.jp/contests/abc376
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20241019T2100&p1=248
- Duration: 100 minutes
- Writer: yuto1115, Nyaan, evima
- Tester: sotanishy, toam
- Rated range: ~ 1999
- The point values: 150-250-350-400-475-550-650
We are looking forward to your participation!
my first
The first three questions this time...
This type of scoring problem usually tests coding ability
Actually very disgusting
Today is another fierce battle
Problem G scores 650. It sounds a lot harder. Anyway,
I was study in Daymayuan OJ.Small wowo is my teacher.I was L3.
It seems that this time the question is easier than last time. Good luck!
contest ended.
You're right, this is the first time I've achieved a ranking within 4000.
Wishing everyone a better ranking in the next ABC.
You are right.
this is the first time that I 've achieved a ranking within 4000 and aced 4 questions (ABCD)
I extend my best wishes that everyone get a better rank in the next ABC.
$$$\Huge\text{ABC376 RP++!}$$$
How can you do that?
Good Luck & Have Fun!
only ONE NOOOO!!!!!
Somebody is cheating by discussing the solutions
What's wrong with my code for D ???
Perhaps you may find a cycle that doesn't include the root. Like, 1 -> 2 -> 3 -> 4 -> 2.
Thank you very much
F is a nice problem, thanks.
Can anyone explain why greedy doesn't work for problem C?
you are just missing an edge case:
n = 4 toys = 1 2 3 4 boxes = 2 3 4
you should add this at the end of the code to handle this case:
if(i==0) ans = toys[0]
also whenever posting code in comments, try to wrap it in a code spoiler
Thanks man! Really appreciate the help
G is the answer of https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=247&page=show_problem&problem=3646 divides $$$\sum_{i}a_i$$$.
WHAT are you doing,Mr.Atcoder?
How can you find that problem? You might have done over 10,000 problems.
Actually this message is from my friend Stanley_Shao
Actually this message is from another friend of mine
Hii,
Did anyone tried to solve D with dfs for cycle detection in directed graph?I tried but it is failing for half of the test cases.I know it is not efficient solution but just wanted to find the case where it can fail
Link to my submission
Thanks
Let's say the graph contains two cycles. First 1->2->4->1 and Second 1->2->3->4->1. Since you are performing dfs it may be possible that you explore the second cycle first and thus all of 1,2,3 and 4 will be marked visited. Now you can no longer explore the first cycle as while trying to branch to node 4 from node 2, you will find that node 4 has already been visited. In all such scenarios you will not get the cycle with minimum edges.
Yeah, that was the point I was missing. Thanks
How to solve D if the graph was undirected?
Currently I just have $$$O(n^2logn)$$$ solution. I will post again if I got better solution.
Let $$$S$$$ be the set of nodes which are directly connected to $$$1$$$ and remove all the direct edges between $$$1$$$ and $$$s$$$ where s belongs to $$$S$$$. After that our task is to find the value of $$$min(dis(i,j))+2$$$, where $$$i,j$$$ belongs to set $$$S$$$ and $$$dis(i,j)$$$ means distance between nodes $$$i$$$ and $$$j$$$. which can be done in $$$O(n^2logn)$$$.
Could someone explain why my code could not pass problem C or give me a test case?
the nesting level for the last break is incorrect, try -
Thanks for your big help!!
It would be nice to have a separate leaderboard for rated/unrated participants similar to what Codeforces has with a checkbox "show unofficial".
snuke Do you know if a single leaderboard is intentional or there're plans to implement something similar to what I've described?
Well, in fact there is a
Show rated only
button inCustomize
.Indeed, thank you for pointing this out!
Anyway, the button Customize is hidden enough that it either requires prior knowledge or pure luck to find it :)
In problem D. How could more than a cycle contain the same vertex if the vertices each have a single outgoing edge? At least that's what I interpreted by the problem statement
There's no condition in the statement that the outgoing edge has to be single. It just says: "There is a simple directed graph with N vertices numbered from 1 to N and M edges. The i-th edge (1≤i≤M) is a directed edge from vertex a_i to vertex b_i".
FWIW, this blog which conveniently was in "Recent actions" just before the start of the Atcoder round helped me to solve this problem — although final solution requires a small modification to the original graph.
Yeah I interpreted it wrong. Honestly this contest was easier than most ABCs, right? Like during contest I got A and B right (attempted C but it got runtime error on some tests down the line), but I was able to understand and implement all but the last 2 problems. For example that graph question was just a direct application of BFS, which is pretty weird for a D problem in ABC tbh
Why is this the initialization of the dp in problem F?
This assumes that the other hand is at position 1, but it could be at 0, shouldn't it depend on the first query?