【HDU】1850 Being a Good Boy in Spring Festival
Spring in HDU being Good
2023-09-27 14:22:21 时间
http://acm.hdu.edu.cn/showproblem.php?pid=1850
题意:同nim...顺便求方案数...
#include <cstdio> #include <cstring> using namespace std; int a[105]; int main() { int n; while(scanf("%d", &n), n) { int ans=0, t, as=0; for(int i=0; i<n; ++i) { scanf("%d", &a[i]); ans^=a[i]; } for(int i=0; i<n; ++i) { t=ans^a[i]; if(t<a[i]) ++as; } printf("%d\n", as); } return 0; }
由于每次取一堆的...由sg的性质及博弈论的性质...整个局面的sg和 xor 当前堆的sg后,只需要知道得到的局面sg和能否由当前堆的i副牌变成游戏和为0即可,即必胜态转移到必败态,即sg=0。。
好像到cf的手速啊= =
相关文章
- Spring JDBC中NamedParameterJdbcTemplate的使用,包括in的用法
- spring发送邮件(多人接收或抄送多少带附件发送)
- 中秋快乐,分享福利脑图:入门spring cloud
- Spring的任务调度@Scheduled注解——task:scheduler和task:executor的解析
- mybatis实战教程(mybatis in action)之六:与Spring MVC 的集成
- spring
- spring security的原理及教程
- Spring Cloud ZooKeeper集成Feign的坑2,服务调用了一次后第二次调用就变成了500,错误:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.n
- Spring Boot自动配置原理(转)
- 【Spring】Spring系列4之Spring支持JDBC
- Distributed transactions in Spring, with and without XA
- spring.jpa.open-in-view,hibernate.enable_lazy_load_no_trans与no session的关系
- Spring的@ControllerAdvice注解作用原理探究
- java spring-boot使用tomcat镜像部署报错Name [handlerExceptionResolver] is not bound in this Context.
- 一天十道Java面试题----第五天(spring的事务传播机制------>mybatis的优缺点)
- 记录:Spring Boot 报错:Web server failed to start. Port 8081 was already in use.
- 问题排查之'org.apache.rocketmq.spring.starter.core.RocketMQTemplate' that could not be found.- Bean method 'rocketMQTemplate' in 'RocketMQAutoConfiguration' not loaded.
- spring定时任务轮询(spring Task)
- Servlet/Tomcat/ Spring 之间的关系