Codeforces Round #525 (Div. 2)A. Ehab and another construction problem
A. Ehab and another construction problem
题目链接:https://codeforc.es/contest/1088/problem/A
题意:
给出一个x,找出这样的a,b满足:1<=a,b<=x,并且a%b=0,a/b<x,a*b>x。
题解:
赛后发现,除开x=1的情况,其它情况a=b=x就可以满足条件了...
但还是附上比赛时候的代码吧...
#include <bits/stdc++.h>
using namespace std; int main(){
int x;
cin>>x;
for(int i=;i<=x;i++){
for(int j=;j<=i;j++){
if(i%j==){
if(i*j>x && i/j<x){
printf("%d %d",i,j);
return ;
}
}
}
}
cout<<"-1";
return ;
}
Codeforces Round #525 (Div. 2)A. Ehab and another construction problem的更多相关文章
- Codeforces Round #525 (Div. 2) F. Ehab and a weird weight formula
F. Ehab and a weird weight formula 题目链接:https://codeforces.com/contest/1088/problem/F 题意: 给出一颗点有权值的树 ...
- Codeforces Round #525 (Div. 2)E. Ehab and a component choosing problem
E. Ehab and a component choosing problem 题目链接:https://codeforces.com/contest/1088/problem/E 题意: 给出一个 ...
- Codeforces Round #525 (Div. 2)D. Ehab and another another xor problem
D. Ehab and another another xor problem 题目链接:https://codeforces.com/contest/1088/problem/D Descripti ...
- Codeforces Round #525 (Div. 2)B. Ehab and subtraction
B. Ehab and subtraction 题目链接:https://codeforc.es/contest/1088/problem/B 题意: 给出n个数,给出k次操作,然后每次操作把所有数减 ...
- Codeforces Round #525 (Div. 2) C. Ehab and a 2-operation task 数学 mod运算的性质
C. Ehab and a 2-operation task 数学 mod运算的性质 题意: 有两种对前缀的运算 1.对前缀每一个\(a +x\) 2.对前缀每一个\(a\mod(x)\) 其中x任选 ...
- Codeforces Round #525 (Div. 2) D. Ehab and another another xor problem(待完成)
参考资料: [1]:https://blog.csdn.net/weixin_43790474/article/details/84815383 [2]:http://www.cnblogs.com/ ...
- Codeforces Round #525 (Div. 2) C. Ehab and a 2-operation task
传送门 https://www.cnblogs.com/violet-acmer/p/10068786.html 题意: 给定一个长度为 n 的数组a[ ],并且有两种操作: ①将前 i 个数全都加上 ...
- Codeforces Round #525 (Div. 2) E. Ehab and a component choosing problem 数学
题意:给出树 求最大的sigma(a)/k k是选取的联通快个数 联通快不相交 思路: 这题和1个序列求最大的连续a 的平均值 这里先要满足最大平均值 而首先要满足最大 也就是一个数的时候可 ...
- Codeforces Round #525 (Div. 2) D. Ehab and another another xor problem(交互题 异或)
题目 题意: 0≤a,b<2^30, 最多猜62次. 交互题,题目设定好a,b的值,要你去猜.要你通过输入 c d : 如果 a^c < b^d ,会反馈 -1 : 如果 a^c = b^ ...
随机推荐
- python三大神器之迭代器
可迭代协议: 内部含有__iter__方法的值/变量都是可迭代的.可迭代类型和python语言之间的协议. 可迭代对象: iterable,内部包含__iter__()函数. 迭代器: iterato ...
- 第一天的题目 简单A+B 植树问题 多项式的值
#include<stdio.h> int main() { int a=0;b=0; scanf("%d%d",&a,&b); printf(&quo ...
- go执行外部应用
go执行外部应用 最近想将原来用asp.net mvc写的一个公司内部网站改用beego来写,但发现其中有一个功能是,能将加密的sqlite文件进行解密,因为这个解密是不能公开的,但有些同事需要查看这 ...
- 牛客网暑期ACM多校训练营(第四场) F
参考:http://www.cnblogs.com/Jadon97/p/9383027.html #include <iostream> #include <cstdio> # ...
- T分布、卡方分布、F分布
请参考: https://www.cnblogs.com/think-and-do/p/6509239.html
- Linux 下 PHP 扩展 PDO 编译安装
1.进入 PHP 的软件包 pdo 扩展目录中(注:不是 PHP 安装目录) [root@tester /]# /home/tdweb/php-5.4.34/ext/pdo_mysql 执行 phpi ...
- xamdin: 添加小组件报错: render() got an unexpected keyword argument 'renderer'
查找到 xadmin里面的 dashboard.py文件内render方法,增加一个rdnderer默认参数是None一般路径在 本机虚拟环境\Lib\site-packages\xadmin\vie ...
- Java进阶知识点1:白捡的扩展性 - 枚举值也是对象
一.背景 枚举经常被大家用来储存一组有限个数的候选常量.比如下面定义了一组常见数据库类型: public enum DatabaseType { MYSQL, ORACLE, SQLSERVER } ...
- Leetcode 674.最长递增序列
最长递增序列 给定一个未经排序的整数数组,找到最长且连续的的递增序列. 示例 1: 输入: [1,3,5,4,7] 输出: 3 解释: 最长连续递增序列是 [1,3,5], 长度为3. 尽管 [1,3 ...
- SPOJ 375 Query on a tree(树链剖分)(QTREE)
You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, ...