Русский
Открыть в Telegram

Веткаnimaga bu memory limit olyapti?

2 сообщения · –
#
Файл
image_2024-07-15_22-59-00.png · 8 КБ · нажмите — покажем
nimaga bu memory limit olyapti? #include <iostream> #include <vector> #include <string> #include <bitset> #include <algorithm> std::string binstr(int num) { std::string bin = std::bitset<32>(num).to_string(); const auto pos = bin.find_first_not_of('0'); if (pos != std::string::npos) { return bin.substr(pos); } return "0"; } int foo(int a, int b) { std::vector<std::string> x; std::string y = ""; int d = 0; for (int i = a; i <= b; ++i) { std::string s = binstr(i); x.push_back(s); y += s; int ones = std::count(y.begin(), y.end(), '1'); int zeros = y.size() - ones; if (y.size() % 2 == 0 && ones == zeros) { d += 1; } else { y = ""; } } return d; } int main() { int a, b; std::cin >> a >> b; std::cout << foo(a, b) << std::endl; return 0; } https://robocontest.uz/tasks/1211
  1. #
    this is from gpt

Открытая публичная лента из поискового индекса ChatCrawler — «Google по публичному Telegram»; обновляется по мере обхода площадки. Время — UTC.

Только публичный контент, официальный API Telegram. О проекте · Вопросы · Границы индекса · Убрать страницу из выдачи · Каталог · Поиск · Как мы считаем