XMUT 1109 高智商的游戏

          

        


       比赛结束问马ZJ时,他说是博弈论中的Nim问题。今天百度一下,一大堆文字的,我也没认真看,就看懂了跟异域运算有关……不过结论挺简单的,写了下代码,竟然这么简单就AC了!好吧,我彻底无语了。看来是我做题太少,或者说没有系统的去学习算法的原因吧,不然这种题第一次做算难题,以后看到,根本就是水题。

#include <iostream>
using namespace std;

int main()
{
	int i, N, ans, t;
	cin >> N >> ans;
	for (i=1; i<N; i++) cin >> t, ans ^= t;
	if (ans) cout << "YES\n";
	else cout << "NO\n";
	return 0;
}


package sfw.xmut.guomao.aspect; import sfw.xmut.guomao.entity.OperationLog; import sfw.xmut.guomao.mapper.OperationLogMapper; import sfw.xmut.guomao.utils.ServletUtil; import jakarta.servlet.http.HttpServletRequest; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; import java.time.LocalDateTime; @Aspect @Component public class OperationLogAspect { private final OperationLogMapper logMapper; public OperationLogAspect(OperationLogMapper logMapper) { this.logMapper = logMapper; } @Around("execution(* sfw.xmut.guomao.controller.*.*(..))") public Object around(ProceedingJoinPoint joinPoint) throws Throwable { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); HttpServletRequest request = attributes.getRequest(); if (request.getRequestURI().endsWith("/operationLog/page")) { return joinPoint.proceed(); } long startTime = System.currentTimeMillis(); Object result = joinPoint.proceed(); long spendTime = System.currentTimeMillis() - startTime; OperationLog log = new OperationLog(); log.setUserName("admin"); // TODO: Get from JWT token log.setOperationType(request.getRequestURI()); log.setOperationMethod(request.getMethod()); log.setRequestUrl(request.getRequestURL().toString()); log.setOperationIp(ServletUtil.getClientIP(request)); log.setOperationStatus("成功"); log.setLastOperationTime(LocalDateTime.now()); logMapper.insert(log); return result; } }log.setUserName("admin"); // TODO: Get from JWT token 这一行代码怎么把他改成不管哪个用户登录这个管理系统日志上面都可以更新,不要像这个admin锁住固定住不管谁登录都是显示他的名称
最新发布
06-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值