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最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己 ...
随机推荐
- Unity3D - 发布Android游戏
本文将介绍如何使用Unity3D来发布Android游戏,这里我使用的Unity3D版本为4.6.3f1 下载Java SDK 使用Unity3D来发布Android游戏时需要用到Android SD ...
- A - Bi-shoe and Phi-shoe 欧拉函数
/** 题目:A - Bi-shoe and Phi-shoe 链接:https://vjudge.net/contest/154246#problem/A 题意:每一个数都有一个得分,它的得分就是, ...
- php 常面试
问题:请用最简单的语言告诉我PHP是什么? 回答:PHP全称:Hypertext Preprocessor,是一种用来开发动态网站的服务器脚本语言. 问题:什么是MVC? 回答:MVC由Model(模 ...
- Photoshop脚本之调试
系统:mac 创建test.scpt和test.jsx command+空格,打开 脚本编辑器(applescript) 脚本编辑器打开test.scpt 输入: tell application & ...
- HTTP 请求:GET vs. POST
两种在客户端和服务器端进行请求-响应的常用方法是:GET 和 POST. GET - 从指定的资源请求数据 POST - 向指定的资源提交要处理的数据 GET 基本上用于从服务器获得(取回)数据.注释 ...
- cocos2d-2.0-x-2.0.4生成vs2010项目模板的解决方法
cocos2d教学书籍还有网上好多博主都说仅仅要执行一下install-templates-msvc.bat这个批处理文件即可了.但是我按了半天vs2010就是不出现令小伙伴惊喜的cocos2d wi ...
- 关于dll的pdb文件的小贴士
.pdb文件最好与生成它的.dll文件放在一起,这样调试的时候才有可能跟踪进dll的内部函数里.
- yii rule
https://blog.csdn.net/ljfrocky/article/details/46373691 http://www.yiichina.com/tutorial/997 http:// ...
- C++编译过程与内存空间
为什么须要知道C/C++的内存布局和在哪能够能够找到想要的数据?知道内存布局对调试程序很有帮助,能够知道程序运行时,究竟做了什么,有助于写出干净的代码.本文的主要内容例如以下: 源文件转换为可运 ...
- redis 列表的底层数据结构链表
当一个列表键包含了数量比较多的元素,又或者列表中包含的的元素都是比较长的字符串,Redis就会使用链表作为列表键的底层实现 每个列表节点的数据结构为 列表数据接口中保存了 该节点前置节点的指针.后置节 ...