牛客440904392号
牛客440904392号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客440904392号的博客
全部文章
(共258篇)
题解 | 摸球数学推导
n, m = map(int, input().split()) print('%.3f' % (n / (m + 1)))
2026-01-07
0
16
题解 | 螺旋矩阵用暴力模拟会超内存,要用数学方法直接计算
def get_spiral_value(n, m, row, col): # 计算目标位置在第几圈 layer = min(row, n - 1 - row, col, m - 1 - col) # 计算外层圈的总元素数 outer_elements = 0 ...
2026-01-07
0
21
题解 | 计时相当于60进制减法
#include<stdio.h> int main() { int h1, m1, h2, m2; float s1, s2; scanf("%d:%d:%f%d:%d:%f", &h1, &m1, &s1, &...
2026-01-06
0
33
题解 | 走棋盘用dfs暴力搜索
#include<stdio.h> int visited[8][8], m, n, ans = 0; const int directions[8][2] = {{1, 2}, {2, 1}, {-1, 2}, {-2, 1}, {1, -2},...
2026-01-06
0
54
题解 | 最大正方形周长动态规划求解
#include<stdio.h> int min(int a, int b, int c) { if (a < b) return a < c ? a : c; else return b < c ? b : c; } int main() { ...
2026-01-06
0
27
题解 | 最长的括号匹配用栈记录左括号位置然后依次匹配就行
#include<stdio.h> #include<string.h> int main() { char s[30000]; scanf("%s", &s); int n = strlen(s); int st...
2026-01-06
0
29
题解 | 最小的乘积先排序再分类讨论就行
#include<stdio.h> #include<stdlib.h> #define min(a, b) a<b?a:b int compare(const int *a, const int *b) { return *a - *b; } int main(...
2026-01-06
0
31
题解 | 和最大的结点注意读题,这里的子节点只包括孩子节点,不需要后续遍历求所有节点
#include<stdio.h> int main() { int n; scanf("%d", &n); int nums[n]; for (int i = 0; i < n; i++) scanf("%d...
2026-01-06
0
30
题解 | 错位排列直接暴力模拟
#include<stdio.h> int count = 0; void solve(int used[], int cur, int n) { ...
C
2026-01-06
0
27
题解 | #众数#Python真是太优雅了
from collections import Counter print(sorted(Counter(map(int, input().split())).items(), key=lambda x: (-x[1], x[0]))[0][0])
2024-10-07
1
135
首页
上一页
7
8
9
10
11
12
13
14
15
16
下一页
末页