Español
Abrir en Telegram

Hilo nimaga bu memory limit olyapti?

2 mensajes · –
#
Archivo
image_2024-07-15_22-59-00.png · 8 KB · haz clic para mostrar
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

Un feed público abierto del índice de búsqueda ChatCrawler — el “Google del Telegram público”; se actualiza a medida que se rastrea la comunidad. Las horas se muestran en UTC.

Solo contenido público, API oficial de Telegram. Acerca de · Preguntas frecuentes · Límites del índice · Eliminar una página · Catálogo · Búsqueda · Cómo contamos