Kattis - abc 【水】
题意
给出三个数,然后给出一个顺序,有ABC三个字母构成,
A是最大的数字
B是中间的数字
C是最小的数字
根据 ABC的顺序 给出 数字的顺序
思路
先排序一下,然后用 MAP 双向标记一下
AC代码
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <set>
#include <numeric>
#include <sstream>
using namespace std;
typedef long long LL;
const double PI = 3.14159265358979323846264338327;
const double E = 2.718281828459;
const double eps = 1e-6;
const int MAXN = 0x3f3f3f3f;
const int MINN = 0xc0c0c0c0;
const int maxn = 1e3 + 5;
const int MOD = 1e9 + 7;
int main()
{
map <char, int> m;
m.clear();
int a[3];
int i;
for (i = 0; i < 3; i++)
scanf("%d", &a[i]);
sort(a, a + 3);
for (i = 0; i < 3; i++)
m['A' + i] = a[i];
string s;
cin >> s;
for (i = 0; i < 3; i++)
{
if (i)
printf(" ");
cout << m[s[i]];
}
cout << endl;
}
Kattis - abc 【水】的更多相关文章
- AtCoder Beginner Contest 184 题解
AtCoder Beginner Contest 184 题解 目录 AtCoder Beginner Contest 184 题解 A - Determinant B - Quizzes C - S ...
- Kattis - cokolada【水】
Kattis - cokolada[水] 题意 有一个人想吃巧克力,但是巧克力都是按照 2 的幂次的数量包装的,然后他想吃一定数量块的巧克力,然后可以敲碎,每次敲碎都分成两半,比如四块装的分成两块就是 ...
- Kattis - register 【水】
题意 就是 有一堆容器,然后可以执行加的操作,每个容量是 2, 3, 5, 7, 11, 13, 17, 19 然后 有进位 比如第一个 容器,到2了,就会重置为0,然后 下一个容器+ 1, 但是要保 ...
- CF451C Predict Outcome of the Game 水题
Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...
- ytu 1064: 输入三个字符串,按由小到大的顺序输出(水题,字符串处理)
1064: 输入三个字符串,按由小到大的顺序输出 Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 471 Solved: 188[Submit][Sta ...
- Codeforces Round #374 (Div. 2) A B C D 水 模拟 dp+dfs 优先队列
A. One-dimensional Japanese Crossword time limit per test 1 second memory limit per test 256 megabyt ...
- Codeforces Round #372 (Div. 2) A B C 水 暴力/模拟 构造
A. Crazy Computer time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- HDU 5578 Friendship of Frog 水题
Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...
- HDOJ/HDU 1251 统计难题(字典树啥的~Map水过)
Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己 ...
随机推荐
- 矩阵中的路径 剑指offer65题
include "stdafx.h" #include<vector> #include<algorithm> #include<string> ...
- 从一个实例看javascript几种常用格式的转换
要对如图一所示的左侧table的数据按照“总量”进行排序 1,在前端实现 2,数据格式为object,如图二 原创文章,转载请注明:http://www.cnblogs.com/phpgcs java ...
- https原理与实践
HTTPS 原理与证书实践 分类: Web应用 1.1 网络安全知识 1.1.1 网结安全出现背景 网络就是实现不同主机之间的通讯,网络出现之初利用TCP/IP协议簇的相关协议概念,已经满足了 ...
- [已解决]windows下python3.x与python2.7共存版本pip使用报错问题
> 由于最近要更新插件,突然发现没法使用pip来安装升级插件,查了一圈才找到解决办法,特记录在此,便于其它人查询. 报错信息如下: Fatal error in launcher: Unable ...
- Win7机器上安装Ubuntu 14.0.4
折腾了两天,分享一下经历. 我须要在已经安装了win7的机器上安装Ubuntu 14.0.4 (两者共存),研究下来有例如以下几种方案, 都折腾了一遍.分享一下经验: 方式1: wubi.exe, 把 ...
- flex datagrid itemrender wordwrap失效
现在我是想把datagrid中的部分字体变个颜色. 但是重写set data函数后发现原先的wordwrap自动换行不好使了. 于是就在谷歌上找问题.. 参考了两篇: http://stackover ...
- 用Python和py2app写独立的Mac OS X 应用
文/lovexiaov(简书作者)原文链接:http://www.jianshu.com/p/afb6b2b97ce9著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”. 前提 创建一个普通 ...
- 详解 比特(位,bit),字节(Byte),字符的区别 *(转)
比特(位):英文bit,是计算机晶体管的一种状态(通电与断电).就是0与1,真与假,是计算机最基本的传输单位. 示例: 2bit : 10; 4bit : 1111; 8bit : 1111 1111 ...
- POJ 1848 Tree
Tree Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 3506 Accepted: 1204 Description ...
- 关东升的《从零开始学Swift》即将出版
大家好: 苹果2015WWDC大会发布了Swift2.0,它较之前的版本Swift1.x有很大的变化,所以我即将出版<从零开始学Swift> <从零开始学Swift>将在< ...