io-template.py
ACM Mode
# 数组 — 先读 n,再读 n 个数
n = int(input())
a = list(map(int, input().split()))
print(' '.join(map(str, a)))
# 多组直到 EOF
try:
while True: print(sum(map(int, input().split())))
except EOFError: pass
# 链表 — 1,2,3,null 逗号分隔
vals = input().split(',')
head = cur = None
for v in vals:
if v == 'null': continue
node = ListNode(int(v))
if not head: head = cur = node
else: cur.next = node; cur = node
# 二叉树 — 层序,null 表示空节点
s = input().split(',')
root = TreeNode(int(s[0])) if s and s[0] != 'null' else None
q, i = ([root] if root else []), 1
while q and i < len(s):
node = q.pop(0)
for side in ('left', 'right'):
if i < len(s) and s[i] != 'null': setattr(node, side, TreeNode(int(s[i]))); q.append(getattr(node, side))
i += 1
模拟面试手撕系统
全真还原大厂面试手撕流程,从出题到追问复盘,全程语音沉浸式练习
模拟大厂在线面试全流程
01
参数设置
02
欢迎致辞
03
题目发放
04
思路陈述
05
编码环节
06
问答追问
07
总结归档
完整流程约 30–60 分钟 · 支持面试记录归档与复盘