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最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己 ...
随机推荐
- DataUml Design 教程2-实体建模
DataUml Design 实体建模基于UML类图标准来设计,支持一对一.一对多.多对多关联.模型与开发语言和数据库绑定.1.新建数据模型 1).选择“数据模型” 节点,点击鼠标右键,在菜单中 ...
- 基于AR9331(MIPS架构)分析系统启动过程(uboot)
前提: 1.AR9331是基于MIPS 24K CPU的一款WIFI1X1芯片,其SDK采用uboot作为引导.AR9331中定义的基地址是:0x9f00,0000 2.MIPS24K芯片,将固定的起 ...
- sqlite3 PC安装及使用
sqlite3使用 1. 安装sqlite3 sudo apt-get install sqlite3 sudo apt-get install libsqlite3-dev 2. sqlite常用命 ...
- virtualbox 扩容
http://www.cnblogs.com/xueweihan/p/5923937.html#1
- 把world转成html
本来用php转的 效果不太理想 很不稳定 最后试了下java 效果不错 只记录java的方法好了 其实他们的原理都是一样的啊,都是用到了微软的com 首先是准备工作 下载(明确dll的版本是64位的还 ...
- Unity3D学习笔记——NGUI之UIInput
UIInput:这个组件可以用于创建输入框和编辑文本. 效果图如下: 一:使用步骤 1.首先创建一个背景,可以用Sprite也可以是Widget. 我这里使用的是空白的Widget 2.为其添加一个L ...
- CentOS6.X 升级内核至 3.10
1.1 查看当前版本 [root@localhost ~]# uname -r -.el6.x86_64 1.2 导入public key [root@localhost ~]# rpm --impo ...
- 简单的c语言小程序 回光返照
主函数 int main(int argc,char * argv[]) -- arg代表英文的参数缩写 c代表count计数 argc { return 0; -- 0返还给系统,代表程序正确运行 ...
- [读书笔记]JavaScript 闭包(Closures)
1. 什么是闭包? 参考MDN. 2. 闭包的使用示例 2.1 示例1 <div>1</div> <div>2</div> <div>3&l ...
- 160819、JavaScript-数组去重由慢到快由繁到简
JavaScript-数组去重由慢到快由繁到简演化 indexOf去重 Array.prototype.unique1 = function() { var arr = []; for (var ...