We will hold JPRS Programming Contest 2026#1 (AtCoder Beginner Contest 442).
- Contest URL: https://atcoder.jp/contests/abc442
- Start Time: http://www.timeanddate.com/worldclock/fixedtime.html?iso=20260124T2100&p1=248
- Duration: 100 minutes
- Writer: cn449, yuto1115, ynymxiaolongbao, chokudai
- Tester: kyopro_friends, sheyasutaka
- Rated range: ~ 1999
- The point values: 100-200-300-400-450-500-600
We are looking forward to your participation!








Hope for great problems and short problem statement like the post!
Hope I can solve E,just like the last contest.
were you able to? I was soo close to solving it
No, but still I solved A~D in 7 minutes.
Hope for a good contest!
while(1) luck++,AC++,WA--;
btw atcoder > codeforces??
Is atcoder.jp down? It shows 403 error
RP++
The ABCD Are very easy I Aced them in 30minutes,But EFG………………I don't want to say anymore
I didn't read G,but I think EF are quite easy
oooooooooooooooaaaaaaaaaaaaaaaaa
WA ON E's 32&33!!!!!!!!!!!!!!!!!!!!!!!!!!!
fk
Same :(, using slopes must have caused floating point error
Ha. That's why I was WA at that time.
Always use long double instead of double
But why I use long double still WA
https://atcoder.jp/contests/abc442/submissions/72729565
fk
use
atan2l()instead ofatan2()ok
Could you please show me your code? Thx.
My approach to E using long double got WA on the last test :(
don't use
doublesorlong doubles.use
pair<int, int>to represent fractions, and reduce when needed. reduction is done by dividing numerator and denominator by theirgcd.needless to say this only makes sense when dealing with rational numbers only.
This helped me to finally get that code accepted, thanks a lot!
Another abc421 lol.
G was too easy for a G.
Did anyone had problems in E when sorting by atan2?
I switched to atan2l and it seemed to start working, but i am not sure, as i also did some +-1 with prefix sums. But the plain atan2 submission failed only 2 tests...
Yep, exactly the same
i got accepted submission using atan but it cost me 7 wrong submission :(,I feel you must be using double instead of long double,but if this is the case i am curious about how atan2I works with double,anyone knows the reason?
Good idea to avoid floats unless absolutely necessary. For sorting rays from $$$(0,0)$$$ to $$$(x,y)$$$, you can group them by $$$(x/g,y/g)$$$ where $$$g=gcd(|x|,|y|)$$$.
you still have to sort after grouping. you can do some polar magic, but i was not sure and it seemed like 1e9 is not that bad for atan2 precision
The difference in angle between two vectors with $$$O(A)$$$ coordinates can be $$$O(1/A^2)$$$ (find two vectors with lengths both $$$O(A)$$$ and having cross product = 1). As a quick estimate, doubles only stores numbers with $$$16$$$ significant decimal digits. So a difference of $$$10^{-18}$$$ can be rounded to the same double and angles could become equal that shouldn't be equal. Also atan2 is not guaranteed to always round the correct way so with some bad luck it could even compare completely the wrong way.
I converted the atan value to degrees and got WA on 32,33 ,changed double to long double and passed.
Submission
E is a rubbish.
a similar problem: Luogu P7133
Well, but you can't expect the problem setters of a Japanese contest, to check for duplicates in Chinese problem banks.
swap(E,F) plz……
F is classic
how to do F?
Let $$$dp_{i,k}$$$ be the answer for row $$$i$$$ where the first $$$k$$$ cells are white.
$$$dp_{i,k} = cost(k) + min_{j=k..n}(dp_{i-1,j})$$$
$$$cost(k) = cnt_{black}[0..k-1] + cnt_{white}[k..n-1]$$$ and can be maintained using a sweep.
The minimum can be maintained using suffix minimum, or range query.
The answer is $$$min_{k=0..n}(dp_{n,k})$$$.
now its looks very easy
E massacred my will to continue with this contest.
I spent an hour debugging problem E just because of floating-point precision issues with atan2, but I mistakenly thought it was a problem with my logic.
I tried to solve G using ternary search, and brute force when $$$r-l\le 300$$$, and it got Accepted, but I wasted too much time on problem E so I didn't AK until the contest ended,sad:(
I think G was easier than E, although I couldn't solve both but while upsolving....
This is My Rating in Atcoder:https://atcoder.jp/users/lzc2015
Who asked you?
I don't understand problem C