Gym
来源:互联网 发布:上瘾网络剧美拍 编辑:程序博客网 时间:2024/06/03 16:32
传送门
#include <vector>#include <iostream>#include <string>#include <map>#include <stack>#include <cstring>#include <queue>#include <list>#include <cstdio>#include <set>#include <algorithm>#include <cstdlib>#include <cmath>#include <iomanip>#include <cctype>#include <sstream>#include <functional>using namespace std;#define pi acos(-1)#define endl '\n'#define rand() srand(time(0));#define me(x) memset(x,0,sizeof(x));#define foreach(it,a) for(__typeof((a).begin()) it=(a).begin();it!=(a).end();it++)#define close() ios::sync_with_stdio(0);typedef long long LL;const int INF=0x3f3f3f3f;const LL LINF=0x3f3f3f3f3f3f3f3fLL;//const int dx[]={-1,0,1,0,-1,-1,1,1};//const int dy[]={0,1,0,-1,1,-1,1,-1};const int maxn=1e3+5;const int maxx=200020;const double EPS=1e-7;const int MOD=1000000007;#define mod(x) ((x)%MOD);template<class T>inline T min(T a,T b,T c) { return min(min(a,b),c);}template<class T>inline T max(T a,T b,T c) { return max(max(a,b),c);}template<class T>inline T min(T a,T b,T c,T d) { return min(min(a,b),min(c,d));}template<class T>inline T max(T a,T b,T c,T d) { return max(max(a,b),max(c,d));}//typedef tree<pt,null_type,less< pt >,rb_tree_tag,tree_order_statistics_node_update> rbtree;/*lch[root] = build(L1,p-1,L2+1,L2+cnt); rch[root] = build(p+1,R1,L2+cnt+1,R2);中前*//*lch[root] = build(L1,p-1,L2,L2+cnt-1); rch[root] = build(p+1,R1,L2+cnt,R2-1);中后*/long long gcd(long long a , long long b){if(b==0) return a;a%=b;return gcd(b,a);}int p,q;vector<int >G[maxx];int main(){ freopen("drunkard.in","r",stdin); freopen("drunkard.out","w",stdout); while(cin>>p>>q,p) { int n=q+1; for(int i=1;i<=n;i++) G[i].clear(); vector<int >ans; ans.push_back(n-1);//最左边 int t=q-p+1;//右边距离 p点位置 int now=1; for(int i=2;i<t;i++) ans.push_back(++now); ans.push_back(1); for(int i=t+1;i<n;i++) ans.push_back(++now); ans.push_back(n); for(int i=1;i+1<ans.size();i++) { G[ans[i]].push_back(ans[i-1]); G[ans[i]].push_back(ans[i+1]); } cout<<n<<endl; for(int i=1;i<n-1;i++) cout<<G[i][0]<<" "<<G[i][1]<<endl; }}
0 0
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- Gym
- 安卓获取渠道名渠道id Android获取设备唯一标识的终极解决方法,防止安卓7.0时崩溃问题
- <Effective Mordern C++>笔记:Item 2:Understand auto type deduction.
- 把字节流转化成字符流的工具类
- 机器学习笔记(1)-分析框架-以Kaggle Titanic问题为例
- linux 计划任务备份数据库
- Gym
- JDBC
- 数据库连接池(二)
- MongoDB入门(1)--搭建并连接服务器
- 算法作业_19(2017.5.3第十一周)
- hdu 5706 GirlCat(DFS)
- 知识汇总都在这里啦!
- Python命令还使用tab键自动补全和xshell不能使用删除键
- MySql存储过程