Movatterモバイル変換


[0]ホーム

URL:



Codeforces
In EnglishПо-русски
Enter |Register



→ Pay attention
→ Top rated
#UserRating
1tourist3892
2jiangly3797
3orzdevinwang3706
4jqdai08153682
5ksun483588
6ecnerwala3557
7Ormlis3532
8Benq3468
9Radewoosh3463
10Um_nik3450
Countries |Cities |OrganizationsView all →
→ Top contributors
#UserContrib.
1cry165
2-is-this-fft-161
3Qingyu159
4atcoder_official157
5Dominater069154
5adamant154
7djm03178151
7luogu_official151
9errorgorn149
10awoo148
View all →
→ Find user
→ Recent actions
Detailed →

atcoder_official's blog

By atcoder_official,history,25 hours ago,In English

We will hold AtCoder Beginner Contest 400.

We are looking forward to your participation!

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

»
25 hours ago,#|
Rev.2  Vote: I like it0Vote: I do not like it

Hope to become 1Dan in this round.

UPD: FINALLY, I DO IT!

»
14 hours ago,#|
Rev.2  Vote: I like it+12Vote: I do not like it

Hope this contest will not be as shit as the last ABC.

===========================

update: very hard but is a good contest.

»
5 hours ago,#|
 Vote: I like it+9Vote: I do not like it

