牛客440904392号
牛客440904392号
全部文章
分类
归档
标签
去牛客网
登录
/
注册
牛客440904392号的博客
全部文章
(共146篇)
题解 | #中位数#直接调用库函数
from statistics import median while True: try: print(int(median([int(input()) for _ in range(int(input()))]))) except: break
2024-10-01
3
101
题解 | #字符串的反码#用25减去ASCII码就行
s = input() for c in s: if c.isalpha(): if c.isupper(): print(chr(ord("A") + 25 - (ord(c) - ord("A"))), en...
2024-10-01
1
87
题解 | #数组逆置#直接调用库函数
//C++版代码 #include <iostream> #include <algorithm> using namespace std; int main() { string s; cin >> s; reverse(s.begin(...
2024-10-01
1
75
题解 | #百万富翁问题#写个for循环就行
public class Main { public static void main(String[] args) { int wealthy = 0, stranger = 0; for (int i = 0; i < 30; i++) { ...
2024-10-01
1
163
压根不用拼接,直接输出就行。
//C语言版代码 #include <stdio.h> int main() { char s[100], t[100]; while (scanf("%s%s", s, t) != EOF) { printf("%s%s\n...
2024-09-30
1
114
题解 | #最大公约数#直接调用库函数
//C++版代码 #include <iostream> #include <numeric> using namespace std; int main() { int a, b; cin >> a >> b; cout &l...
2024-09-30
1
94
题解 | #找x#
n = input() nums = input().split() target = input() for i in range(len(nums)): if target == nums[i]: print(i) break else: prin...
2024-09-30
1
86
只要依次输出横坐标和纵坐标的最小值以及最大值就行
numsX, numsY = [], [] while True: try: x, y = map(int, input().split()) if x == 0 and y == 0: print(min(numsX), min(nu...
2024-09-30
1
95
题解 | #还是畅通工程#Kruskal模板题,记住就行。
import java.util.*; public class Main { private static class Edge { private final int from, to, val; private Edge(int from, int to...
2024-09-30
1
106
题解 | #统计同成绩学生人数#写个for循环判断一下就行
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); w...
2024-09-30
1
107
首页
上一页
6
7
8
9
10
11
12
13
14
15
下一页
末页