CodeForces 41A+43A【课上无聊刷水题系列】
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【课上无聊刷水题系列】的更多相关文章
- [洛谷U22157]刷水题(数位dp)(hash)
题目背景 做正经题是不可能做正经题的,这辈子都不可能做正经题的,毒瘤题又不会做毒瘤题,就是水题这种东西,才维持了蒟蒻的信心: 题目描述 这里有N+1 道水题,编号分别为0 ~N+1 ,每道水题都有它自 ...
- 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 ...
- nyoj 1208——水题系列——————【dp】
水题系列 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描述 给你一个有向图,每条边都有一定的权值,现在让你从图中的任意一点出发,每次走的边的权值必须必上一次的权 ...
- 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 ...
- Educational Codeforces Round 14 A. Fashion in Berland 水题
A. Fashion in Berland 题目连接: http://www.codeforces.com/contest/691/problem/A Description According to ...
- Codeforces Round #360 (Div. 2) A. Opponents 水题
A. Opponents 题目连接: http://www.codeforces.com/contest/688/problem/A Description Arya has n opponents ...
- Codeforces Round #190 (Div. 2) 水果俩水题
后天考试,今天做题,我真佩服自己... 这次又只A俩水题... orz各路神犇... 话说这次模拟题挺多... 半个多小时把前面俩水题做完,然后卡C,和往常一样,题目看懂做不出来... A: 算是模拟 ...
- Codeforces Round #256 (Div. 2/A)/Codeforces448A_Rewards(水题)解题报告
对于这道水题本人觉得应该应用贪心算法来解这道题: 下面就贴出本人的代码吧: #include<cstdio> #include<iostream> using namespac ...
- Codeforces 777D:Cloud of Hashtags(水题)
http://codeforces.com/problemset/problem/777/D 题意:给出n道字符串,删除最少的字符使得s[i] <= s[i+1]. 思路:感觉比C水好多啊,大概 ...
随机推荐
- LookAround开元之旅
http://blog.csdn.net/lancees/article/details/17696805
- iOS8需要兼容的内容
本文转载至 http://blog.csdn.net/liuwuguigui/article/details/39494435 1.iPad上使用presentModalViewController ...
- 开源G711(PCMA、PCMU)/G726转AAC项目EasyAACEncoder
EasyDarwin开源社区整理了一份G711(PCMA.PCMU)/G726转AAC的转码库,支持Windows/Linux跨平台使用,将安防标准的G711转成移动互联网常用的AAC格式,希望能给大 ...
- linux socket详解
1 linux socket编程的固定模式 server端,bind.listen.accept client端,connect client端和server端之间的一次通信: client端,wri ...
- a REST API
https://spring.io/guides/tutorials/bookmarks/ http://roy.gbiv.com/untangled/2008/rest-apis-must-be-h ...
- select监听多个client -- linux函数
使用select函数能够以非堵塞的方式和多个socket通信.程序仅仅是演示select函数的使用,功能很easy,即使某个连接关闭以后也不会改动当前连接数.连接数达到最大值后会终止程序. 1. 程序 ...
- s1考试 图书管理系统 结构体版
#include <iostream> #include <string> #include <cstdio> #include <cstdlib> # ...
- appium()-java-client-api
//appium java-client-api 介绍 原文地址:http://appium.github.io/java-client/index-all.html#_S_ A B C D E F ...
- Android Weekly Notes Issue #242
Android Weekly Issue #242 January 29th, 2017 Android Weekly Issue #242 本期内容包括: Android中常用的设计模式; 基于No ...
- html5--3.22 综合实例03
html5--3.22 综合实例03 学习要点 通过一个综合实例来回顾学过的内容 这一章的内容比较多,不必强求一下子全记住,多做一些练习,用得多了自然就可以记住了 可以自己找一些实例练练手,比如各网站 ...