Problem 3792 --Cute Tree

3792: Cute Tree

"
Time Limit $1$ 秒/Second(s) Memory Limit $128$ 兆字节/Megabyte(s)
提交总数 $9$ 正确数量 $4$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Given the pseudo-code of a function Build−Tree(A,id,L,R):


where A is given in input, id is the number of node, L ,R is the left position and the right position of A

Require the number of nodes created by Build−Tree(A,root,1,n).

The first line contains an integer T (1≤T≤5) representing the number of test cases.

For each test case, the first contain one integer n(1≤n≤2∗105).

The second line contain n integers Ai(1≤ A≤109).
For each test output one line, the number of nodes created by Build−Tree(A,root,1,n).
2
4
2 2 5 3
10
21 10 5 89 12 3 42 13 55 76
6
15

推荐代码 查看3792 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$76 $ms] 月落星辰挽 846807 2022-04-23 15:55:41
内存最少[$2024 $KB] VICTOR.杰 822924 2022-03-19 18:10:29
第一AC 只能过个样例~~~ 789458 2021-12-01 17:36:39
第一挑战 只能过个样例~~~ 761668 2021-08-04 18:12:15

赛题来源/所属竞赛 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛
1696 2022年省赛预选赛(数据结构与STL) 2022-03-19 14:00:00 请登录