CF 718 E - Group Photo

这篇博客探讨了一种解决AI数组排列问题的方法,其中C序列要求递增且相隔两个数的差值递增,P序列要求递减。通过枚举和二分搜索策略,确定满足条件的C和P序列组合。文章详细分析了五种特殊情况,并提供了相应的解决方案,最终给出了完整的C++代码实现。

给出一个ai数组,然后构造C和P序列,两个序列的合集是1到n的排列。然后c的排列对应的a的和要小于p对应的a的和。

而且C序列相隔两个数的差值要递增,P要递减。 具体还是去看题目吧(少写点字)

 

由于C要递增,P要递减,因此只有几种情况

1.C一开始是连续的,然后后面是差值为2。 (12345 7 9 11 。。。。)

2.C前面放一个P,然后从2开始的第一种情况

3.整个CP序列最后是C,然后前面按第一种情况

4.2,3整合

还有特殊的两种

5. CP序列C都在最后面。

6. 没有C

 

 

对于前4种,枚举c连续到那个位置,然后二分后面差值为2的下标最远可以去到哪里,然后就加加减减判断下前面有没有多的p后面有没有多的c就好了。

由于枚举的时候,2,3会和第一种有重复 (CPC结尾),因此2,3在做二分的时候,最右只能去到n-3(n-2就会出现重复了). (就是这里写错了导致没A到啊。。上分失败T_T)

对于第5种,就直接枚举后面有多少个C了

第6种直接加1就好了。

 

 

using namespace std;
int mod = 998244353;
//int mod = 1e9+7;

int n,m;

ll sum[N],qs[N];
ll a[N];


int sol(int idx, int n, ll tot, ll es, ll ecs){
	ll cur_sum = sum[idx]-es + ecs;
	int l = idx, r = n+1;
	while(l+4<r){
		int mid = (l+r)>>1;
		int p_mid = mid;
		if((mid - idx)%2){
			p_mid--;
		}
		ll s = qs[p_mid] - qs[idx];
		s += cur_sum;
		ll ss = tot - s;
		if(s<ss){
			l = p_mid;
		}
		else {
			r = p_mid;
		}
	}
	int ret = l-1;
	for(int i = l; i <=min(n,r); i+=2){
		ll s = qs[i] - qs[idx];
		s += cur_sum;
		ll ss = tot - s;
		if(s<ss){
			ret = i;
		}
	}
	if(ret<l){
		return 0;
	}
	return (ret + 2 - idx)/2;
}

int main(){

	int t;
	cin>>t;
	while(t--){
		sf("%d",&n);
		fr(i,1,n+1){
			sf("%lld",&a[i]);
			sum[i] = sum[i-1]+a[i];
		}
		fr(i,1,n+1){
			if(i==1) qs[i] = a[i];
			else qs[i] = qs[i-2] + a[i];
		}
		ll ans = 0;
		for(int i = 1; i <=n; ++i){
			ans = (ans + sol(i,n,sum[n],0,0))%mod;
			if(i>1){
				ans = (ans + sol(i,n,sum[n],sum[1],0))%mod;
			}
			if(i<n){
				ans = (ans + sol(i,n-3,sum[n],0,a[n]))%mod;
			}
			if(i>1&&i<n){
				ans = (ans + sol(i,n-3,sum[n],a[1],a[n]))%mod;
			}
		}
		for(int i = 3; i <=n; ++i){
			ll s1 = sum[i-1];
			ll s2 = sum[n]- s1;
			if(s2<s1){
				ans = (ans + 1 ) %mod;
			}
		}
		cout<<ans+1<<endl;
	}
}


 

