codeforces 805A     http://codeforces.com/problemset/problem/805/A

/*
题意:输入两个整数l,r,让你找一个因子
使得[l,r]里面所有的数,能整除这个因子的数最多,输出这个因子
如果答案有多个,输出任意一个
*/
#include<iostream>
#include<cstdio>
#include<cstring> using namespace std; int l,r,cnt1,cnt2; int main()
{
scanf("%d%d",&l,&r);
if(l!=r) printf("2\n");
else printf("%d\n",l);
return ;
}

难度系数:0.1

codeforces 804E     http://codeforces.com/problemset/problem/804/E    (数学构造)

/*
题意:给出一个1到n的排列,问每两个位置都进行一次交换最终排列不变是否可能,
如果可能输出交换顺序。 表示并不会,看了题解后还是一知半解,代码实现也是不懂...
好吧我智商低,太弱了
大概就是4的倍数一定行,模4余1一定行(以为4一定行,第五个数跟每个都换一遍貌似也行)
反正好神奇,好扯淡...
*/
#include <bits/stdc++.h>
#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define fill( x, y ) memset( x, y, sizeof x )
#define copy( x, y ) memcpy( x, y, sizeof x )
using namespace std; typedef long long LL;
typedef pair < int, int > pa; inline int init()
{
int sc = , f = ; char ch = getchar();
while( ch < '' || ch > '' ) { if( ch == '-' ) f = -; ch = getchar(); }
while( ch >= '' && ch <= '' ) sc = sc * + ch - '', ch = getchar();
return sc * f;
} int main()
{
int n = init();
if( n % > ) return puts( "NO" ), ;
puts( "YES" );
for( int i = n % ; i < n ; i += )
{
for( int j = ; j < i ; j++ ) printf( "%d %d\n", j + , i + );
printf( "%d %d\n", i + , i + );
for( int j = i - ; ~j ; j-- ) printf( "%d %d\n", j + , i + );
for( int j = ; j < i ; j++ ) printf( "%d %d\n", j + , i + );
printf( "%d %d\n", i + , i + );
for( int j = i - ; ~j ; j-- ) printf( "%d %d\n", j + , i + );
printf( "%d %d\n", i + , i + );
printf( "%d %d\n", i + , i + );
printf( "%d %d\n", i + , i + );
printf( "%d %d\n", i + , i + );
}
}

我不会...

codeforces——数学的更多相关文章

  1. Codeforces Round #284 (Div. 2)A B C 模拟 数学

    A. Watching a movie time limit per test 1 second memory limit per test 256 megabytes input standard ...

  2. Codeforces Bubble Cup 8 - Finals [Online Mirror]H. Bots 数学

    H. Bots Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/575/problem/H Desc ...

  3. Codeforces 715A & 716C Plus and Square Root【数学规律】 (Codeforces Round #372 (Div. 2))

    C. Plus and Square Root time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  4. 【数学】Codeforces 707C Pythagorean Triples

    题目链接: http://codeforces.com/problemset/problem/707/C 题目大意: 给你一个数,构造其余两个勾股数.任意一组答案即可,没法构造输出-1. 答案long ...

  5. 【数学相关、规律】Codeforces 696B Puzzles

    题目链接: http://codeforces.com/problemset/problem/696/B 题目大意: 给一棵树,从根节点开始递归,time=1,每次递归等概率随机访问这个节点的子节点, ...

  6. codeforces#253 D - Andrey and Problem里的数学知识

    这道题是这种,给主人公一堆事件的成功概率,他仅仅想恰好成功一件. 于是,问题来了,他要选择哪些事件去做,才干使他的想法实现的概率最大. 我的第一个想法是枚举,枚举的话我想到用dfs,但是认为太麻烦. ...

  7. Codeforces 1091D New Year and the Permutation Concatenation 找规律,数学 B

    Codeforces 1091D New Year and the Permutation Concatenation https://codeforces.com/contest/1091/prob ...

  8. Codeforces Beta Round #97 (Div. 1) C. Zero-One 数学

    C. Zero-One 题目连接: http://codeforces.com/contest/135/problem/C Description Little Petya very much lik ...

  9. 贪心/数学 Codeforces Round #212 (Div. 2) A. Two Semiknights Meet

    题目传送门 /* 贪心/数学:还以为是BFS,其实x1 + 4 * k = x2, y1 + 4 * l = y2 */ #include <cstdio> #include <al ...

随机推荐

  1. Re0:DP学习之路 Proud Merchants HDU - 3466

    解法 排序+01背包 这里的排序规则用q-p升序排列这里是一个感觉是一个贪心的策略,为什么这样做目前也无法有效的证明或者说出来 然后就是01背包加了一个体积必须大于什么值可以装那么加一个max(p,q ...

  2. 基于虚拟机的centos6.5 搭建本地光盘yum源

    在线yum安装必须要保持服务器能够连入网络并且他下载的还会比较慢因为地址大部分多是国外的下载站.另外yum在线下载的都是比较新的软件包,可能不是很稳定,那么使用yum的本地资源就是光盘里的RPM包,让 ...

  3. https://blog.csdn.net/zhi_sheng/article/details/78910082----mybatis写当天 当月的数据 时间段数据

    https://blog.csdn.net/zhi_sheng/article/details/78910082---- mybatis写当天 当月的数据 时间段数据

  4. MaxScale初探

    原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://mrcto.blog.51cto.com/1923168/1437287 内容预览 ...

  5. noip模拟赛 whzzt-Conscience

    分析:数据中并不存在无解的情况...... 每个摄像头都要覆盖尽可能多的点,按照y从小到大排序.对于每一列,只用判断第一个没有被观测到的就可以了,这个点必须要放摄像头,因为除了它自己没有其它的摄像头能 ...

  6. CF899F. Letters Removing

    给一个字符串支持以下操作:区间删除某个特定字符.最后输出字符串.n,m<=200000. 这题我居然不会可以回家了.. 首先,单点删除,选个平衡树比如set. 然后,他给的下标是会随删除操作变化 ...

  7. C. Hexadecimal's Numbers

    C. Hexadecimal's Numbers time limit per test 1 second memory limit per test 64 megabytes input stand ...

  8. WCF 配置文件中的MaxStringContentLength & MaxReceivedMessageSize

    中午测试员在测试系统模块时发现无法通过WCF从服务器下载数据,检查配置文件后,建议开发人员修改站点的WEB.CONFIG文件,具体修改对比如下: 旧的: <binding name=" ...

  9. J2EE基础总结(5)——EJB

    什么是EJB     JB事实上就是企业Java Beans. EJB是J2EE平台的重要组成部分. J2EE平台基于组件的企业级应用架构,提供多 层次.分布式和高事务的功能特点.     EJB提供 ...

  10. 【原创】分布式之缓存击穿 【原创】自己动手实现静态资源服务器 【原创】自己动手实现JDK动态代理

    [原创]分布式之缓存击穿   什么是缓存击穿 在谈论缓存击穿之前,我们先来回忆下从缓存中加载数据的逻辑,如下图所示 因此,如果黑客每次故意查询一个在缓存内必然不存在的数据,导致每次请求都要去存储层去查 ...