Shortest mode is just one mode out of three.
C++ is indeed unfavoured for this mode but typically it’s 2x longer, not 10x.
- remove everything in the stub,
- just include ios or map, it’s usually enough,
- declare all your integers at once, globally, it assumes int if type is not provided,
- don’t submit as fast as possible, take your time to golf it as much as you can,
- remove all spaces you can within your code lines,
- once your code is ready, select all and spam shift tab to remove indents and then remove all newlines ; it’s better to do that in the very end.
You can find more tricks online, on codegolf stack exchange for example.
Your code should get significantly shorter but still you’ll lose most of the time against Python, JS, Perl, Ruby, etc.
If you’re still frustrated about being beaten in shortest, maybe take it as an opportunity to learn a ‘short syntax’ language.
As you mentionned, C++ is not very good for text manipulation, and it can be usefull to know a scripting language that allows you to easily browse and modify text files on your system for example.
Also, new language learned means more source code you can read and understand, more libraries you have access to, more people you can communicate with, etc.