ural 2023 Donald is a postman(水)
2023. Donald is a postman
Memory limit: 64 MB
Input
Output
Sample
input | output |
---|---|
4 |
5 |
Problem Source: NEERC 2014, Eastern subregional contest
All submissions (6914) All accepted submissions (3538) Solutions rating (2890)
#include <bits/stdc++.h>
using namespace std; string str[][]= {{"Alice","Ariel","Aurora","Phil","Peter","Olaf","Phoebus","Ralph","Robin"},
{"Bambi","Belle","Bolt","Mulan","Mowgli","Mickey","Silver","Simba","Stitch"},
{"Dumbo","Genie","Jiminy","Kuzko","Kida","Kenai","Tarzan","Tiana","Winnie"}
};
string str1;
int main ()
{
int n;
scanf("%d",&n);
int last = ,sum=;
while(n--)
{
cin>>str1; for(int i=; i<; i++)
{
for(int j=; j<; j++)
if(str1==str[i][j])
sum+=abs(i-last),last=i,j=,i=;
}
}
printf("%d\n",sum);
return ;
}
ural 2023 Donald is a postman(水)的更多相关文章
- Gym 100507L Donald is a postman (水题)
Donald is a postman 题目链接: http://acm.hust.edu.cn/vjudge/contest/126546#problem/L Description Donald ...
- URAL - 1917 Titan Ruins: Deadly Accuracy(水题)
水题一个,代码挫了一下: 题意不好理解. 你去一个洞窟内探险,洞窟内有许多宝石,但都有魔法守护,你需要用魔法将它们打下来. 每个宝石都有自己的防御等级,当你的魔法超过它的防御等级时它就会被你打下来. ...
- ural 2012 About Grisha N.(水)
2012. About Grisha N. Time limit: 1.0 secondMemory limit: 64 MB Grisha N. told his two teammates tha ...
- DFS水题 URAL 1152 False Mirrors
题目传送门 /* 题意:一个圈,每个点有怪兽,每一次射击能消灭它左右和自己,剩余的每只怪兽攻击 搜索水题:sum记录剩余的攻击总和,tot记录承受的伤害,当伤害超过ans时,结束,算是剪枝吧 回溯写挫 ...
- URAL 2056 Scholarship 水题
ScholarshipTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.a ...
- URAL 1136 Parliament 二叉树水题 BST后序遍历建树
二叉树水题,特别是昨天刚做完二叉树用中序后序建树,现在来做这个很快的. 跟昨天那题差不多,BST后序遍历的特型,找到最后那个数就是根,向前找,比它小的那块就是他的左儿子,比它大的那块就是右儿子,然后递 ...
- ural 2032 Conspiracy Theory and Rebranding (数学水题)
ural 2032 Conspiracy Theory and Rebranding 链接:http://acm.timus.ru/problem.aspx?space=1&num=2032 ...
- URAL 1001 Reverse Root(水题?)
The problem is so easy, that the authors were lazy to write a statement for it! Input The input stre ...
- URAL 2066 Simple Expression (水题,暴力)
题意:给定三个数,让你放上+-*三种符号,使得他们的值最小. 析:没什么好说的,全算一下就好.肯定用不到加,因为是非负数. 代码如下: #pragma comment(linker, "/S ...
随机推荐
- (4.8)SQL Server DAC——专用管理员连接
SQL Server DAC——专用管理员连接 默认情况下,只有本地可以使用DAC连接,但也可以开启远程DAC sp_configure ; go reconfigure with override; ...
- mysql执行计划图
- POSIX相关概念
POSIX 表示可移植操作系统接口(Portable Operating System Interface ,缩写为 POSIX),POSIX标准定义了操作系统应该为应用程序提供的接口标准,是IEEE ...
- 【Network】DDoS攻击防御
DDoS(Distributed Denial of Service,分布式拒绝服务)攻击的主要目的是让指定目标无法提供正常服务,甚至从互联网上消失,是目前最强大,最难防御的攻击之一. 按照发起的方式 ...
- Simple Tips for Collection in Python
I believe that the following Python code is really not hard to understand. But I think we should use ...
- mysql之视图,触发器,事务等
一.视图 视图是一个虚拟表(非真实存在),其本质是[根据SQL语句获取动态的数据集,并为其命名],用户使用时只需使用[名称]即可获取结果集,可以将该结果集当做表来使用. 使用视图我们可以把查询过程中的 ...
- 曾经遇到的坑------href="#"和href="javascript:void(0);"、href="javascript:;"
这个是为了 在点击此链接后回到页首,如果你写href="#"那么点击后会回到页首,这样影响操作. <a href="javascript:void 0" ...
- docker-compose no such image
是由于docker-compose旧缓存的问题,执行docker-compose down即可,再重新up
- pyhton3 time模块
来自:菜鸟教程 Python 程序能用很多方式处理日期和时间,转换日期格式是一个常见的功能. Python 提供了一个 time 和 calendar 模块可以用于格式化日期和时间. 时间间隔是以秒为 ...
- HBase基本知识介绍及典型案例分析
本次分享的内容主要分为以下五点: HBase基本知识: HBase读写流程: RowKey设计要点: HBase生态介绍: HBase典型案例分析. 首先我们简单介绍一下 HBase 是什么. HBa ...