*【CodeForces - 1047A】Little C Loves 3 I (水题,构造,三元组问题)
题干:
Little C loves number «3» very much. He loves all things about it.
Now he has a positive integer nn. He wants to split nn into 33 positive integers a,b,ca,b,c, such that a+b+c=na+b+c=n and none of the 33 integers is a multiple of 33. Help him to find a solution.
Input
A single line containing one integer nn (3≤n≤1093≤n≤109) — the integer Little C has.
Output
Print 33 positive integers a,b,ca,b,c in a single line, such that a+b+c=na+b+c=n and none of them is a multiple of 33.
It can be proved that there is at least one solution. If there are multiple solutions, print any of them.
Examples
Input
3
Output
1 1 1
Input
233
Output
77 77 79
解题报告:
还有一个后续题目,是关于曼哈顿距离的,暂时还没学,题解先放着 我是题解
这道题就比较水了啊,属于三元组但是却不需要这么分析,因为n太大了,1e9,所以考虑构造。
其实也比较好构造啊,,比较容易满足题意。
#include<bits/stdc++.h>using namespace std;int main()
{int n;int a,b,c;cin>>n;if(n%3==0) {a=1;b=1;c=n-a-b;}else {a=1,b=2;c=n-a-b;}printf("%d %d %d\n",a,b,c);return 0;
}
AC代码:
*【CodeForces - 1047A】Little C Loves 3 I (水题,构造,三元组问题)相关推荐
- CodeForces Canada Cup 2016 A、B水题 _(:з」∠)_
哭哭哭哭哭哭哭 又降了4...... 这次吸取的教训是...本来就是个做题慢的傻逼....一定要准时题目一开就开始做.....不然就等着降名次吧,..... 开始四十多分钟才开进去的.....再给我四 ...
- Educational Codeforces Round 12 A. Buses Between Cities 水题
A. Buses Between Cities 题目连接: http://www.codeforces.com/contest/665/problem/A Description Buses run ...
- Codeforces Round #499 (Div. 2) Problem-A-Stages(水题纠错)
CF链接 http://codeforces.com/contest/1011/problem/A Natasha is going to fly to Mars. She needs to bui ...
- 【 CodeForces - 864B】Polycarp and Letters(水题,字符串,有坑)
题干: Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string sconsisting o ...
- CodeForces - 1228B Filling the Grid(思维,水题)
题目链接:点击查看 题目大意:给出一个n*m的矩阵,每个格子可以涂成黑色或白色,再给出n个数a[i]以及m个数b[i],a[i]表示第i行前a[i]个格子都是黑色的,第a[i]+1个数是白色的,其余的 ...
- CodeForces - 670C Cinema(离散化+排序/map,水题)
题目链接:点击查看 题目大意:有m部正在上映的电影,每部电影的语音和字幕都采用不同的语言,用一个int范围内的整数来表示语言.有n个人相约在一起去看其中一部电影,每个人只会一种语言,如果一个人能听懂电 ...
- CodeForces 931C Laboratory Work 水题,构造
*这种题好像不用写题解... 题意: 一个人要改动别人的实验记录,实验记录记录是一个集合 实验记录本身满足:$max(X)-min(X)<=2$ 改动结果要求: 1.新的集合平均值和之前的一样 ...
- 【CodeForces - 922B 】Magic Forest (数学,异或,暴力,水题,三元组问题)
题干: Imp is in a magic forest, where xorangles grow (wut?) A xorangle of order n is such a non-degene ...
- 【CodeForces - 255A】Greg's Workout (水题)
题干: Greg is a beginner bodybuilder. Today the gym coach gave him the training plan. All it had was n ...
- 【CodeForces - 334B】Eight Point Sets(水题模拟,有坑)
题干: Gerald is very particular to eight point sets. He thinks that any decent eight point set must co ...
最新文章
- 东方通 中间件_东方通:中间件国产替代进程中的艰难领军者
- 君士坦丁堡分叉引起的安全问题
- mysql事务提交模式
- 线性表及其逻辑和存储结构(二级)
- 从XML文件读取数据绑定到列表控件2
- 【渝粤教育】国家开放大学2019年春季 1018国际公法 参考试题
- 使用HanLP增强Elasticsearch分词功能
- mysql原生库_Mysql数据库的一些简单原生sql语句
- mysql 字段等于select_mysql_select_计算字段_数据处理函数_5
- 排序算法之----快速排序(快速上手快速排序)
- 内向的性格对我人生的影响
- Dom4j解析Xml文件,Dom4j创建Xml文件
- php fetch mode,odbc_fetch_into
- 离线安装gcc(CentOS7)
- 【板绘必读】完全0基础如何学板绘?
- 【编程实践】复杂网络的基本知识及实现
- NAACL 2022 | TAMT:通过下游任务无关掩码训练搜索可迁移的BERT子网络
- 什么是存储器?存储器可分为哪三类?
- 修改记录-优化后(springboot+shiro+session+redis+ngnix共享)
- 解决 QGC地面站 ( QGroundControl )停止工作-由于win7 ghost精简缺少语音包
热门文章
- POJ-2773 欧几里得 + 二分 + 容斥
- 隐藏该监视器无法显示模式_【春星开讲 | 9137】达芬奇4K调色监看的好伙伴——明基PD2720U专业显示器...
- ext4fs error mysql_请教一个 Linux 挂在磁盘阵列报错 EXT4-fs error 问题
- 1003 我要通过! (20 分)
- selenium禁止弹窗_python:使用带有selenium的firefox时禁用下载弹出窗口
- C#中变量(成员变量、局部变量、全局变量)的作用域
- android handle 阻塞,Android全面解析之Handler机制:常见问题汇总
- python3.6生成exe_Python 3.6打包成EXE可执行程序的实现
- am335x otg-usb
- Linux内核的中断机制