<template> <div> <div style="margin-bottom: 20px"> <RouterLink to="/test">通过router跳转到Test.vue</RouterLink> <a href="/test">通过a标签跳转到Test.vue</a> </div> <div> <el-button type="primary" @click="router.push('/test')">push跳转到新的页面</el-button> <el-button type="primary" @click="router.replace('/test')">test跳转到新的页面</el-button> </div> <div style="margin-bottom: 20px"> <el-button type="primary" @click="router.push('/test?id=2&name=青哥哥')">路由传参id=2&name=青哥哥</el-button> </div> <div> <el-input clearable v-model="data.input" style="width: 240px" placeholder="请输入文本" :prefix-icon="Search"/>{{data.input}} <el-input style="width: 200px" :suffix-icon="Calendar"></el-input> <el-input v-model="data.textare" style="width: 200px" type="textarea" placeholder="请输入一段描述"></el-input> </div> <div style="margin: 20px 0"> <el-select multiple clearable v-model="data.value" value-key="id" size="large" placeholder="Please 选择水果" style="width: 240px" > <el-option v-for="item in data.options" :key="item.id" :label="item.label" :value="item.name" /> </el-select>{{data.value}} <div style="margin: 20px 0"> <el-radio-group v-model="data.sex"> <el-radio value='男'>男</el-radio> <el-radio value='女'>女</el-radio> </el-radio-group> <span style="margin-left: 50px">{{data.sex}}</span> <el-radio-group v-model="data.tags" style="margin-left: 20px"> <el-radio value="1" size="large" border>点赞内容</el-radio> <el-radio value="2" size="large" border>投币内容</el-radio> <el-radio value="3" size="large" border>关注内容</el-radio> </el-radio-group> <el-checkbox-group v-model="data.checkList"> <el-checkbox v-for="item in data.options" :key="item.id" :value= "item.name" :label="item.label"/> </el-checkbox-group> </div> <div> <el-image :src="img" style="width: 100px; margin-left: 100px " :preview-src-list="[img,'https://fuss10.elemecdn.com/d/e6/c4d93a3805b3ce3f323f7974e6f78jpeg.jpeg']" /> </div> <div> <el-carousel height="400px" style="width: 550px"> <el-carousel-item v-for="item in data.imgs" :key="item"> <img style="width: 100%; height: 400px" :src="item" alt=""> </el-carousel-item> </el-carousel> </div> <div style="margin: 20px 0"> <el-date-picker v-model="data.date" type="date" placeholder="请选择日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />{{data.date}} </div> <div> <el-date-picker v-model="data.date1" type="datetime" placeholder="请选择日期时间" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" date-format="MMM DD, YYYY" time-format="HH:mm" />{{data.date1}} </div> <div> <el-date-picker v-model="data.date2" type="datetime" placeholder="请选择时间" format="HH:mm:ss" value-format="HH:mm:ss" date-format="MMM DD, YYYY" time-format="HH:mm" />{{data.date2}} </div> <div> <el-date-picker v-model="data.daterange" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" />{{data.daterange?.length ? data.daterange[0] : ''}} {{data.daterange?.length ? data.daterange[1] : ''}} </div> <div> <el-table :data="data.tableData" style="width: 100%" stripe border> <el-table-column prop="date" label="Date" width="180" /> <el-table-column prop="name" label="Name" width="180" /> <el-table-column prop="address" label="地址" /> <el-table-column label="操作"> <template #default="scope"> <el-button type="primary" circle @click="edit(scope.row)"> <el-icon><Edit/></el-icon> </el-button> <el-button type="danger" circle @click="del(scope.row.id)"> <el-icon><Delete/></el-icon> </el-button> </template> </el-table-column> </el-table> </div> <div style="padding: 10px 0"> <el-pagination v-model:current-page="data.currentPage" v-model:page-size="data.pageSize" :page-sizes="[5, 10, 15, 20]" background layout="total, sizes, prev, pager, next, jumper" :total="data.tableData.length" /> </div> </div> <el-dialog v-model="data.dialogVisible" title="Shipping address" width="500"> <div style="padding: 20px"> <div style="margin-bottom: 10px">日期:{{data.row.date}}</div> <div style="margin-bottom: 10px">名称:{{data.row.name}}</div> <div>地址:{{data.row.address}}</div> </div> </el-dialog> </div> </template> <script setup> import {reactive} from "vue"; import {Search, Calendar, Delete} from "@element-plus/icons-vue"; import img from '@/assets/favicon.ico' import router from "@/router/index.js"; const data =reactive({ input: null, textare:'adwawdawfawfjkawjanwkenawjknejkawnejkwane', value:'', options:[{id: 1,label:'苹果',name: '苹果1'},{id: 2,label:'香蕉',name : '香蕉'},{id : 3,label:'桃子', name : '桃子'},{id: 4,label:'苹果', name:'苹果2'}], sex: '男', tags: '2', checkList: [], imgs:['https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg','https://ts1.tc.mm.bing.net/th/id/R-C.8bbf769b39bb26eefb9b6de51c23851d?rik=crTnc5i8A%2b8p7A&riu=http%3a%2f%2fpicview.iituku.com%2fcontentm%2fzhuanji%2fimg%2f202207%2f09%2fe7196ac159f7cf2b.jpg%2fnu&ehk=DYPLVpoNAXLj5qzwgR5vHf9DladFh%2b34s4UcuP3Kn6E%3d&risl=&pid=ImgRaw&r=0','https://img95.699pic.com/photo/50464/9776.jpg_wh860.jpg'], date:'', date1:'', date2:'', daterange:null, currentPage: 1, pageSize: 5, tableData:[ {id:1, date: '2024-10-11', name: '亲哥', address:'安徽合肥'}, {id:2, date: '2024-10-12', name: '小哥',address:'上海浦东'}, {id:3, date: '2025-10-12',name:'小李',address: '陕西' }, {id:4, date: '2024-10-11', name: '亲哥', address:'安徽合肥'}, {id:5, date: '2024-10-12', name: '小哥',address:'上海浦东'}, {id:6, date: '2025-10-12',name:'小李',address: '陕西' }, {id:7, date: '2024-10-11', name: '亲哥', address:'安徽合肥'}, {id:8, date: '2024-10-12', name: '小哥',address:'上海浦东'}, {id:9, date: '2025-10-12',name:'小李',address: '陕西' }], dialogVisible:false, row:null }) const del = (id) =>{ alert("删除ID= "+id+"的数据") } const edit = (row) =>{ data.row = row data.dialogVisible = true } data.tableData = data.tableData.splice(0,5); </script> 哪里错了
11-04
机动车savePicAndJbxx: -- 根据部门编码,档案袋编号,档案袋类型,档案编号,流水号去dagldadglxx里面查询是否存在这一条数据 SELECT T.* FROM DAGL_DADGLXX T WHERE T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000321' AND T.DADLX = 'VEH' AND T.DABH = '4208Z0810046' AND T.LSH = '1H90216000570' -- 根据档案编号和业务流水号去dagldadglxx中去查询,对应流水号下的ywlx有几种,只允许有一种类型 select YWLX from DAGL_VEH_DAZP where dabh = '4208Z0810046' and ywlsh ='1H90216000570' group by ywlsh,YWLX -- 先去根据档案编号查询档案信息数据 如果没有就新增档案信息,如果有就不新增 SELECT T.* FROM DAGL_VEH_DAXX T WHERE T.DABH = '4208Z0810046' -- 新拍摄照片后,往档案袋信息表插入一条数据,如果存在该档案袋数据,则更新档案袋信息表的档案状态为待校对(将状态修改为待交对状态) SELECT * from DAGL_DADXX T where T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000321' UPDATE DAGL_DADXX T SET T.DAS = '02', T.DAGUI = '010', T.DAGE = '012', T.DACFD = '02010012', T.DZDAZT = '0' WHERE T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000321' -- 获取数据库中的序号是多少,在代码层面将数据库中获取到的序号+1则是新的编号 select max(zpxh) zpxh from dagl_veh_dazp T where dabh = '4208Z0810046' -- 查看该数据是否是自定义流水号 select DISTINCT(sfzdylsh) from DAGL_Veh_DAZP where ywlsh = '1H90216000570' and dabh = '4208Z0810046' -- 新增数据 INSERT INTO DAGL_VEH_DAZP ( DABH, ZPXH, JDCXH, HPZL, HPHM, YWLSH, YWLX, ZLLB, ZLMC, CJR, CJIP, CJSJ, SFJD, DZDAZT, SFZDYLSH, DAZPLJ, YDAZPLJ ) VALUES ( '4208Z0810046', 152, '42080008110212', '07', 'H5L409', '1H90216000570', 'A', '10209', '车辆使用性质证明', 'admin', '0:0:0:0:0:0:0:1', to_date('2025-9-28 15:04:03','YYYY-MM-DD HH24:MI:SS'), '0', '0', '0', 'd:\photo\2025\09\28\4208Z0810046\1H90216000570\152\PresentPhoto.TP', 'd:\photo\2025\09\28\4208Z0810046\1H90216000570\152\OriginalPhoto.TP' ) -- 查询该流水号下面的数据,然后封装进result里面一起返回给前端页面 select dabh,zpxh,to_char(cjsj,'yyyy-mm-dd hh24:mi:ss') cjsj,zllb,ywlsh,ywlx from dagl_veh_dazp T where dabh = '4208Z0810046' and ywlsh = '1H90216000570' order by cjsj asc 机动车savepic: -- 根据部门编码,档案袋编号,档案袋类型,档案编号,流水号去dagldadglxx里面查询是否存在这一条数据 SELECT T.* FROM DAGL_DADGLXX T WHERE T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000321' AND T.DADLX = 'VEH' AND T.DABH = '4208Z0810046' AND T.LSH = '1H90216000570' -- 根据档案编号和业务流水号去dagldadglxx中去查询,对应流水号下的ywlx有几种,只允许有一种类 select YWLX from DAGL_VEH_DAZP where dabh = '4208Z0810046' and ywlsh = '1H90216000570' group by ywlsh,YWLX -- 获取档案信息 校验数据是否被非法篡改 SELECT T.* FROM DAGL_VEH_DAXX T WHERE T.DABH = '4208Z0810046' -- 修改档案室,档案柜,档案格,档案存放地,校验位等信息 update dagl_veh_daxx set das = '02', dagui = '010', dage = '012', dacfd = '02010012', jyw ='91DEB5A5EC85F2D5FFFA07244480811E318FBBCA8FCFC2361474B4B72E06C78EE9D8B5CB94CFC8371475B0B12F01BD8B95DDB5C2E4CF' where dabh = '4208Z0810046' -- 新拍摄照片后,往档案袋信息表插入一条数据,如果存在该档案袋数据,则更新档案袋信息表的档案状态为待校对(将状态修改为待交对状态) UPDATE DAGL_DADXX T SET T.DAS = '02', T.DAGUI = '010', T.DAGE = '012', T.DACFD = '02010012', T.DZDAZT = '0' WHERE T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000321' AND T.DADLX = 'VEH' -- 获取数据库中的序号是多少,在代码层面将数据库中获取到的序号+1则是新的编号 select max(zpxh) zpxh from dagl_veh_dazp where dabh = '4208Z0810046' -- 校验一下流水号是否是自定义的 select DISTINCT(sfzdylsh) from DAGL_Veh_DAZP where ywlsh = '1H90216000570' and dabh = '4208Z0810046' -- 新增数据 INSERT INTO DAGL_VEH_DAZP ( DABH, ZPXH, JDCXH, HPZL, HPHM, YWLSH, YWLX, ZLLB, ZLMC, CJR, CJIP, CJSJ, SFJD, DZDAZT, SFZDYLSH, DAS, DAGUI, DAGE, DACFD, DAZPLJ, YDAZPLJ ) VALUES ( '4208Z0810046', 154, '42080008110212', '07', 'H5L409', '1H90216000570', 'A', '10209', '车辆使用性质证明', 'admin', '0:0:0:0:0:0:0:1', TO_DATE('2025-9-28 15:30:14','YYYY-MM-DD HH24:MI:SS' ), '0', '0', '0', '02', '010', '012', '02010012', 'd:\photo\2025\09\28\4208Z0810046\1H90216000570\154\PresentPhoto.TP', 'd:\photo\2025\09\28\4208Z0810046\1H90216000570\154\OriginalPhoto.TP' ) -- 查询该流水号下面的数据,然后封装进result里面一起返回给前端页面 select dabh, zpxh, to_char(cjsj,'yyyy-mm-dd hh24:mi:ss') cjsj, zllb, ywlsh, ywlx from dagl_veh_dazp T where dabh = '4208Z0810046' AND T.YWLSH = '1H90216000570' order by cjsj asc 驾驶人savePicAndJbxx: -- 根据部门编码,档案袋编号,档案袋类型,档案编号,流水号去dagldadglxx里面查询是否存在这一条数据 SELECT T.* FROM DAGL_DADGLXX T WHERE T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000304' AND T.DADLX = 'DRV' AND T.DABH = '420800001961' AND T.LSH = '2M90506044802' -- 根据档案编号和业务流水号去dagldadglxx中去查询,对应流水号下的ywlx有几种,只允许有一种类型 select YWLX from DAGL_DRV_DAZP where dabh = '420800001961' and ywlsh = '2M90506044802' group by ywlsh,YWLX -- 查看档案编号对应的相关信息 SELECT T.* FROM DAGL_DRV_DAXX T WHERE T.DABH = '420800001961' -- 将更新档案袋信息表的档案状态为待校对 UPDATE DAGL_DADXX T SET T.DAS = '01', T.DAGUI = '009', T.DAGE = '014', T.DACFD = '01009014', T.DZDAZT = '0' WHERE T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000304' AND T.DADLX = 'DRV' -- 获取数据库中的序号是多少,在代码层面将数据库中获取到的序号+1则是新的编号 select max(zpxh) zpxh from dagl_drv_dazp T where dabh = '420800001961' -- 查询一下这个流水号是否是自定义的流水号 select DISTINCT(sfzdylsh) from DAGL_DRV_DAZP where ywlsh = '2M90506044802' and dabh = '420800001961' -- 新增数据 INSERT INTO DAGL_DRV_DAZP ( DABH, ZPXH, SFZMMC, SFZMHM, XM, YWLSH, YWLX, ZLLB, ZLMC, CJR, CJIP, CJSJ, SFJD, DZDAZT, SFZDYLSH, DAZPLJ, YDAZPLJ ) VALUES ( '420800001961', 10, 'A', '420802197105070111', '揭勇', '2M90506044802', 'K', '20010', '科目三道路技能成绩表', 'admin', '0:0:0:0:0:0:0:1', TO_DATE('2025-9-28 15:54:36','YYYY-MM-DD HH24:MI:SS' ), '0', '0', '0', 'd:\photo\2025\09\28\420800001961\2M90506044802\10\PresentPhoto.TP', 'd:\photo\2025\09\28\420800001961\2M90506044802\10\OriginalPhoto.TP') -- 查询该流水号下面的数据,然后封装进result里面一起返回给前端页面 select dabh, zpxh, to_char(cjsj,'yyyy-mm-dd hh24:mi:ss') cjsj, zllb, ywlsh, ywlx from dagl_drv_dazp T where dabh = '420800001961' AND T.YWLSH = '2M90506044802' order by cjsj asc 驾驶人savePic: -- 校验该档案袋与档案编号是否关联 SELECT T.* FROM DAGL_DADGLXX T WHERE T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000304' AND T.DADLX = 'DRV' AND T.DABH = '420800001961' AND T.LSH = '2M90506044802' -- 校验,同一流水不能绑定第二个业务类型。 select YWLX from DAGL_DRV_DAZP where dabh = '420800001961' and ywlsh = '2M90506044802' group by ywlsh,YWLX -- 获取档案信息,并使用拦截器进行校验位的校验,检查数据是否被非法篡改 SELECT T.* FROM DAGL_DRV_DAXX T WHERE T.DABH = '420800001961' -- 修改档案室,档案柜,档案格,档案存放地,校验位等信息 update dagl_drv_daxx set das = '01', dagui = '009', dage = '014', dacfd = '01009014', jyw = 'DB4D5FEF7F6FECAE92978B16336C5F8B5941D1D49EA2A7BB270A5A6EBF6B71E9DF4D5ED599A3A7BE26045C6EBA6800E1DE4F5FDD9EA2A6BB27035C6EBB6970E1' where dabh = '420800001961' -- 新拍摄照片后,往档案袋信息表插入一条数据,如果存在该档案袋数据,则更新档案袋信息表的档案状态为待校对(将状态修改为待交对状态) UPDATE DAGL_DADXX T SET T.DAS = '01', T.DAGUI = '009', T.DAGE = '014', T.DACFD = '01009014', T.DZDAZT = '0' WHERE T.BMBM = '420000000000' AND T.DADBH = 'DZD000000000090000304' AND T.DADLX = 'DRV' -- 获取sfzdylsh校验是否是自定义流水 select DISTINCT(sfzdylsh) from DAGL_DRV_DAZP where ywlsh = '2M90506044802' and dabh = '420800001961' -- 新增数据 INSERT INTO DAGL_DRV_DAZP ( DABH, ZPXH, SFZMMC, SFZMHM, XM, YWLSH, YWLX, ZLLB, ZLMC, CJR, CJIP, CJSJ, SFJD, DZDAZT, SFZDYLSH, DAZPLJ, YDAZPLJ ) VALUES ( '420800001961', 12, 'A', '420802197105070111', '揭勇', '2M90506044802', 'K', '20010', '科目三道路技能成绩表', 'admin', '0:0:0:0:0:0:0:1', TO_DATE('2025-9-28 16:05:50','YYYY-MM-DD HH24:MI:SS'), '0', '0', '0', 'd:\photo\2025\09\28\420800001961\2M90506044802\12\PresentPhoto.TP', 'd:\photo\2025\09\28\420800001961\2M90506044802\12\OriginalPhoto.TP' ) -- 查询该流水号下面的数据,然后封装进result里面一起返回给前端页面 select dabh, zpxh, to_char(cjsj,'yyyy-mm-dd hh24:mi:ss') cjsj, zllb, ywlsh, ywlx from dagl_drv_dazp T where dabh = '420800001961' AND T.YWLSH = '2M90506044802' order by cjsj asc一个是驾驶人的两个方法,一个是机动车的两个方法,我是想问他是不是两个同名的方法执行的sql在做一样的操作
09-29
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> <title></title> <link rel="stylesheet" type="text/css" href="./css/style.css" /> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <!-- <script src="./js/mui.min.js"></script> --> <!-- <script src="./js/flexble.js"></script> --> </head> <style> /*下载页面*/ .BDS_state{ background-color: #00ff00; position: absolute; right: 0.58rem; border-radius: 0.2rem 0rem; } .BDS_states{ background-color: red; position: absolute; right: 0.58rem; border-radius: 0.2rem 0rem; } .u4 { width: 4.33rem; display: flex; align-items: center; flex-direction: column; justify-content: space-around; text-align: center; position: fixed; top: 0.15rem; left: 0rem; font-size: 0.46rem; } .p4{ color: #8c00ff; font-family: "微软雅黑"; font-weight: 600; font-size: 0.55rem; } .BtnT { bottom:0.6rem; position: fixed; box-shadow: 1px 5px 9px 0px #484b5157; color: white; background-color: #008cf3; border: none; border-radius: 0.08rem; font-size: 0.45rem; height: 1.6rem; width: 4rem; } .u2 { box-shadow: 0rem 0.05rem 0.05rem #7c7c7c2e; height: 2.02rem; background-color: #ffffff; top: 0; position: fixed; width: 100%; display: flex; flex-direction: row; justify-content: center; } /* 顶部搜索栏 */ .InputDatas { position: fixed; top: 0; left: 0; right: 0; padding: 12px 15px; display: flex; border-bottom: 1px solid #e0e0e0; height: 60px; background-color: white; width: 100%; flex-direction: row; align-items: center; justify-content: center; z-index: 100; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); } .AllDatas { flex: 1; padding: 8px 15px; font-size: 16px; border-radius: 8px; border: 1px solid #ddd; background-color: #f8f8f8; color: #555; outline: none; transition: border-color 0.3s; } .AllDatas:focus { border-color: #008cf3; } #resultCount { margin-left: 10px; font-size: 14px; color: #777; min-width: 60px; } /* 中间滚动区域 */ .u4Scoll { position: absolute; top: 60px; /* 等于InputDatas的高度 */ bottom: 92px; /* 等于BtnTR的高度 + 底部间距 */ left: 0; right: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 15px; background-color: #f9f9f9; } .BDALL { width: 100%; display: flex; flex-direction: column; } .BDSS { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); font-size: 16px; border-radius: 10px; padding: 15px; background-color: white; margin-bottom: 12px; transition: transform 0.2s, box-shadow 0.2s; } .BDSS:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); } .BDS_state, .BDS_states { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 12px; color: white; margin-bottom: 8px; } .BDS_state { background-color: #4CAF50; /* 正常状态 */ } .BDS_states { background-color: #F44336; /* 异常状态 */ } .BDS_ID, .BDS_time, .BDS_IDP { margin-bottom: 6px; color: #555; } .BDS_stateWhy { display: flex; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #eee; } .BDS_decser { color: #888; min-width: 40px; } .BDS_decserTexts { color: #333; flex: 1; } /* 底部按钮 */ .BtnTR { position: fixed; bottom: 68px; left: 50%; transform: translateX(-50%); height: 50px; width: 200px; background-color: #008cf3; border: none; color: white; font-size: 18px; border-radius: 8px; font-weight: 500; box-shadow: 0 4px 12px rgba(0, 140, 243, 0.3); z-index: 100; cursor: pointer; transition: background-color 0.3s, transform 0.2s; } .BtnTR:hover { background-color: #0078d7; } .BtnTR:active { transform: translateX(-50%) scale(0.98); } /* 修复后的底部导航栏样式 - 提高选择器优先级 */ .fliale { position: fixed; bottom: 0; left: 0; right: 0; border-top: 1px solid #e6e6e6; width: 100%; height: 60px; display: flex; flex-direction: row; justify-content: space-around; align-items: center; background-color: white; z-index: 200; box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05); } .fliale button { flex: 1; height: 100%; font-size: 16px; border: none; background-color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.3s; position: relative; color: #333; } /* 提高选择器优先级 - 这是关键修复 */ .fliale button#NotJob.active, .fliale button#GoodJob.active { background-color: #008cf3 !important; color: white !important; } .countJia, .countJan { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; min-width: 22px; height: 22px; font-size: 12px; margin-left: 5px; padding: 0 5px; } .countJia { background-color: #F44336; color: white; } .countJan { background-color: #4CAF50; color: white; } /* 未完成页面样式 */ .u2 { position: fixed; top: 0; left: 0; right: 0; height: 60px; background-color: white; display: flex; align-items: center; padding: 0 15px; border-bottom: 1px solid #eee; z-index: 100; } .p2 { font-size: 16px; color: #777; } .p4 { font-size: 18px; font-weight: 500; margin-left: 8px; color: #333; } .u3 { position: absolute; top: 60px; bottom: 60px; left: 0; right: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 15px; } .C1 { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05); border: 1px solid #e0e0e0; margin-bottom: 10px; background-color: white; border-radius: 8px; height: 70px; display: flex; flex-direction: row; align-items: center; justify-content: space-between; padding: 0 20px; transition: transform 0.2s, box-shadow 0.2s; } .C1:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); } .p1 { font-size: 16px; color: #333; } .InpO { height: 20px; width: 20px; cursor: pointer; } input[type="radio"] { -webkit-appearance: none; /* 用于WebKit浏览器,如Chrome, Safari */ -moz-appearance: none; /* 用于Firefox */ appearance: none; /* 标准属性,目前支持还不够全面 */ /* 然后可以自定义样式,比如设置边框、背景等 */ border: none; /* 移除边框 */ /* 或者设置一个自定义的边框样式,但用户要求隐藏,所以这里我们设置none */ } .SVGImg { width: 7rem; padding-left: 0.2rem; } .p3 { position: absolute; top: 13.4rem; font-size: 0.60rem; color: #c0c0c0; } /* 开始扫描按钮 */ #start-scan-button { position: absolute; top: 10px; right: 15px; height: 40px; width: 120px; background-color: #008cf3; border: none; color: white; font-size: 16px; border-radius: 8px; z-index: 101; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); cursor: pointer; transition: background-color 0.3s; } #start-scan-button:hover { background-color: #0078d7; } /* 状态选择弹窗 */ .u11 { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; } .btns { background: white; padding: 30px; border-radius: 15px; text-align: center; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); width: 80%; max-width: 300px; /* 确保居中 */ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .btns button { display: block; width: 100%; padding: 15px; margin: 10px 0; font-size: 18px; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.3s; } #btnYes { background-color: #4CAF50; color: white; } #btnNo { background-color: #F44336; color: white; } /* 异常备注弹窗 */ .u12 { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; } .u12-content { background: white; padding: 20px; border-radius: 15px; width: 90%; max-width: 400px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); /* 确保居中 */ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } #myTextarea { width: 100%; height: 150px; padding: 12px; font-size: 16px; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 15px; resize: none; } .u14 { display: flex; justify-content: space-between; } .u14 button { padding: 12px 25px; border: none; border-radius: 8px; font-size: 16px; cursor: pointer; transition: background-color 0.3s; } .btn10 { background-color: #008cf3; color: white; } .btn11 { background-color: #e0e0e0; color: #333; } </style> <body> <div class="conter"></div> </body> <script> let dataJsons = { "Code": 200, "Message": "成功", "Task": [ { "Name": "每周点检22.txt", "Areas": { "0": { "id": 6, "factory": "村田一厂", "building": "D栋", "floor": "2F", "area": "电气室", "point": "点位2", "inside": "内", "unit": "5s", "add_time": "2025-08-05T16:28:27", "card_id": "0423AA12361E90", "card_bind_time": "2025-08-06T15:09:24", "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null }, "1": { "id": 7, "factory": "村田一厂", "building": "D栋", "floor": "1F", "area": "电气室", "point": "点位2", "inside": "内", "unit": "5s", "add_time": "2025-08-05T16:43:38", "card_id": null, "card_bind_time": null, "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null }, "2": { "id": 8, "factory": "村田一厂", "building": "A栋", "floor": "1F", "area": "电气室", "point": "点位1", "inside": "内", "unit": "5s", "add_time": "2025-08-06T13:28:04", "card_id": null, "card_bind_time": null, "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null }, "3": { "id": 9, "factory": "村田一厂", "building": "A栋", "floor": "1F", "area": "电气室", "point": "点位3", "inside": "内", "unit": "5s", "add_time": "2025-08-06T13:28:42", "card_id": "0424AA12361E90", "card_bind_time": "2025-08-06T15:10:42", "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null }, "4": { "id": 10, "factory": "村田一厂", "building": "A栋", "floor": "1F", "area": "电气室", "point": "点位4", "inside": "内", "unit": "5s", "add_time": "2025-08-06T13:28:57", "card_id": null, "card_bind_time": null, "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null }, "5": { "id": 11, "factory": "村田一厂", "building": "A栋", "floor": "1F", "area": "电气室", "point": "点位2", "inside": "内", "unit": "6s", "add_time": "2025-08-06T13:29:37", "card_id": null, "card_bind_time": null, "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null } }, "Status": 1, "Type": 1, "GeneratedTime": "2025-09-22T12:29:23", "DownLoadTime": "2025-09-22T13:09:38.296506+08:00", "FinishTime": "0001-01-01T00:00:00" }, { "Name": "每日点检22.txt", "Areas": { "0": { "id": 2, "factory": "村田一厂", "building": "A栋", "floor": "2F", "area": "电气室", "point": "点位2", "inside": "内", "unit": "5s", "add_time": "2025-07-17T13:43:00", "card_id": "0424AA12361E90", "card_bind_time": "2025-09-05T16:02:11", "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null }, "1": { "id": 8, "factory": "村田一厂", "building": "A栋", "floor": "1F", "area": "电气室", "point": "点位1", "inside": "内", "unit": "5s", "add_time": "2025-08-06T13:28:04", "card_id": "042AAA12361E90", "card_bind_time": "2025-09-05T16:03:06", "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null }, "2": { "id": 4, "factory": "村田一厂", "building": "A栋", "floor": "1F", "area": "电气室", "point": "点位2", "inside": "内", "unit": "5s", "add_time": "2025-07-17T13:43:00", "card_id": "0428AA12361E90", "card_bind_time": "2025-09-05T16:02:41", "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null }, "3": { "id": 7, "factory": "村田一厂", "building": "D栋", "floor": "1F", "area": "电气室", "point": "点位2", "inside": "内", "unit": "5s", "add_time": "2025-08-05T16:43:38", "card_id": "0427AA12361E90", "card_bind_time": "2025-09-05T16:02:59", "newest_check_time": null, "newest_check_state": null, "newest_check_problem": null, "newest_check_photo": null, "description": null } }, "Status": 1, "Type": 0, "GeneratedTime": "2025-09-22T12:29:23", "DownLoadTime": "2025-09-22T13:09:38.296506+08:00", "FinishTime": "0001-01-01T00:00:00"}]} // 全局更新计数函数 function updateCounts() { $('.countJia').text(dataJsons.length); $('.countJan').text(dataJsonsErr.length); console.log("计数已更新", "未完成:" + dataJsons.length + " 已完成:" + dataJsonsErr.length); } function initPage() { // 添加底部导航栏 $(".conter").append( '<div class="fliale">' + '<button type="button" id="NotJob" class="active">未完成<span class="countJia">' + dataJsons.length + '</span></button>' + '<button type="button" id="GoodJob">已完成<span class="countJan">' + dataJsonsErr.length + '</span></button>' + '</div>' ); // 初始显示未完成页面 showUncompletedPage(); // 导航栏点击事件 $("#NotJob").on("click", function() { showUncompletedPage(); $(this).addClass("active"); $("#GoodJob").removeClass("active"); }); $("#GoodJob").on("click", function() { showCompletedPage(); $(this).addClass("active"); $("#NotJob").removeClass("active"); }); } function showUncompletedPage() { // 清除现有内容 $(".conter").find(".u2, .u3, .InputDatas, .u4Scoll, .BtnTR").remove(); // 添加上部用户信息 $(".conter").append( '<div class="u2">' + '<div class="u4">' + '<p class="p2">当前巡检员</p>' + '<p class="p4">' + JsonDataSt.user + '</p>' + '</div>' + '</div>' ); // 创建开始扫描按钮 createStartButton(); // 添加设备列表容器 $(".conter").append('<div class="u3" id="inputs-container"></div>'); // 填充设备列表 $.each(dataJsons, function(index, item) { // 处理card_id为null或空的情况 let cardIdValue = item.card_id; // 检查card_id是否为null、undefined或空字符串 if (cardIdValue === null || cardIdValue === undefined || cardIdValue === "") { cardIdValue = '1'; // 设置为默认值'1' } $("#inputs-container").append( '<div class="C1">' + '<p class="p1">' + item.building + '-' + item.floor + '-' + item.area + '-' + item.point + '-' + item.inside + '-' + item.unit +'</p>' + '<input id="'+ item.id +'" class="InpO" type="radio" name="device" value="' + cardIdValue + '" />' + '</div>' ); }); // 阻止radio默认行为 $('input[type="radio"]').on('click', function(event) { event.preventDefault(); $('input[type="radio"]').not(this).prop('checked', false); $(this).prop('checked', !$(this).prop('checked')); }); // 更新计数 updateCounts(); } function showCompletedPage() { // 清除现有内容 $(".conter").find(".u2, .u3, #start-scan-button, .InputDatas, .u4Scoll, .BtnTR").remove(); // 先删除所有可能存在的按钮 removeAllStartButtons(); // 添加搜索栏 $(".conter").append( '<div class="InputDatas">' + '<input class="AllDatas" id="searchInput" type="text" placeholder="输入搜索内容" value="" />' + '<span id="resultCount">' + dataJsonsErr.length + '项</span>' + '</div>' ); // 添加滚动区域 $(".conter").append( '<div class="u4Scoll" id="inputs-Scoll">' + '<div class="BDALL"></div>' + '</div>'); // 添加提交按钮 $(".conter").append('<button class="BtnTR">提交任务</button>'); // 填充已完成任务 $.each(dataJsonsErr, function(index, item) { let statusClass = item.status == "OK" ? "BDS_state" : "BDS_states"; let statusText = item.status == "OK" ? "正常" : "异常"; let msg = item.msg || "无"; $(".BDALL").append( '<div class="BDSS" id="'+ item.id +'">' + '<div class="' + statusClass + '" data-Text="' + statusText + '">' + statusText + '</div>' + '<div class="BDS_stateA">' + '<P class="BDS_ID">ID:' + item.cardid + '</P>' + '<p class="BDS_IDP">区域:' + item.pTagRedName + '</p>' + '<P class="BDS_time">时间:' + item.checkTime + '</P>' + '<div class="BDS_stateWhy">' + '<P class="BDS_decser">备注:</P>' + '<p class="BDS_decserTexts">' + msg + '</p>' + '</div>' + '</div>' + '</div>' ); }); // 搜索功能 $("#searchInput").on("input", function() { let searchText = $(this).val().toLowerCase(); let count = 0; $(".BDSS").each(function() { let text = $(this).text().toLowerCase(); if (text.indexOf(searchText) > -1) { $(this).show(); count++; } else { $(this).hide(); } }); $("#resultCount").text(count + "项"); }); } </script> </html>1.不改变页面布局得情况下优化界面。2.对datajson数据中的TASK:[{},{}]中的 {"Name": "每周点检22.txt","Areas": {}}{"Name": "每日点检22.txt","Areas": {},{更多...}}数据进行1.合并2.分类3.排序等。3.要给服务器后面或许会给客户端继续增加每月点检.txt或者每三个月点检.txt等系列数据留余地。
09-26
内容概要:本文围绕“基于数据驱动的 Koopman 算子的递归神经网络模型线性化,用于纳米定位系统的预测控制研究”展开,提出了一种结合Koopman算子理论与递归神经网络(RNN)的数据驱动建模方法,旨在对非线性纳米定位系统进行有效线性化建模,并实现高精度的模型预测控制(MPC)。该方法利用Koopman算子将非线性系统映射到高维线性空间,通过递归神经网络学习系统的动态演化规律,构建可解释性强、计算效率高的线性化模型,进而提升预测控制在复杂不确定性环境下的鲁棒性与跟踪精度。文中给出了完整的Matlab代码实现,涵盖数据预处理、网络训练、模型验证与MPC控制器设计等环节,具有较强的基于数据驱动的 Koopman 算子的递归神经网络模型线性化,用于纳米定位系统的预测控制研究(Matlab代码实现)可复现性和工程应用价值。; 适合人群:具备一定控制理论基础和Matlab编程能力的研究生、科研人员及自动化、精密仪器、机器人等方向的工程技术人员。; 使用场景及目标:①解决高精度纳米定位系统中非线性动态响应带来的控制难题;②实现复杂机电系统的数据驱动建模与预测控制一体化设计;③为非线性系统控制提供一种可替代传统机理建模的有效工具。; 阅读建议:建议结合提供的Matlab代码逐模块分析实现流程,重点关注Koopman观测矩阵构造、RNN网络结构设计与MPC控制器耦合机制,同时可通过替换实际系统数据进行迁移验证,深化对数据驱动控制方法的理解与应用能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值