oursaco's blog

By oursaco, history, 3 years ago, In English

did codeforces just remove c++11 from the compile languages

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

| Write comment?
»
3 years ago, # |
  Vote: I like it +6 Vote: I do not like it

Yes. We cannot submit codes in C++11. We could only submit C++14 or higher versions of C++.

»
3 years ago, # |
  Vote: I like it +88 Vote: I do not like it

Topcoder disagree

»
3 years ago, # |
  Vote: I like it +27 Vote: I do not like it

inb4 usaco removes c++11

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

It's a interesting thing that China Computer Federation don't let competitors use c++11 as well.

They only let us use c++98 :(

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +10 Vote: I do not like it

    Sad, Codeforces has removed C++11 but CCF still only let us use C++98 :(

  • »
    »
    3 years ago, # ^ |
    Rev. 2   Vote: I like it +30 Vote: I do not like it

    Fun fact: In NOI Linux 1.4.1, which is still in use in NOI 2021, the gcc version is 4.8.4, which does not even fully support C++14 features.

    NOI is out of fashion

    Now that the GCC version has been updated to 9.3.0, let's pray that the CCF will allow the use of C++17 in future contests XD

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    98 > 11

  • »
    »
    2 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    But now, CCF let us use C++14.

»
3 years ago, # |
Rev. 4   Vote: I like it -36 Vote: I do not like it

deleted

  • »
    »
    3 years ago, # ^ |
      Vote: I like it +37 Vote: I do not like it

    Me who revised 4 times to see what the comment is

»
3 years ago, # |
  Vote: I like it +50 Vote: I do not like it

Good.

I hope they add C++20 with GCC 11.2. There are many useful features there.

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    There are many useful features there.

    I only know of three-way comparision operator, default == operator and initializer in for-each loop. Kindly let us know if you know anything more that will be useful in CP.

    • »
      »
      »
      3 years ago, # ^ |
      Rev. 2   Vote: I like it +19 Vote: I do not like it

      Concepts, templated lambdas, std::ranges, std::span, and std::format sound like pretty useful features.

      std::midpoint will do away with a lot of midpoint related overflow/underflow issues, which is a good thing too.

      There's also a prefix and suffix comparison on strings, which will reduce the amount of code written for brute force string problems. Also, for containers like std::map and std::set, you will be able to check if an element exists using something like if (a.contains(element)), which would be better than the much more dangerous if (a.count(element)) which blows up to $$$O(frequency)$$$ for multisets.

      For some (warning: very rare) constant-factor optimization, [[likely]] and [[unlikely]] attributes would be a compiler-agnostic feature (no more using GCC's __builtin_expect anymore, so yay). Also as someone told me yesterday, C++20's [[no_unique_address]] can be useful for optimizing away empty structs.

      Use-case
      • »
        »
        »
        »
        3 years ago, # ^ |
          Vote: I like it +8 Vote: I do not like it

        Also everything in the <bit> header, no more ugly intrinsics.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I've been using c++11 just because I already had it installed on my computer. Any recommendations on whether to upgrade to 14, 17, or directly to 20?

  • »
    »
    3 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I would say C++17, it's a bit premature to upgrade to 20

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

HackerRank.com has already included C++20 among its compiler options in the C++ practice problems section. Perhaps it is time for the Codeforces team to consider installing C++20.

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

I am glad to use C++20 with GCC 11.2 here.