ABC400 marks a historic point in AtCoder’s journey — 400 beginner contests, week after week! Massive respect to the AtCoder team and all the problem setters who made this possible. Looking forward to celebrating this one properly!

    »
    4 hours ago,#|
     Vote: I like it+6Vote: I do not like it

    Wow!chokudai (高橋君) becomes the writer!

    Congratulations!

      »
      4 hours ago,#|
       Vote: I like it0Vote: I do not like it

      Good luck!

        »
        4 hours ago,#|
         Vote: I like it0Vote: I do not like it

        Good luck.

          »
          4 hours ago,#|
           Vote: I like it0Vote: I do not like it

          Good luck to everyone!

            »
            4 hours ago,#|
             Vote: I like it+9Vote: I do not like it

            ABC 4e2!

              »
              3 hours ago,#|
              Rev.2  Vote: I like it+6Vote: I do not like it

              Congratulation to 400th ABC! Many problem is about number 400, too. lol.

                »
                3 hours ago,#|
                Rev.2  Vote: I like it+2Vote: I do not like it

                jiangly wins!!!

                »
                2 hours ago,#|
                 Vote: I like it0Vote: I do not like it

                ;( prob C was harder than prob D

                  »
                  117 minutes ago,#|
                   Vote: I like it0Vote: I do not like it

                  C was much harder than D

                    »
                    114 minutes ago,#|
                     Vote: I like it0Vote: I do not like it

                    My problem E passed in 163 ms while running the test case 1 in my local device/ide took around 1600 ms. I used Spf based factorization

                      »
                      113 minutes ago,#|
                       Vote: I like it0Vote: I do not like it
                      • »
                        »
                        111 minutes ago,#^|
                         Vote: I like it0Vote: I do not like it

                        I changed it to a Priority Queue implementation and it TLE'd on testcase 2 lol.

                        • »
                          »
                          »
                          42 minutes ago,#^|
                           Vote: I like it0Vote: I do not like it

                          use deque for that, if the edge cost is 0 then you push the new node at the front, otherwise it will be at the back of the deque.

                        »
                        112 minutes ago,#|
                         Vote: I like it0Vote: I do not like it

                        I need c answer ,it is a difficult to make it

                          »
                          112 minutes ago,#|
                           Vote: I like it0Vote: I do not like it

                          Nice problems. Although for me personally C was harder than E. Similar statements, but in E all numbers can be straight up generated, while C requires a little bit of thinking. Enjoyed C, E and F.

                            »
                            111 minutes ago,#|
                             Vote: I like it0Vote: I do not like it

                            approach for E

                            got tle and could not optimise it

                              »
                              109 minutes ago,#|
                              Rev.2  Vote: I like it0Vote: I do not like it

                              Can someone explain to me what is wrong with my solution to problem C:

                              Solution

                              func main() {defer out.Flush()var n int64fmt.Fscan(in, &n)ans := int64(0)for i := int64(2); i <= n; i *= 2 {val := int64(math.Sqrt(float64(n / i)))ans += (val + 1) / 2}fmt.Fprintln(out, ans)}

                              Passed almost all the test except for 4 test cases

                              • »
                                »
                                107 minutes ago,#^|
                                 Vote: I like it0Vote: I do not like it

                                Even I got 4 cases wrong. same code almosthttps://atcoder.jp/contests/abc400/submissions/64549973

                              • »
                                »
                                105 minutes ago,#^|
                                 Vote: I like it0Vote: I do not like it

                                sqrt is not reliable. At least for me, binary search gets AC while sqrt gets WA.

                                • »
                                  »
                                  »
                                  98 minutes ago,#^|
                                   Vote: I like it0Vote: I do not like it

                                  Lesson learnt the hard way :p will always use binary search form now on instead of sqrt

                                • »
                                  »
                                  100 minutes ago,#^|
                                   Vote: I like it0Vote: I do not like it

                                  Same happened with my code, I think it is some floating point issue, when you take square root, and then convert to integer it can sometimes get the value k — 1 instead of k, eg. sqrt = 14.99999999 then val = int64(14.9999999) = 14 instead of expected 15

                                  • »
                                    »
                                    62 minutes ago,#^|
                                    Rev.3  Vote: I like it0Vote: I do not like it

                                    So here is some technical stuffs if you want to know why:

                                    • There is such a thing that is called "the maximum integer that can beprecisely represented" by a floating-point number. For double (8-bit floating-point number), it is 2^53 — 1 (Smaller than 10^18). Some languages (Like JS) call this the "Max safe integer".

                                    • So you wouldneed to switch to using long double (10-bit floating point number on GNU C++), which can represent integersprecisely up to 2^64 — 1.

                                    »
                                    108 minutes ago,#|
                                     Vote: I like it0Vote: I do not like it

                                    Can someone please help me with my C submissionhttps://atcoder.jp/contests/abc400/submissions/64549973

                                    I counted all the perfect squares before N and the biggest power of 2 before N.

                                    And then counted their number of combinations.

                                    • »
                                      »
                                      105 minutes ago,#^|
                                       Vote: I like it0Vote: I do not like it

                                      try using sqrtl

                                      • »
                                        »
                                        »
                                        74 minutes ago,#^|
                                         Vote: I like it0Vote: I do not like it

                                        Cannot believe this was the issue.

                                      • »
                                        »
                                        101 minute(s) ago,#^|
                                         Vote: I like it0Vote: I do not like it

                                        dont use inbuilt sqrt function,rather use binary search to compute it, i also faced WA 3 times for it

                                        https://atcoder.jp/contests/abc400/submissions/64532982

                                      • »
                                        »
                                        58 minutes ago,#^|
                                        Rev.2  Vote: I like it+1Vote: I do not like it

                                        So here is some technical stuffs if you want to know why:

                                        • There is such a thing that is called "the maximum integer that can beprecisely represented" by a floating-point number. For double (8-bit floating-point number), it is 2^53 — 1 (Smaller than 10^18). Some languages (Like JS) call this the "Max safe integer".

                                        • So you wouldneed to switch to using long double (10-bit floating point number on GNU C++), which can represent integersprecisely up to 2^64 — 1. Which is also why using sqrtl works.

                                        But I would still suggest that you use binary search instead for this lol.

                                        • »
                                          »
                                          »
                                          1 minute ago,#^|
                                           Vote: I like it0Vote: I do not like it

                                          I haven't used binary search for that in a long time. Will look

                                        »
                                        91 minute(s) ago,#|
                                         Vote: I like it0Vote: I do not like it

                                        Good F

                                          »
                                          77 minutes ago,#|
                                          Rev.3  Vote: I like it0Vote: I do not like it

                                          O(1) complexity solution for C:

                                          #include <bits/stdc++.h>using namespace std;#define ll long long#define ull unsigned long longvoid solve() {    ll n;    cin >> n;    cout<<(ll)sqrt((long double)n/4) + (ll)sqrt((long double)n/2)<<endl;}int main() {    int t = 1;    //cin >> t;    while (t--)        solve();}
                                          »
                                          72 minutes ago,#|
                                           Vote: I like it0Vote: I do not like it

                                          I solved D with dijkstra. Is it overkill or was that an intended solution?


                                           
                                           
                                          In EnglishIn Russian



                                          Codeforces (c) Copyright 2010-2025 Mike Mirzayanov
                                          The only programming contests Web 2.0 platform
                                          Server time:Apr/05/2025 18:35:24 (i1).
                                          Desktop version, switch tomobile version.
                                          Privacy Policy |Terms and Conditions
                                          Supported by
                                          TON
                                           
                                          ITMO University
                                           
                                           
                                           
                                           
                                          User lists
                                           
                                           
                                          Name

                                          [8]ページ先頭

                                          ©2009-2025 Movatter.jp