牛客440904392号
牛客440904392号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客440904392号的博客
全部文章
(共258篇)
题解 | 计数问题
import sys import math from math import gcd # 计算两个数的最小公倍数 def lcm(a, b): return a * b // gcd(a, b) # 计算一个列表所有数的最小公倍数 def multi_lcm(nums): r...
2026-01-13
0
21
题解 | 基建高手二分查找
n, k = map(int, input().split()) nums = list(map(int, input().split())) left, right = 0, 10000000000 while left <= right: mid = (left + right) ...
2026-01-13
0
17
题解 | 特别的除法
import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { ...
2026-01-13
0
25
题解 | 求三角形的面积向量叉积
for _ in range(int(input())): x1, y1, x2, y2, x3, y3 = map(int, input().split()) print(f"{abs((x3-x1)*(y3-y2)-(y3-y1)*(x3-x2))/2:.2f}&quo...
2026-01-12
0
24
题解 | 句子正序
print(" ".join(reversed(input().split())))
2026-01-12
0
31
题解 | 哈夫曼树
#include<iostream> #include<vector> #include<queue> using namespace std; int main() { int n; while (cin >> n) { ...
2026-01-12
0
30
题解 | 体重排序
persons = [] for _ in range(int(input())): name, weight = input().split() persons.append((float(weight), name)) persons.sort() print(*(person[...
2026-01-12
0
29
题解 | 删除区间
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { ...
2026-01-12
0
25
题解 | 逆序对的数量
#include<iostream> using namespace std; long long ans = 0; void merge(int nums[], int left, int mid, int right) { int i = left, j = mid + ...
2026-01-12
0
26
题解 | 二元素数组
n = int(input()) primes = [] isPrime = [False, False] + [True] * n for i in range(2, n): if isPrime[i]: primes.append(i) for prime in ...
2026-01-12
0
18
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页