题意

题解

一开始理解错题意了。以为这题不可解。。

其实这题当n>=3时都是无解的

然后n=1,2时的解都给出来了。

推荐一个博客的证明

 #include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
int n;
scanf("%d",&n);
if(n==){
printf("1\n1 1");
}
else if(n==){
printf("4\n1 1\n2 1\n2 2\n1 2");
}
else printf("-1");
return ;
}

luogu P2041 分裂游戏(结论题)的更多相关文章

  1. P2041 分裂游戏

    P2041 分裂游戏 手推$n=3$是无解的,推断$n>=3$是无解的 证明略,这是道结论题. #include<iostream> #include<cstdio> # ...

  2. 洛谷 P2041 分裂游戏 解题报告

    P2041 分裂游戏 题目描述 有一个无限大的棋盘,棋盘左下角有一个大小为 n 的阶梯形区域,其中最左下角的那个格子里有一枚棋子.你每次可以把一枚棋子"分裂"成两枚棋子,分别放在原 ...

  3. 【洛谷P2041 分裂游戏】数学+瞎蒙

    分析 我们推不出n=3的图,开始猜测,答案在n>2时无解.(<-正解) AC代码 #include <bits/stdc++.h> using namespace std; i ...

  4. [BZOJ3609][Heoi2014]人人尽说江南好 结论题

    Description 小 Z 是一个不折不扣的 ZRP(Zealot Round-game Player,回合制游戏狂热玩家), 最近他 想起了小时候在江南玩过的一个游戏.     在过去,人们是要 ...

  5. bzoj1188 [HNOI2007]分裂游戏 博弈论 sg函数的应用

    1188: [HNOI2007]分裂游戏 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 973  Solved: 599[Submit][Status ...

  6. [codevs5578][咸鱼]tarjan/结论题

    5578 咸鱼  时间限制: 1 s  空间限制: 128000 KB   题目描述 Description 在广袤的正方形土地上有n条水平的河流和m条垂直的河流,发达的咸鱼家族在m*n个河流交叉点都 ...

  7. bzoj 1188 [HNOI2007]分裂游戏(SG函数,博弈)

    1188: [HNOI2007]分裂游戏 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 733  Solved: 451[Submit][Status ...

  8. bzoj 1188 [HNOI2007]分裂游戏 SG函数 SG定理

    [HNOI2007]分裂游戏 Time Limit: 10 Sec  Memory Limit: 162 MBSubmit: 1394  Solved: 847[Submit][Status][Dis ...

  9. BZOJ_1367_[Baltic2004]sequence_结论题+可并堆

    BZOJ_1367_[Baltic2004]sequence_结论题+可并堆 Description Input Output 一个整数R Sample Input 7 9 4 8 20 14 15 ...

随机推荐

  1. easyUI在使用字符串拼接时样式不起作用,点击加号增加一行,点击减号删除一行效果。

    拼接的按钮没有样式,需要使用 var str = $("<a href='javascript:void(0)' class='easyui-linkbutton' onclick=' ...

  2. vue安装以及配置

    今天又重新做了一遍vue的安装步骤: 1.条件,vue需要安装在node环境里面,确保安装了node. 2.安装脚手架. 找一个文件夹,放你的项目.待会儿安装的时候,项目会在你找的这个文件下新增一个你 ...

  3. Is jQuery Still Relevant in 2018?

    DOM Selection $('.someclass') document.querySelector('.someclass') document.querySlectorAll('.somecl ...

  4. mysql linux查看配置文件my.cnf位置

    原文:mysql linux查看配置文件my.cnf位置 命令: mysql --help | grep 'Default options' -A 1

  5. Java并发和多线程2:3种方式实现数组求和

    本篇演示3个数组求和的例子. 例子1:单线程例子2:多线程,同步求和(如果没有计算完成,会阻塞)例子3:多线程,异步求和(先累加已经完成的计算结果) 例子1-代码 package cn.fansuni ...

  6. jvm 虚拟机参数_方法区内存分配

    1.方法区( 永久区 ) 和堆一样,方法区是一块所有线程共享的区域,他用于保存系统类的信息.默认情况下 -XX:MaxPermSize 为 64m.如果系统运行时产生大量的类,就需要设置一个合适方法区 ...

  7. 数据库-mongodb-聚合与map reduce

    分组统计:group() 简单聚合:aggregate() 强大统计:mapReduce() Group函数: 1.不支持集群.分片,无法分布式计算 2.需要手写聚合函数的业务逻辑 curr指当前行, ...

  8. [Angular] Handle HTTP Errors in Angular with HttpErrorResponse interface

    When communicating with some backend API, data travels over the network using the HTTP protocol. As ...

  9. selenium的报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class names not permitted

    报错信息:selenium.common.exceptions.InvalidSelectorException: Message: invalid selector: Compound class ...

  10. HDU 5616 Jam's balance 背包DP

    Jam's balance Problem Description Jim has a balance and N weights. (1≤N≤20)The balance can only tell ...