简体中文
Telegram

讨论串nimaga bu memory limit olyapti?

2 条消息 · –
#
文件
image_2024-07-15_22-59-00.png · 8 KB · 点击显示
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 ——“公开 Telegram 的 Google”;随着该社群被抓取而更新。 时间为 UTC。

仅限公开内容,使用 Telegram 官方 API。 关于 · 常见问题 · 索引限制 · 移除页面 · 目录 · 搜索 · 计算方法