ENG  RUSTimus Online Judge
Online Judge
Задачи
Авторы
Соревнования
О системе
Часто задаваемые вопросы
Новости сайта
Форум
Ссылки
Архив задач
Отправить на проверку
Состояние проверки
Руководство
Регистрация
Исправить данные
Рейтинг авторов
Текущее соревнование
Расписание
Прошедшие соревнования
Правила
вернуться в форум

Обсуждение задачи 1857. Алиса и Брандашмыг

What is T3, Im only WA3
Послано xurshid_n 18 окт 2011 16:19
my idea:

 sum( (-1)^m *  a^(n/(p[k1]*p[k2]*..*p[km] ) ) ), where p[i] - is prime number and n % p[i] == 0.
Re: What is T3, Im only WA3
Послано svr 12 фев 2018 10:16
also WA(4) why?
1. Q[k]-number for which k- minimal period
2 Q[k]=a^k-sum(Q[i],i<k k%i==0)
3. answer =Q[n]/n

AC has. Big numbers rules from Test4.
Learhed Python and taken Ac quickly
Much more comfortable than java


Edited by author 12.02.2018 11:13
Re: What is T3, Im only WA3
Послано Orient 12 фев 2018 11:31
There are __int128 and libquadmath with __float128 in GCC/clang. I sure there are problems, where these are sufficient to get AC. What do you think?
Re: What is T3, Im only WA3
Послано LLI_E_P_JI_O_K 30 дек 2023 14:02
[svr] solution (double for by K and I) with optimized long arithmetic by 10^9 base (9 digits packed in one int) in C++ can pass only by compiler choosing (got TLE 49 on Visual Studio and only g++ got AC), but solution uses 0.375 time and 63 Mb of memory - i.e. it is almost NOT a solution :))

So I can't imagine how to pass this on Python, which MUST be too slower than C++.

Edited by author 30.12.2023 14:03