Competitive Programming Guide - Math #3 - Factoring #1

preview_player
Показать описание

Factoring by "inverting" - instead of looping over numbers and finding factors, loop over factors and see what numbers they divide. Runs in O(n lg n) instead of O(n sqrt n) you would get with trial division.

Рекомендации по теме
Комментарии
Автор

cool

you code faster than I read ;-)

rastislavsvoboda
Автор

i'm new to competitive programming (just starting out with this year's AoC). where do you learn these stuff from? like the better solution to this program and the thing about MOD-1 in the previous video. does it come with experience? if not can you point me to a good resource?

-krithickumarub
visit shbcf.ru