did codeforces just remove c++11 from the compile languages
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
Name |
---|
Yes. We cannot submit codes in C++11. We could only submit C++14 or higher versions of C++.
Topcoder disagree
inb4 usaco removes c++11
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 :(
Sad, Codeforces has removed C++11 but CCF still only let us use C++98 :(
(In 2077.)
CCF: We can use C++14!!!
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.
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
98 > 11
But now, CCF let us use C++14.
deleted
Me who revised 4 times to see what the comment is
Good.
I hope they add C++20 with GCC 11.2. 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.
Concepts, templated lambdas,
std::ranges
,std::span
, andstd::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
andstd::set
, you will be able to check if an element exists using something likeif (a.contains(element))
, which would be better than the much more dangerousif (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.My use-case was making an optionally lazy sparse persistent segment tree, and I was aiming to have the least memory usage possible, but to my dismay empty structs inside structs had a size of 1 byte, which when combined with padding gives an effective extra size of 8 bytes, and I had to do code duplication with some constexpr tricks for reducing memory usage.
Also everything in the
<bit>
header, no more ugly intrinsics.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?
I would say C++17, it's a bit premature to upgrade to 20
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.
I am glad to use C++20 with GCC 11.2 here.