杨舜文
杨舜文
全部文章
分类
题解(113)
归档
标签
去牛客网
登录
/
注册
杨舜文的博客
全部文章
(共98篇)
题解 | #迷宫问题#
import sys arr = [] points = [] row, column = [int(x) for x in sys.stdin.readline() if x.strip()] def dfs(arr, x, y): if x == row - 1 and y == ...
Python3
2022-03-26
0
221
题解 | #火车进站#
import sys import copy num = int(sys.stdin.readline()) line = sys.stdin.readline() stack = line.split() input_li = [] output_li = [] ret_li = [] d...
Python3
2022-03-19
0
252
题解 | #放苹果#
def f(m, n): if m < 0 or n < 0: return 0 if m == 1 or n == 1: return 1 return f(m, n-1) + f(m-n, n) while True: ...
Python3
2021-11-27
0
268
题解 | #矩阵乘法#
import sys while True: try: x, y, z = int(input()), int(input()), int(input()) arr1 = [] arr2 = [] ret = [[0 for ...
Python3
2021-11-27
0
288
题解 | #完全数计算#
def is_perfect_number(n): li = [] for i in range(1, n//2 + 1): if n % i == 0: li.append(i) return sum(li) == n while ...
Python3
2021-11-14
0
235
题解 | #统计每个月兔子的总数#
import sys def fab(n): if n == 1 or n == 2: return 1 return fab(n-1) + fab(n-2) for line in sys.stdin: print(fab(int(line)))
2021-09-02
0
234
题解 | #走方格的方案数#
import sys def f(n, m): if n <= 0 or m <= 0: return 1 return f(n, m-1) + f(n-1, m) for line in sys.stdin.readlines(): n, m...
2021-08-31
0
281
题解 | #二维数组操作#
while True: try: m, n = (int(x) for x in input().split()) x0, y0, x1, y1 = (int(x) for x in input().split()) x = int(input...
2021-08-31
0
495
题解 | #计算日期到天数转换#
import sys months = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def is_leap_year(year): return year % 400 == 0 or (year % 100 != 0 and year ...
2021-08-31
2
421
题解 | #杨辉三角的变形#
import sys for line in sys.stdin: line = int(line) if line <= 2: print(-1) continue n = line % 4 if n == 0: ...
2021-08-31
0
287
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页