【构造】 Codeforces 476D Dreamoon and Sets
来源:互联网 发布:mariadb mysql 对比 编辑:程序博客网 时间:2024/06/05 19:12
题意:构造出N 组 每组四个数中两两的GCD为 M 并且要求其中最大的数最小
则构造出4个互质的数再乘上M 即可
因 3个连续的奇数之间互质
奇数开始的3个连续的数互质 所以从1开始 取三个连续的奇数和
x x+2 x+4 and x+1
#include <cstdio>#include <iostream>#include <algorithm>using namespace std;int main(){ int x,y; cin>>x>>y; int c=1; cout<<(5+(x-1)*6)*y<<endl; for(int i=0;i<x;i++) { printf("%d %d %d %d\n",c*y,(c+1)*y,(c+2)*y,(c+4)*y); c+=6; } return 0;}
0 0
- 【构造】 Codeforces 476D Dreamoon and Sets
- Codeforces 476D Dreamoon and Sets 规律+构造
- Codeforces 476D. Dreamoon and Sets
- 【codeforces】477B Dreamoon and Sets 构造
- codeforces 476D Dreamoon and Sets(数学)
- D. Dreamoon and Sets(Codeforces Round #272)
- D. Dreamoon and Sets(Codeforces Round #272)
- Dreamoon and Sets CodeForces
- Dreamoon and Sets CodeForces
- Dreamoon and Sets CodeForces
- Codeforces Round #272 (Div. 2) D Dreamoon and Sets(构造)
- CodeForces 477B-E - Dreamoon and Sets-构造规律题
- 【构造】【cf477B】Dreamoon and Sets
- 【CODEFORCES】 B. Dreamoon and Sets
- 477 B. Dreamoon and Sets
- Codeforces 476A. Dreamoon and Stairs
- Codeforces 476B. Dreamoon and WiFi
- Codeforces 476C. Dreamoon and Sums
- 番茄当下之作——莽荒纪
- 关于内存的一些问题
- c++函数参数类型-引用
- Qt-4.8 WebKit + QtWebKit-2.3.x上CSS3 Web Fonts支持的一些记录
- c单链表逆置
- 【构造】 Codeforces 476D Dreamoon and Sets
- 《算法竞赛入门经典(第2版)》代码 Chapter 2
- mount过程分析之三(do_mount -> do_new_mount)
- 静态库的生成
- 关于sda与hda
- HTML中实现两个列,每个列都固定宽度高度占满整个屏幕。如果内容多就出现滚动条!
- 热烈祝贺Polymer中文组织网站上线
- NYOJ正三角形外接圆面积
- 基于数据挖掘技术的客户关系管理系统设计与实现