叫什么都行呀
叫什么都行呀
全部文章
分类
题解(1)
归档
标签
去牛客网
登录
/
注册
叫什么都行呀的博客
全部文章
(共32篇)
题解 | #数字分类 (20)#
import sys nums=list(map(int,input().split())) result=[0]*5 resultN=[0]*5 a4count=0 flag=1 for i in nums[1:]: if i%5==0 and i%2==0: re...
Python3
2026-01-18
0
16
题解 | 查找组成一个偶数最接近的两个素数
import sys import math n=int(input()) n_div2=n//2 #判断是否是素数 def isprime(n): if n==2: return True else: sqrt_n=int(math.sqrt(n)...
2026-01-11
0
28
题解 | MP3光标位置
import sys count = int(input()) s = input() cursor_pos = 0#记录光标位置 index = 0#记录当前歌曲 for j in s: if j == "U": # 光标在第一首歌曲的情况 ...
2026-01-11
0
29
题解 | 【模板】栈
import java.util.Scanner; import java.util.ArrayList; // 注意类名必须为 Main, 不要有任何 package xxx 信息 public class Main { public static void main(String[] ...
2025-03-24
0
95
题解 | #牛奶供应问题#
using System; using System.Collections.Generic; using System.Linq; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * ...
2024-05-04
0
338
题解 | #寻找第K大#
/** * * @param a int整型一维数组 * @param aLen int a数组长度 * @param n int整型 * @param K int整型 * @return(756076230) int整型 */ int findKth(int* a, int...
2022-12-24
0
313
题解 | #输出二叉树的右视图#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 求二叉树的右视图 * @param xianxu int整型vector 先序遍历 * @param zhong...
2022-11-20
0
317
题解 | #有效括号序列#
class Solution: def isValid(self , s: str) -> bool: # write code here stack=[] for i in range(0,len(s)): c=s...
2022-11-02
0
292
题解 | #包含min函数的栈#
class Solution: stack=[] def push(self, node): # write code here self.stack.append(node) def pop(self): # write co...
2022-11-02
0
335
题解 | #用两个栈实现队列#
class Solution: def __init__(self): self.stack1 = [] self.stack2 = [] def push(self, node): # write code here ...
2022-11-02
0
288
首页
上一页
1
2
3
4
下一页
末页