oursaco's blog

By oursaco, history, 5 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?
»
5 years ago, hide # |
 
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++.

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

Topcoder disagree

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

inb4 usaco removes c++11

»
5 years ago, hide # |
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 :(

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

deleted

»
5 years ago, hide # |
 
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.

  • »
    »
    5 years ago, hide # ^ |
     
    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.

    • »
      »
      »
      5 years ago, hide # ^ |
      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
»
5 years ago, hide # |
 
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?

»
5 years ago, hide # |
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.

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

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