Your code runs in 0.89 seconds on C++14 and in 1.02 seconds on C++17. This amount of difference is not surprising, and is in no way evidence that C++17 is slower in general. There are definitely many codes which run slightly faster in C++17 than in C++14.
Please consider making an announcement that codechef started supporting c++17. With an exact command line which you use. Whether or not you are using this patch. I didnt knew C++17 exists until I read this post.
E.g.- Mike added this post Codeforces: Welcome, C++17! - Codeforces
It seems I cant submit older problems using C++17. E.g. - I wanted to resubmit SONGIF Problem - CodeChef and few other problems. I’m assuming migration to C++17 is still WIP.
Submissions on INTEST problem says cin/cout of C++17 is ~25% slower than C++14.
On the other hand printf/scanf of C++17 seems ~25% faster than C++14
One more thing I noticed that cin/cout in general on this problem was faster than printf/scanf. Best combination among all was using cin/cout on C++14.
Which kills my plan of using C++17 on Codechef.
Also, I use some pragmas on Codechef and these when submitted using C++17 gives me compilation error. Idk what they do but right now I’m not confident removing them.
I’m planning to use both on near ACs in longs. For subs which a getting TLE due to delta difference.
In general C++17 us supposed to be faster. Idk why its taking more than C++14 on that problem.
I checked your submissions for both c++14 & 17. As of now both are AC. Did you changed the links? Also the c++17 submission is faster in given link. for c++14 - 0.89secs while c++17 - 0.39secs. I am reading this on 2 May like after 3 months past the original post. How does the submission status is changed I dont understand. ;(