A. Vasya the Hipster

Time Limit: 1 Sec

Memory Limit: 256 MB

题目连接

http://codeforces.com/contest/581/problem/A

Description

One day Vasya the Hipster decided to count how many socks he had. It turned out that he had a red socks and b blue socks.

According to the latest fashion, hipsters should wear the socks of different colors: a red one on the left foot, a blue one on the right foot.

Every day Vasya puts on new socks in the morning and throws them away before going to bed as he doesn't want to wash them.

Vasya wonders, what is the maximum number of days when he can dress fashionable and wear different socks, and after that, for how many days he can then wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

Can you help him?

Input

The single line of the input contains two positive integers a and b (1 ≤ a, b ≤ 100) — the number of red and blue socks that Vasya's got.

Output

Print two space-separated integers — the maximum number of days when Vasya can wear different socks and the number of days when he can wear the same socks until he either runs out of socks or cannot make a single pair from the socks he's got.

Keep in mind that at the end of the day Vasya throws away the socks that he's been wearing on that day.

Sample Input

3 1

Sample Output

1 1

HINT

题意

一个人有a个红袜子,b个蓝袜子,问他最多一只脚穿红一只脚穿蓝能穿多少天

并且之后还能穿多少天,他不想洗袜子,穿完就会扔啦

题解:

水题啦

代码:

//qscqesze
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <bitset>
#include <vector>
#include <sstream>
#include <queue>
#include <typeinfo>
#include <fstream>
#include <map>
#include <stack>
typedef long long ll;
using namespace std;
//freopen("D.in","r",stdin);
//freopen("D.out","w",stdout);
#define sspeed ios_base::sync_with_stdio(0);cin.tie(0)
#define maxn 1205000
#define mod 1000000007
#define eps 1e-9
#define e exp(1.0)
#define PI acos(-1)
#define lowbit(x) (x)&(-x)
const double EP  = 1E-10 ;
int Num;
//const int inf=0x7fffffff;
const ll inf=999999999;
inline ll read()
{ll x=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}return x*f;
}
//*************************************************************************************int main()
{int a=read(),b=read();cout<<min(a,b)<<" "<<abs(a-b)/2<<endl;
}

转载于:https://www.cnblogs.com/qscqesze/p/4845054.html

Codeforces Round #322 (Div. 2) A. Vasya the Hipster 水题相关推荐

  1. Codeforces Round #370 (Div. 2) A. Memory and Crow 水题

    A. Memory and Crow 题目连接: http://codeforces.com/contest/712/problem/A Description There are n integer ...

  2. Codeforces Round #311 (Div. 2) A. Ilya and Diplomas 水题

    A. Ilya and Diplomas Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/ ...

  3. Codeforces Round #394 (Div. 2) A. Dasha and Stairs 水题

    A. Dasha and Stairs 题目连接: http://codeforces.com/contest/761/problem/A Description On her way to prog ...

  4. Codeforces Round #404 (Div. 2) B. Anton and Classes 水题

    B. Anton and Classes 题目连接: http://codeforces.com/contest/785/problem/B Description Anton likes to pl ...

  5. Codeforces Round #374 (Div. 2) A. One-dimensional Japanese Crosswor 水题

    A. One-dimensional Japanese Crossword 题目连接: http://codeforces.com/contest/721/problem/A Description ...

  6. Codeforces Round #358 (Div. 2) A. Alyona and Numbers 水题

    A. Alyona and Numbers 题目连接: http://www.codeforces.com/contest/682/problem/A Description After finish ...

  7. Codeforces Round #307 (Div. 2) A. GukiZ and Contest 水题

    A. GukiZ and Contest Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/551/ ...

  8. Codeforces Round #311 (Div. 2)B. Pasha and Tea 水题

    B. Pasha and Tea Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/prob ...

  9. Codeforces Round #350 (Div. 2) B. Game of Robots 水题

    B. Game of Robots 题目连接: http://www.codeforces.com/contest/670/problem/B Description In late autumn e ...

  10. Codeforces Round #379 (Div. 2) A. Anton and Danik 水题

    A. Anton and Danik 题目连接: http://codeforces.com/contest/734/problem/A Description Anton likes to play ...

最新文章

  1. extern C __declspec(dllexport) __declspec(dllimport) 和 def
  2. Outlook 2010 配置关联QQ邮箱
  3. net以execl做数据库_[原创]Net实现Excel导入导出到数据库(附源码)
  4. oracle过程包保存乱码_这些火遍网络的哆啦A梦表情包,你知道出处吗?
  5. Java中获取request对象的几种方法
  6. ILSpy-Reflexil修改UnityEditor.Timeline.dll
  7. java web对cpu要求_java web服务器cpu占用过高 (转载)
  8. 分享一下苹果手机绕激活锁的体验
  9. 美观!!大气!!! LVGL『Color picker颜色选择器控件』介绍
  10. Vue表情包输入组件
  11. linux电子数码相册实验报告,电子相册实训报告.docx
  12. Unity敌人的AI
  13. 认识计算机拓扑结构图,认识计算机网络拓扑结构
  14. V神发布ETH2.0信标链首个硬分叉提案HF1,引入更公平的节点惩罚机制
  15. pandas如何将两个表根据某个数组合并
  16. $(div /)代表的意思
  17. 影视剧作中的经典桥段部分
  18. 我所知道的中国NLP「破圈」十年
  19. VR系列--VR介绍
  20. 【PTA】帅到没朋友(C语言)

热门文章

  1. 通过Fildder下载百度音乐里的收费歌曲
  2. 从周易六十四卦看软件架构真好懂!女朋友这下不用担心我的学习了【程序员编程】
  3. 实现基于小米的电子商务平台架构
  4. 【javaWeb微服务架构项目——乐优商城day14】——购物车(实现未登录状态的购物车,实现登陆状态下的购物车,实现未登录状态的购物车合并到登录状态)
  5. typecho添加html5视频播放器,Typecho音乐播放器插件AudioPlayer1.2.6更新
  6. console口 - 配置口
  7. 把酒言欢话聊天,基于Vue3.0+Tornado6.1+Redis发布订阅(pubsub)模式打造异步非阻塞(aioredis)实时(websocket)通信聊天系统
  8. python里value是什么意思_关于Python 字典里的value
  9. 世界上第一次网络瘫痪 | 历史上的今天
  10. java毕业设计选题基于JavaWeb实现疫情环境下校园宿舍|寝室管理系统