P1105 平台

 

解题思路:

刷题不够的童鞋看到这道题有思路,但是估计是暴力枚举了,可能超时哦,emmm(虽然我也是枚举的,但没那么暴力,也不会超时),对这道题,先想想,如果要能掉下去,那么下面的平台的高度一定低一点,所以我们可以先按高度排个序,但是光按高度排序是不行的,因为有高度相同的,那么此时就要看到题意里面,高度相同满足条件的话就掉到我们优先输入的平台上,那么排序条件就有两个,这个就是cmp1,接下来就用一个递归搜索就行了,这个应该没问题,然后完成之后,我们要再用sort排序回来,因为结果要按输入的顺序输出的,这就是cmp2,这道题我看了很多题解大多都是用了几个数组,我有点纳闷,为什么能够用结构体封装的数据很多人都喜欢用数组???是结构体有坏处吗?占空间?还是时间占了?用几个数组占的内存差不多但更麻烦,为什么不用结构体???

#include<iostream>
#include<algorithm>
using namespace std;
int n, flagz, flagy;

struct store
{
	int num, xz, xy, h;
	int zuo = 0, you = 0;
}ans[1005];

bool cmp1(store a, store b)
{
	if (a.h == b.h) return a.num > b.num;
	return a.h < b.h;
}

bool cmp2(store a, store b)
{
	return a.num < b.num;
}

void fun(int i)
{
	if (i == n + 1) return;
	for (int o = i - 1; o > 0; --o) {
		if (!flagz &a
pnpm run package > hotpot-financial-system@1.0.0 package E:\安装包\243243323906 > electron-builder • electron-builder version=24.13.3 os=10.0.26100 • loaded configuration file=package.json ("build" field) • writing effective config file=dist\electron\builder-effective-config.yaml • skipped dependencies rebuild reason=npmRebuild is set to false • packaging platform=win32 arch=ia32 electron=28.2.0 appOutDir=dist\electron\win-ia32-unpacked ⨯ remove E:\安装包\243243323906\dist\electron\win-ia32-unpacked\resources\app.asar: The process cannot access the file because it is being used by another process. github.com/develar/go-fs-util.EnsureEmptyDir /Volumes/data/go/pkg/mod/github.com/develar/go-fs-util@v0.0.0-20190620175131-69a2d4542206/fs.go:98 github.com/develar/app-builder/pkg/electron.UnpackElectron.func1.1 /Volumes/data/Documents/app-builder/pkg/electron/electronUnpack.go:38 github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2 /Volumes/data/Documents/app-builder/pkg/util/async.go:68 runtime.goexit /usr/local/Cellar/go/1.17/libexec/src/runtime/asm_386.s:1319 ⨯ E:\安装包\243243323906\node_modules\.pnpm\app-builder-bin@4.0.0\node_modules\app-builder-bin\win\ia32\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 1 failedTask=build stackTrace=Error: E:\安装包\243243323906\node_modules\.pnpm\app-builder-bin@4.0.0\node_modules\app-builder-bin\win\ia32\app-builder.exe process failed ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Exit code: 1 at ChildProcess.<anonymous> (E:\安装包\243243323906\node_modules\.pnpm\builder-util@24.13.1\node_modules\builder-util\src\util.ts:252:14) at Object.onceWrapper (node:events:634:26) at ChildProcess.emit (node:events:519:28) at ChildProcess.cp.emit (E:\安装包\243243323906\node_modules\.pnpm\cross-spawn@7.0.6\node_modules\cross-spawn\lib\enoent.js:34:29) at maybeClose (node:internal/child_process:1105:16) at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)  ELIFECYCLE  Command failed with exit code 1.
08-09
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Merran_

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值