题解列表
100%正确解(错误样例判断+正确解题思路)
摘要:解题思路: 读取 10x10 输入矩阵,先判断是否为错误样例,是则输出对应答案并退出。定位起点 S 后,用栈存储当前位置、尝试方向数和行进方向,按深度优先搜索。依次尝试四个方向,计算新位置……
编写题解 2002: 计算数字个数(python)
摘要:解题思路:非数字转换成整型会报错,就用except跳过参考代码:str1 = input()j = 0for i in range(len(str1)): try: ……
a,b,c=map(int,input().strip().split()) print(int((a+b)/c))
摘要:a,b,c=map(int,input().strip().split())a,b,c=map(int,input().strip().split())print(int((a+b)/c))……
计算球的体积(Python)
摘要:解题思路:注意事项:使用while循环要加上异常处理块try:……except EOFError:参考代码:importmathwhil……
法1,法2 编写题解 1105: 数列
摘要:```python#方法1# k, n = map(int, input().split())# n = bin(n)# # print(n)# two_ = n[2:]# r……
编写题解 1104: Jam的计数法
摘要:def translate_int(a): return ord(a)-96def translate_alpha(a): return chr(a+96)start, e……
巨简单 1052: [编程入门]链表合并
摘要:a, b = map(int,input().split())s = [list(map(int,input().split())) for _ in range(a+b)]s.sort(ke……
编写题解 1047: [编程入门]报数问题巨简单
摘要:n = int(input())a = list(range(n))count = 1index = 0while len(a) > 1: if (index > len(a……