牛客440904392号
牛客440904392号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客440904392号的博客
全部文章
(共258篇)
题解 | 求HSL的值
r, g, b = map(int, input().split()) # 归一化RGB值 r_norm = r / 255.0 g_norm = g / 255.0 b_norm = b / 255.0 # 找最大值、最小值和差值 max_val = max(r_norm, g_norm, b...
2026-01-11
0
31
题解 | 判断手机号
s = input() print("yes" if s[0] == "1" and (s[1] == "3" or s[1] == "5" or s[1] == "8") else "no...
2026-01-11
0
29
题解 | 计算树的大小
set = set() while True: s = input() if s == '0': break set.update(s.split()) print(len(set))
2026-01-11
0
29
题解 | 计算表达式
import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.util.Stack; public class Main { public static void main(Str...
2026-01-11
0
28
题解 | 计算表达式
while True: try: print(int(eval(input()))) except: break
2026-01-11
0
25
题解 | 公约数
#include<stdio.h> int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } int main() { int t; scanf("%d", &t); ...
2026-01-11
0
31
题解 | 公约数
from math import gcd for _ in range(int(input())): a, b = map(int, input().split()) print(gcd(a, b))
2026-01-11
0
29
题解 | 单词统计
print(len(input().split()))
2026-01-11
0
27
题解 | 2024_矩阵连乘_2927
def matrix_chain_multiplication(p): n = len(p) - 1 # 矩阵的数量 # dp[i][j] 表示第i个矩阵到第j个矩阵相乘的最小代价 # 其中矩阵i的维度是 p[i-1] x p[i] dp = [[float(&q...
2026-01-11
0
26
题解 | 2024_字符大小写交替_1133
c = input() if c.isupper(): n = ord(c) - 65 else: n = ord(c) - 97 ans = [] for i in range(n + 1): if i % 2 == 0: ans.append(chr(6...
2026-01-11
0
33
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页