这个题目还是很简单的,很明显是一个构造题,但是早训的时候脑子有点糊涂,想到了用1 2 来构造,

但是去算这个数的时候算错了。。。

用1 2 来构造

可以先枚举一些数来找找规律。

1 1

2 2

3 1 1 1    2 1 1

4 ....

可以发现每一个数都是 n/2+1 的可能,

所以反过来推过去就是 (s-1)*2  或者(s-1)*2+1

这个(s-1)*2+1的答案才是正确答案 因为 这个s可以==1

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <iostream>
#include <string>
#define inf 0x3f3f3f3f
#define inf64 0x3f3f3f3f3f3f3f3f
using namespace std;
const int maxn = 1e5 + ;
typedef long long ll; int main()
{
int n;
scanf("%d", &n);
printf("%d 2\n", (n - ) * + );
printf("1 2\n");
return ;
}

最新文章

  1. 使用composer安装项目依赖
  2. ***CI新增记录成功后的返回值判断,是用isset还是empty
  3. Java遇见HTML——JSP篇之JSP基础语法
  4. iOS - (两个APP之间的跳转)
  5. 动画Animation
  6. hdu3555 Bomb 数位DP入门
  7. Java设计模式之(一)------单例模式
  8. 初识 .net core和vs code
  9. Making every developer more productive with Visual Studio 2019
  10. LeetCode算法题-Count Primes(Java实现)
  11. 自定义admin(self_admin)
  12. 嵌入式linux系统中,lsusb出现unable to initialize libusb: -99 解决办法 【转】
  13. 使用 IntraWeb (31) - IntraWeb 的 Xml 操作使用的是 NativeXml
  14. aop编程之前置通知
  15. MyBatis 多表查询
  16. [UE4]Text Block文字字体偏移
  17. 数据库操作类《SqlHelper》
  18. Building a Space Station---poj2031(最小生成树)
  19. [ucgui] 仪表盘函数
  20. windows下npm安装vue

热门文章

  1. Mysql基础知识一
  2. 【three.js第七课】鼠标点击事件和键盘按键事件的使用
  3. stand up meeting 12/4/2015 -12/6/2015
  4. . Number throry
  5. tensorflow基础--LeNet-5测试模型遇到TypeError: Failed to convert object of type &lt;class &#39;list&#39;&gt; to Tensor
  6. C++枚举算法
  7. powershell提示无法将“”项识别
  8. Blazor WebAssembly 3.2.0 已在塔架就位 将发射新一代前端SPA框架
  9. Spring5:概念
  10. 解决IE升级后必须以管理员运行的问题