PAT 1147. Heaps (30) - 甲级

In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (in a max heap) or less than or equal to (in a min heap) the key of C. A common implementation of a heap is the binary heap, in which the tree is a complete binary tree. (Quoted from Wikipedia at https://en.wikipedia.org/wiki/Heap_(data_structure))
Your job is to tell if a given complete binary tree is a heap.

Input Specification:

Each input file contains one test case. For each case, the first line gives two positive integers: M (<= 100), the number of trees to be tested; and N (1 < N <= 1000), the number of keys in each tree, respectively. Then M lines follow, each c

codecHandlesFormat: no format, so no extra checks 2025-10-31 10:14:07.929 5301-5301 MediaCodecList com.tencent.yolov5ncnn D codecHandlesFormat: no format, so no extra checks 2025-10-31 10:14:07.938 5301-5349 CCodec com.tencent.yolov5ncnn D allocate(c2.goldfish.h264.decoder) 2025-10-31 10:14:07.942 5301-5349 ApexCodecsLazy com.tencent.yolov5ncnn I Failed to load libcom.android.media.swcodec.apexcodecs.so: dlopen failed: library "libcom.android.media.swcodec.apexcodecs.so" not found 2025-10-31 10:14:07.943 5301-5349 Codec2Client com.tencent.yolov5ncnn I Available Codec2 services: "default" "software" 2025-10-31 10:14:07.945 5301-5349 CCodec com.tencent.yolov5ncnn I setting up 'default' as default (vendor) store 2025-10-31 10:14:07.959 5301-5349 CCodec com.tencent.yolov5ncnn I Created component [c2.goldfish.h264.decoder] for [c2.goldfish.h264.decoder] 2025-10-31 10:14:07.965 5301-5349 CCodecConfig com.tencent.yolov5ncnn D read media type: video/avc 2025-10-31 10:14:07.972 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D extent() != 1 for single value type: algo.buffers.max-count.values 2025-10-31 10:14:07.975 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D extent() != 1 for single value type: output.subscribed-indices.values 2025-10-31 10:14:07.975 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D extent() != 1 for single value type: input.buffers.allocator-ids.values 2025-10-31 10:14:07.975 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D extent() != 1 for single value type: output.buffers.allocator-ids.values 2025-10-31 10:14:07.981 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D extent() != 1 for single value type: algo.buffers.allocator-ids.values 2025-10-31 10:14:07.981 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D extent() != 1 for single value type: output.buffers.pool-ids.values 2025-10-31 10:14:07.982 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D extent() != 1 for single value type: algo.buffers.pool-ids.values 2025-10-31 10:14:07.984 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D ignored struct field coded.color-format.locations 2025-10-31 10:14:07.986 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D ignored struct field resources.needed.values 2025-10-31 10:14:07.987 5301-5349 CCodecConfig com.tencent.yolov5ncnn D ignoring local param raw.size (0xd2001800) as it is already supported 2025-10-31 10:14:07.987 5301-5349 CCodecConfig com.tencent.yolov5ncnn D ignoring local param default.color (0x5200180b) as it is already supported 2025-10-31 10:14:07.987 5301-5349 ReflectedParamUpdater com.tencent.yolov5ncnn D ignored struct field raw.hdr-static-info.mastering 2025-10-31 10:14:07.992 5301-5349 CCodecConfig com.tencent.yolov5ncnn I query failed after returning 12 values (BAD_INDEX) 2025-10-31 10:14:07.993 5301-5349 CCodecConfig com.tencent.yolov5ncnn D c2 config diff is Dict { c2::u32 coded.pl.level = 20496 c2::u32 coded.pl.profile = 20481 c2::u32 coded.vui.color.matrix = 0 c2::u32 coded.vui.color.primaries = 0 c2::u32 coded.vui.color.range = 2 c2::u32 coded.vui.color.transfer = 0 c2::u32 default.color.matrix = 0 c2::u32 default.color.primaries = 0 c2::u32 default.color.range = 0 c2::u32 default.color.transfer = 0 c2::u32 input.buffers.max-size.value = 6291456 c2::u32 input.delay.value = 0 string input.media-type.value = "video/avc" c2::u32 output.delay.value = 8 string output.media-type.value = "video/raw" c2::u32 raw.color.matrix = 0 c2::u32 raw.color.primaries = 0 c2::u32 raw.color.range = 2 c2::u32 raw.color.transfer = 0 c2::u32 raw.max-size.height = 240 c2::u32 raw.max-size.width = 320 c2::u32 raw.pixel-format.value = 35 c2::i32 raw.rotation.flip = 0 c2::i32 raw.rotation.value = 0 c2::u32 raw.sar.height = 1 c2::u32 raw.sar.width = 1 c2::u32 raw.size.height = 240 c2::u32 raw.size.width = 320 c2: 2025-10-31 10:14:07.993 5301-5349 ColorUtils com.tencent.yolov5ncnn W expected specified color aspects (2:0:0:0) 2025-10-31 10:14:08.013 5301-5301 MediaCodec com.tencent.yolov5ncnn E Media Quality Service not found. 2025-10-31 10:14:08.016 5301-5348 SurfaceUtils com.tencent.yolov5ncnn D connecting to surface 0x7fb26d4de740, reason connectToSurface 2025-10-31 10:14:08.016 5301-5348 MediaCodec com.tencent.yolov5ncnn I [c2.goldfish.h264.decoder] setting surface generation to 5428225 2025-10-31 10:14:08.016 5301-5348 SurfaceUtils com.tencent.yolov5ncnn D disconnecting from surface 0x7fb26d4de740, reason connectToSurface(reconnect) 2025-10-31 10:14:08.017 5301-5348 SurfaceUtils com.tencent.yolov5ncnn D connecting to surface 0x7fb26d4de730, reason connectToSurface(reconnect-with-listener) 2025-10-31 10:14:08.021 5301-5349 CCodecBufferChannel com.tencent.yolov5ncnn I Using latch times for frame rendered signals - present fences not supported 2025-10-31 10:14:08.021 5301-5349 CCodec com.tencent.yolov5ncnn D [c2.goldfish.h264.decoder] buffers are bound to CCodec for this session 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for color-format 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for track-id 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for frame-count 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for language 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for display-width 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for csd-1 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for durationUs 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for display-height 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for native-window 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for native-window-generation 2025-10-31 10:14:08.022 5301-5349 CCodecConfig com.tencent.yolov5ncnn D no c2 equivalents for flags 2025-10-31 10:14:08.026 5301-5349 CCodecConfig com.tencent.yolov5ncnn D c2 config diff is c2::u32 coded.pl.level = 20494 c2::u32 coded.pl.profile = 20484 c2::u32 raw.size.height = 1296 c2::u32 raw.size.width = 2304 2025-10-31 10:14:08.032 5301-5349 Codec2Client com.tencent.yolov5ncnn W query -- param skipped: index = 1107298332. 2025-10-31 10:14:08.032 5301-5349 CCodec com.tencent.yolov5ncnn D client requested max input size 574215, which is smaller than what component recommended (6291456); overriding with component recommendation. 2025-10-31 10:14:08.032 5301-5349 CCodec com.tencent.yolov5ncnn W This behavior is subject to change. It is recommended that app developers double check whether the requested max input size is in reasonable range. 2025-10-31 10:14:08.032 5301-5349 CCodec com.tencent.yolov5ncnn D encoding statistics level = 0 2025-10-31 10:14:08.032 5301-5349 CCodec com.tencent.yolov5ncnn D setup formats input: AMessage(what = 0x00000000) = { int32_t height = 1296 int32_t level = 16384 int32_t max-input-size = 6291456 string mime = "video/avc" int32_t profile = 8 int32_t width = 2304 Rect crop(0, 0, 2303, 1295) } 2025-10-31 10:14:08.032 5301-5349 CCodec com.tencent.yolov5ncnn D setup formats output: AMessage(what = 0x00000000) = { int32_t android._color-format = 2135033992 int32_t android._video-scaling = 1 int32_t rotation-degrees = 0 int32_t color-standard = 1 int32_t color-range = 2 int32_t color-transfer = 3 int32_t sar-height = 1 int32_t sar-width = 1 Rect crop(0, 0, 2303, 1295) int32_t width = 2304 int32_t height = 1296 int32_t max-height = 240 int32_t max-width = 320 string mime = "video/raw" int32_t android._dataspace = 260 int32_t color-format = 2135033992 } 2025-10-31 10:14:08.033 5301-5349 CCodecConfig com.tencent.yolov5ncnn I query failed after returning 12 values (BAD_INDEX) 2025-10-31 10:14:08.033 5301-5349 CCodecConfig com.tencent.yolov5ncnn D c2 config diff is c2::u32 raw.max-size.height = 1296 c2::u32 raw.max-size.width = 2304 2025-10-31 10:14:08.041 5301-5349 Codec2Client com.tencent.yolov5ncnn W query -- param skipped: index = 1342179345. 2025-10-31 10:14:08.042 5301-5349 Codec2Client com.tencent.yolov5ncnn W query -- param skipped: index = 2415921170. 2025-10-31 10:14:08.042 5301-5349 Codec2Client com.tencent.yolov5ncnn W query -- param skipped: index = 1610614798. 2025-10-31 10:14:08.042 5301-5349 Codec2Client com.tencent.yolov5ncnn W query -- param skipped: index = 2684356609. 2025-10-31 10:14:08.043 5301-5349 C2Store com.tencent.yolov5ncnn D Using DMABUF Heaps 2025-10-31 10:14:08.047 5301-5349 CCodecBufferChannel com.tencent.yolov5ncnn D [c2.goldfish.h264.decoder#393] Created input block pool with allocatorID 16 => poolID 17 - OK (0) 2025-10-31 10:14:08.048 5301-5349 CCodecBufferChannel com.tencent.yolov5ncnn D [c2.goldfish.h264.decoder#393] Query output surface allocator returned 0 params => BAD_INDEX (6) 2025-10-31 10:14:08.050 5301-5349 CCodecBufferChannel com.tencent.yolov5ncnn I [c2.goldfish.h264.decoder#393] Created output block pool with allocatorID 18 => poolID 25 - OK 2025-10-31 10:14:08.051 5301-5349 CCodecBufferChannel com.tencent.yolov5ncnn D [c2.goldfish.h264.decoder#393] Configured output block pool ids 25 => OK 2025-10-31 10:14:08.052 5301-5349 Codec2-Out...ufferQueue com.tencent.yolov5ncnn D remote graphic buffer migration 0/0 2025-10-31 10:14:08.052 5301-5349 Codec2Client com.tencent.yolov5ncnn D setOutputSurface -- failed to set consumer usage (6/BAD_INDEX) 2025-10-31 10:14:08.052 5301-5349 Codec2Client com.tencent.yolov5ncnn D setOutputSurface -- generation=5428225 consumer usage=0x900 2025-10-31 10:14:08.059 5301-5349 Codec2Client com.tencent.yolov5ncnn D Surface configure completed 2025-10-31 10:14:08.060 5301-5349 DMABUFHEAPS com.tencent.yolov5ncnn I Using DMA-BUF heap named: system 2025-10-31 10:14:08.264 5301-5349 CCodecConfig com.tencent.yolov5ncnn D c2 config diff is c2::u32 raw.crop.height = 1296 c2::u32 raw.crop.left = 0 c2::u32 raw.crop.top = 0 c2::u32 raw.crop.width = 2304 2025-10-31 10:14:08.270 5301-5301 System.out com.tencent.yolov5ncnn I image == null!!!!!!!!!!! 2025-10-31 10:14:08.270 5301-5301 System.out com.tencent.yolov5ncnn I surfaceChanged!!!!!!!!!!!!!!! 2025-10-31 10:14:08.972 5301-5301 Choreographer com.tencent.yolov5ncnn I Skipped 41 frames! The application may be doing too much work on its main thread. 2025-10-31 10:14:08.979 5301-5325 HWUI com.tencent.yolov5ncnn I Davey! duration=954ms; Flags=1, FrameTimelineVsyncId=53495, IntendedVsync=2809136577648, Vsync=2809136577648, InputEventId=0, HandleInputStart=2809138486400, AnimationStart=2809138526700, PerformTraversalsStart=2809138583400, DrawStart=2809632751300, FrameDeadline=2809153244314, FrameStartTime=2809138462300, FrameInterval=16666666, WorkloadTarget=16666666, SyncQueued=2809633289100, SyncStart=2809838331200, IssueDrawCommandsStart=2809838546200, SwapBuffers=2809840024200, FrameCompleted=2810296163000, DequeueBufferDuration=454788300, QueueBufferDuration=351100, GpuCompleted=2810054319600, SwapBuffersCompleted=2810296163000, DisplayPresentTime=0, CommandSubmissionCompleted=2809840024200, 2025-10-31 10:14:09.027 5301-5301 InsetsController com.tencent.yolov5ncnn D hide(ime(), fromIme=false) 2025-10-31 10:14:09.027 5301-5301 ImeTracker com.tencent.yolov5ncnn I com.tencent.yolov5ncnn:87efbc8a: onCancelled at PHASE_CLIENT_ALREADY_HIDDEN 2025-10-31 10:14:13.051 5301-5352 BufferPoolAccessor2.0 com.tencent.yolov5ncnn D bufferpool2 0x7fb23d4b7b78 : 6(37748736 size) total buffers - 4(25165824 size) used buffers - 0/6 (recycle/alloc) - 6/6 (fetch/transfer) 2025-10-31 10:14:13.051 5301-5352 BufferPoolAccessor2.0 com.tencent.yolov5ncnn D evictor expired: 1, evicted: 1
最新发布
11-01
评论 10
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值