Блог пользователя SPyofgame

Автор SPyofgame, история, 5 лет назад, По-английски

I recently found the opperator co_await and co_yield in C++. How should I apply this into the code and should I use these operator in competitive programming ?

Sorry for my bad English and knowledge.

If I am wrong about something please guide me.

Thanks for reading <3

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

I'm not too familiar with C++, but perhaps you can use it to build lazy sequences: https://medium.com/@buckaroo.pm/introducing-conduit-lazy-sequences-using-the-coroutine-ts-b7e87dd85fcf

Other than that, I doubt you'd see much use for concurrency in CP. Maybe it could be occasionally used to send an "interrupt" when you're getting close to the time limit for certain randomized or approximation algorithms (e.g. 364D - Ghd), but such problems are rare.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

https://en.cppreference.com/w/cpp/language/coroutines From this site you can be something about it... Sir