Codeforces Round #322 A Vasya the Hipster
题意:给出一个人蓝色袜子和红色袜子的数量、 出门穿一只蓝色一只红色就是时尚、否则为一般、 问:可以穿时尚和一般的天数各为多少、
思路:水题,直接模拟一次过、
AC代码:
#include<cstdio>
#include<cstring>int main()
{int a,b;int x,y;while(scanf("%d %d",&a,&b)!=EOF){x=y=0;if(a==0){printf("0 %d\n",b/2);}else if(b==0)printf("%0 %d\n",a/2);else{if(a>b)printf("%d %d\n",b,(a-b)/2);elseprintf("%d %d\n",a,(b-a)/2);}}return 0;
}
Codeforces Round #322 A Vasya the Hipster相关推荐
- Codeforces Round #322 (Div. 2) B. Luxurious Houses 水题
B. Luxurious Houses Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/581/pr ...
- cf Educational Codeforces Round 48 C. Vasya And The Mushrooms
原题: C. Vasya And The Mushrooms time limit per test2 seconds memory limit per test256 megabytes input ...
- Codeforces Round #322 B Luxurious Houses
题意: 给出你N个数,问你这个数想要比后面的数都大至少要加几? 思路: 有一点点考思路,从后向前找,依次找出最大值,直接比较就可以了,有一点点细节,就是要记录最大数和当前数的下标是否是同一位置,如果是 ...
- Educational Codeforces Round 48
Educational Codeforces Round 48 C.Vasya And The Mushrooms 思路很简单,走法有一个统一形式就是先上下走,然后到某个位置左右一个来回.然后就推一下 ...
- Vasya and Good Sequences (Codeforces Round #512) 后缀和
Vasya and Good Sequences (Codeforces Round #512) 后缀和 嘛,蒟蒻第一次写blog,也是第一次用c++好好写程序,多多关照吧 原题: Vasya可以将一 ...
- Educational Codeforces Round 54 (Rated for Div.2)
Educational Codeforces Round 54 (Rated for Div.2) D. Edge Deletion 题意:一张n个点的无向图,保留其中k条边,使得有尽可能多的点与1的 ...
- Codeforces Round #506 (Div. 3)
Codeforces Round #506 (Div. 3) 实习期间事不多,对div3 面向题解和数据编程了一波 A. Many Equal Substrings 题目链接 A题就是找后缀和前缀重合 ...
- Codeforces Round #417:E. FountainsSagheer and Apple Tree(树上博弈)
Codeforces Round #417:E. FountainsSagheer and Apple Tree(树上博弈) 标签: codeforces 2017-06-02 11:41 29人阅读 ...
- Codeforces Round #563 (Div. 2)/CF1174
Codeforces Round #563 (Div. 2)/CF1174 CF1174A Ehab Fails to Be Thanos 其实就是要\(\sum\limits_{i=1}^n a_i ...
- Codeforces Round #270
Codeforces Round #270 题目链接 A:我是筛了下素数.事实上偶数仅仅要输出4和x - 4,奇数输出9和x - 9就可以 B:贪心的策略,把时间排序后.取每k个的位置 C:贪心.每次 ...
最新文章
- 为什么阿里如此钟爱Flink?
- Spring @Transactional (一)
- 二值化处理c语言程序,数字信号处理c语言程序集
- java版mosquitto客户端使用SSL功能的具体操作总结
- 我的git仓库,顺记github配置
- 【Java 强化】单元测试(JUnit3、JUnit4)、XML(语法、约束、文档结构)、DOM、DOM4J
- NetCore EF Code Frist
- jquery ajax get 数组参数
- WiFi密码破解之Aircrack实战演示
- 明小子动力上传拿webshell.zip
- 常见字符与ASCII码值对照表
- SSD网络及代码理解
- 2021-08-26小白笔记
- 2018——而立之年
- ArcGIS Pro常见地图包系列--切片包(TPK)
- 1.1 wamp/wnmp 环境搭建
- 面试须知的前端渲染和后端渲染
- HTML免费在线文档批量翻译工具
- SCORM标准的LMS
- Android 11系列:权限适配