16 July 2024
Z J Z J Z J Z J #
Z J Z J Z J
#256py 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:
shuni qayerini ozgartirish kere tl omaslik uchun
yo umuman boshqa algodan foydalanish keremi?
# 4 # # 4 # 4 # 4 # 4 MOD = 10**9 + 7 class Mint: def init(self, value=0): if isinstance(value, Mint): self.value = value.value else: self.value = value % MOD if self.value < 0: self.value += MOD def int(self): return self.value def iadd(self, other): if isinstance(other, Mint): self.value += other.value else: self.value += other if self.value >= MOD: self.value -= MOD return self def isub(self, other): if isinstance(other, Mint): self.value -= other.value else: self.value -= other if self.value < 0: self.value += MOD return self def imul(self, other): if isinstance(other, Mint): self.value = self.value * other.value % MOD else: self.value = self.value * other % MOD return self def itruediv(self, other): if isinstance(other, Mint): self.value = self.value * pow(other.value, MOD - 2, MOD) % MOD else: self.value = self.value * pow(other, MOD - 2, MOD) % MOD return self def add(self, other): res = Mint(self.value) res += other return res def sub(self, other): res = Mint(self.value) res -= other return res def mul(self, other): res = Mint(self.value) res *= other return res def truediv(self, other): res = Mint(self.value) res /= other return res def repr(self): return str(self.value) def get_bin_digits(x): ret = [] while x > 0: ret.append(x % 2) x >>= 1 return ret[::-1] def solve(): import sys input = sys.stdin.read data = input().strip().split() n = int(data[0]) m = int(data[1]) def dp(pos, dif, any, lead, M): if pos == len(M): return Mint(0) if lead else Mint(1) if#
Z
# Z 4 Z 4 Z 4 #include <stdio.h> #include <tgbot/tgbot.h> int main() { TgBot::Bot bot("PLACE YOUR TOKEN HERE"); bot.getEvents().onCommand("start", [&bot](TgBot::Message::Ptr message) { bot.getApi().sendMessage(message->chat->id, "Hi!"); }); bot.getEvents().onAnyMessage([&bot](TgBot::Message::Ptr message) { printf("User wrote %s\n", message->text.c_str()); if (StringTools::startsWith(message->text, "/start")) { return; } bot.getApi().sendMessage(message->chat->id, "Your message is: " + message->text); }); try { printf("Bot username: %s\n", bot.getApi().getMe()->username.c_str()); TgBot::TgLongPoll longPoll(bot); while (true) { printf("Long poll started\n"); longPoll.start(); } } catch (TgBot::TgException& e) { printf("error: %s\n", e.what()); } return 0; }Z 4 4 Z 4
4
M 4 Z M