题意

给出三个数,然后给出一个顺序,有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 【水】的更多相关文章

  1. AtCoder Beginner Contest 184 题解

    AtCoder Beginner Contest 184 题解 目录 AtCoder Beginner Contest 184 题解 A - Determinant B - Quizzes C - S ...

  2. Kattis - cokolada【水】

    Kattis - cokolada[水] 题意 有一个人想吃巧克力,但是巧克力都是按照 2 的幂次的数量包装的,然后他想吃一定数量块的巧克力,然后可以敲碎,每次敲碎都分成两半,比如四块装的分成两块就是 ...

  3. Kattis - register 【水】

    题意 就是 有一堆容器,然后可以执行加的操作,每个容量是 2, 3, 5, 7, 11, 13, 17, 19 然后 有进位 比如第一个 容器,到2了,就会重置为0,然后 下一个容器+ 1, 但是要保 ...

  4. CF451C Predict Outcome of the Game 水题

    Codeforces Round #258 (Div. 2) Predict Outcome of the Game C. Predict Outcome of the Game time limit ...

  5. ytu 1064: 输入三个字符串,按由小到大的顺序输出(水题,字符串处理)

    1064: 输入三个字符串,按由小到大的顺序输出 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 471  Solved: 188[Submit][Sta ...

  6. 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 ...

  7. 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 ...

  8. HDU 5578 Friendship of Frog 水题

    Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

  9. HDOJ/HDU 1251 统计难题(字典树啥的~Map水过)

    Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己 ...

随机推荐

  1. python 旧类中使用property特性的方法

    在python中,我们可以拦截对象的所有特性访问.通过这种拦截的思路,我们可以在旧式类中实现property方法. __getattribute__(self, name) #当特性name被访问时自 ...

  2. layout折叠后显示标题

    Easyui的layout折叠后显示怎样可以显示标题 //在layout的panle全局配置中,增加一个onCollapse处理title$.extend($.fn.layout.paneldefau ...

  3. TLS,SSL,HTTPS with Python(转)

    From: 扫盲 HTTPS 和 SSL/TLS 协议[0]:引子 需要了解的背景知识: 术语 HTTPS,SSL,TLS 长连接与短连接的关系 了解 CA 证书 基本流程 一.术语扫盲 1.什么是S ...

  4. JNDI提供了一种统一的方式,可以用在网络上查找和访问服务

    JNDI提供了一种统一的方式,可以用在网络上查找和访问服务.通过指定一个资源名称,该名称对应于数据库或命名服务中的一个记录,同时返回数据库连接建立所必须的信息. JNDI主要有两部分组成:应用程序编程 ...

  5. Redis快速入门及实现

    redis的概念 (1)Redis的优点 以下是Redis的一些优点. 异常快 - Redis非常快,每秒可执行大约110000次的设置(SET)操作,每秒大约可执行81000次的读取/获取(GET) ...

  6. C++11写算法之选择排序

    选择排序,顾名思义,指从数组后面将最小的值找出来,然后与最前面(指当前位置)值进行交换. 时间复杂度:O(n^2) 空间复杂度:O(1) 此处应用了C++11的auto , lambda , stat ...

  7. Android获取网络类型

    public static final String NETWORK_CLASS_UNKNOWN = "unknown"; public static final String N ...

  8. matlab7.0安装 win7系统详细使用方法附软件下载

    MATLAB 7.0下载地址: 百度网盘下载地址:http://pan.baidu.com/share/link?shareid=414204&uk=2769186556 迅雷快传下载地址:h ...

  9. c++包含头文件好还是重新定义好

    A.h struct A { int a; int b; }; B.cpp 在B.cpp里面用到这个结构体 有两种方法 .自己定义一个一模一样的结构体 struct A { }; .包含A.h头文件 ...

  10. 一个fork的面试题——fork + 缓存区

    update : 20140512 题目:请问下面的程序一共输出多少个“-”? #include <stdio.h> #include <sys/types.h> #inclu ...