41Acode

好像只要前一个字符串存在下一个字符串的头单词就YES;

#include <bits/stdc++.h>
using namespace std;
typedef __int64 LL; const int N=1e2+10;
int main()
{
int len,i,j;
char s1[N],s2[N];
scanf("%s%s",s1,s2);
len=strlen(s1);
for(i=0,j=len-1;i<len;i++,j--)
{
if(s1[i]!=s2[j])
{
puts("NO");
return 0;
}
}
puts("YES");
return 0;
}

43A

利用map遍历;

原来map的迭代器是iterator

#include <bits/stdc++.h>
using namespace std;
typedef __int64 LL;
map<string,int>mp;
string ss,ans;
int main()
{
int n;
scanf("%d",&n);
for(int i=1;i<=n;i++)
{
cin>>ss;
mp[ss]++;
}
map<string,int>::iterator it;
int tmp=0;
for(it=mp.begin();it!=mp.end();it++)
{
if(it->second>tmp)
{
tmp=it->second;
ans=it->first;
}
}
cout<<ans<<endl;
return 0;
}

CodeForces 41A+43A【课上无聊刷水题系列】的更多相关文章

  1. [洛谷U22157]刷水题(数位dp)(hash)

    题目背景 做正经题是不可能做正经题的,这辈子都不可能做正经题的,毒瘤题又不会做毒瘤题,就是水题这种东西,才维持了蒟蒻的信心: 题目描述 这里有N+1 道水题,编号分别为0 ~N+1 ,每道水题都有它自 ...

  2. codeforces Gym 100187L L. Ministry of Truth 水题

    L. Ministry of Truth Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/p ...

  3. nyoj 1208——水题系列——————【dp】

    水题系列 时间限制:1000 ms  |  内存限制:65535 KB 难度:2   描述     给你一个有向图,每条边都有一定的权值,现在让你从图中的任意一点出发,每次走的边的权值必须必上一次的权 ...

  4. Codeforces Round #185 (Div. 2) B. Archer 水题

    B. Archer Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/312/problem/B D ...

  5. Educational Codeforces Round 14 A. Fashion in Berland 水题

    A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to ...

  6. Codeforces Round #360 (Div. 2) A. Opponents 水题

    A. Opponents 题目连接: http://www.codeforces.com/contest/688/problem/A Description Arya has n opponents ...

  7. Codeforces Round #190 (Div. 2) 水果俩水题

    后天考试,今天做题,我真佩服自己... 这次又只A俩水题... orz各路神犇... 话说这次模拟题挺多... 半个多小时把前面俩水题做完,然后卡C,和往常一样,题目看懂做不出来... A: 算是模拟 ...

  8. Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)解题报告

    对于这道水题本人觉得应该应用贪心算法来解这道题: 下面就贴出本人的代码吧: #include<cstdio> #include<iostream> using namespac ...

  9. Codeforces 777D:Cloud of Hashtags(水题)

    http://codeforces.com/problemset/problem/777/D 题意:给出n道字符串,删除最少的字符使得s[i] <= s[i+1]. 思路:感觉比C水好多啊,大概 ...

随机推荐

  1. Bullet Physics OpenGL 刚体应用程序模板 Rigid Simulation in Bullet

    利用Bullet物理引擎实现刚体的自由落体模拟的模板 Bullet下载地址 Main.cpp #include <GLUT/glut.h> #include <cstdlib> ...

  2. 2016/07/07 wamp中apache2.4.9允许外部访问的配置 重点是版本 版本不同配置效果不同

    wamp安装包中安装好服务器之后只能使用127.0.0.1来访问了,如果我们要设置多个站点或其它像192.168.1.1这种就需要进行一下修改,具体步骤如下.   wamp-apache2.4.9允许 ...

  3. Page (computer memory)

    A page, memory page, or virtual page is a fixed-length contiguous block of virtual memory, described ...

  4. Jquey模糊选择

    Jquey模糊选择   属性字头选择器(Attribute Contains Prefix Selector): jQuery 属性字头选择器的使用格式是 jQuery(‘[attribute|=va ...

  5. openssl之BIO系列之20---缓冲(buffer)类型BIO

    缓冲(buffer)类型BIO ---依据openssl doc\crypto\bio_f_buffer.pod翻译和自己的理解写成 (作者:DragonKing, Mail: wzhah@263.n ...

  6. Android App 启动 Activity 创建解析

    继承实现类关系: ActivityThread  thread = new ActivityThread(); Context->ContextImpl   ContextImpl contex ...

  7. DNS常见攻击与防范

    DNS常见攻击与防范 转自:http://www.williamlong.info/archives/3813.html 日期:2015-7-10 随着网络的逐步普及,网络安全已成为INTERNET路 ...

  8. ubuntu12.04离线安装libjpeg62-dev

    0:如果的电脑能连接上网络,用apt-get install安装最爽,我的情况是:公司电脑用的内网,访问不了外网,而且不让访问外网,安装软件只能用u盘拷进去再安装,所以我用如下方法 1:下载安装包,地 ...

  9. Linux系统上安装字体

    最近项目中需要控制字体类型,然后就上网查了一下在linux系统上安装字体,在window上和linux上,字体要求一样,都是ttf格式,下面这是window上的字体截图 在linux系统中的/usr/ ...

  10. 调用html进行android布局

    1. [代码]html代码     <html>  <head>    <meta http-equiv="content-type" content ...