764B未解决

本文介绍了一个简单的数组翻转算法实现,通过使用C语言标准库函数和条件判断来完成数组元素的翻转操作。该算法首先读取数组长度,然后根据数组长度的不同采用不同的翻转策略:当数组长度为4时,仅交换中间两个元素;对于长度大于4的数组,则根据索引的奇偶性选择性地进行元素交换。

感觉思路不错,

#include<stdio.h>
#include<cstring>
#include<cmath>
#include<algorithm>
#define BadBoy main()
#define ForMyLove return 0;
using namespace std;
const int MYDD = 1103 + 2*1e5;

int a[MYDD];

int BadBoy {
	int n;
	scanf("%d", &n);
	for(int j = 0; j < n; j++)
		scanf("%d", &a[j]);
		
	for(int j = 0; j < n/2; j++){
		swap(a[j], a[n-j+1]);
	}
	
	if(n == 4){
		swap(a[1], a[2]);
	} else if(n > 4){
		for(int j = 1; j < n/2; j++){
			if(j % 2) swap(a[j], a[n-j+1]);
 		}
	}
	
	for(int j = 0; j < n; j++)
		printf("%d ", a[j]);
	ForMyLove
}


读一下日志:.s.d.n.s.NotificationRuleServiceImpl.887: app:common notification type:Motion multiLanguage is true, right is false 10-30-2025 20:36:26.496 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:common notification type:Audio multiLanguage is true, right is false 10-30-2025 20:36:26.496 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:common notification type:Crying multiLanguage is true, right is false 10-30-2025 20:36:26.496 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:common notification type:BabyCry multiLanguage is true, right is false 10-30-2025 20:36:26.496 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:common notification type:PersonDetected multiLanguage is true, right is false 10-30-2025 20:36:26.496 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:common notification type:PersonEnhanced multiLanguage is true, right is false 10-30-2025 20:36:26.497 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:common notification type:tapoCameraSDNeedInitialization multiLanguage is true, right is false 10-30-2025 20:36:26.497 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:common notification type:tapoCameraSDInsufficientStorage multiLanguage is true, right is false 10-30-2025 20:36:26.497 DEBUG [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.i.g.m.d.i.NotificationRuleDAOImpl.249: pageFindNotificationRule, page:2, size:100 10-30-2025 20:36:26.524 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:omada notification type:omadaCBCLicenseInShortSupply multiLanguage is true, right is false app:taponotification type:Tapo.DeviceBatteryEmpty multiLanguage is error, right is false 10-30-2025 20:36:26.792 DEBUG [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.i.g.m.d.i.NotificationRuleDAOImpl.249: pageFindNotificationRule, page:7, size:100 10-30-2025 20:36:26.834 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.899: app:taponotification type:Tapo.LockKeypadLowTemperature multiLanguage is error, right is false 10-30-2025 20:36:26.836 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.899: app:taponotification type:Tapo.LockKeypadLowTemperatureAndLowBattery multiLanguage is error, right is false 10-30-2025 20:36:26.836 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:verification notification type:verification multiLanguage is true, right is false 10-30-2025 20:36:26.836 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:vigi notification type:common multiLanguage is true, right is false 10-30-2025 20:36:26.837 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.899: app:viginotification type:common multiLanguage is error, right is false 10-30-2025 20:36:26.837 DEBUG [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.i.g.m.d.i.NotificationRuleDAOImpl.249: pageFindNotificationRule, page:8, size:100 10-30-2025 20:36:26.882 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.887: app:vigi notification type:multiple multiLanguage is true, right is false 10-30-2025 20:36:26.882 ERROR [http-nio-8080-exec-4][TPLINK][TID: N/A][e0eb118fbc764a4a99097894c162023b] c.t.n.p.s.d.n.s.NotificationRuleServiceImpl.899: app:viginotification type:multiple multiLanguage is error, right is false
最新发布
10-31
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值