py算法基础
常用输入第一行输入数字个数n,第二行输入n个数字
n = int(input()) # 第一行:数字个数 arr = list(map(int, input().split())) # 第二行:n个数字输入三个数字
a, b, c = map(int, input().split()) # 一行3个数字二维数组
n, m = map(int, input().split()) # n行m列 matrix = [] for _ in range(n): row = list(map(int, input().split())) matrix.append(row)情况4:字符串数组
words = input().split() # 不需要int转换 # 或 chars = list(input()) # 每个字符分开lambda简单小函数
import sys # 核心:重定义input,加速读取 input = sys.stdin.readline def main(): # 读取单个整数 n = int(input()) # 读取一行整数 arr = list(map(int, input().split())) # 读取两个整数 a, b = map(int, input().split()) # 读取字符串(注意去换行符) s = input().strip() # 多行读取 for _ in range(n): x, y = map(int, input().split()) # 处理逻辑 print(result) if __name__ == "__main__": main()