hdu 5980 Find Small A(水,模拟)】的更多相关文章

题意:众所周知,字符 'a' 的ASCII码为97.现在,找出给定数组中出现了多少次 'a' .注意,此处的数字为计算机中的32位整数.这表示, 1个数字由四个字符组成(一个字符由8位二进制数组成). 析:直接用运用位运算即可. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib…
p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-size: 10.5000pt } h1 { margin-top: 5.0000pt; margin-bottom: 5.0000pt; text-align: center; font-family: 宋体; color: rgb(26,92,200); font-weight: bold; fo…
CodeForces.158A Next Round (水模拟) 题意分析 校赛水题的英文版,坑点就是要求为正数. 代码总览 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <set> #include <map> #include <queue>…
CodeForces71A. Way Too Long Words (水模拟) 题意分析 题怎么说你怎么做 没有坑点 代码总览 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <sstream> #include <set> #include <map> #include <queue>…
Find Small A Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1112    Accepted Submission(s): 540 Problem Description As is known to all,the ASCII of character 'a' is 97. Now,find out how many ch…
题意:计算Bestcoder四题的得分. 思路:直接模拟,4项分数直接计算后输出.注意不要低于百分之40的分. //#include <bits/stdc++.h> #include <iostream> #include <cstdio> #define LL long long using namespace std; ; int a[N]; int b[N]; int cal() { ; ans=(/*(-a[])-b[]* >*/*(-a[])-b[]*:…
n*n*n的图形,m条线,每条线上的方格被删除.问一共删除了多少个方格 ans=m*n .然后推断一下直线相交的交点.去重就可以 #include "stdio.h" #include "string.h" int xy[1010][1010],xz[1010][1010],yz[1010][1010],hash[1010]; struct node { int x,y,z; } mark[1010]; int main() { int Case,n,m,i,j,c…
异或密码 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Problem Description 晨晨在纸上写了一个长度为N的非负整数序列{ai}.对于这个序列的一个连续子序列{al,al+1,-,ar}晨晨可以求出其中所有数异或的结果 alxoral+1xor...xorar其 中xor表示位异或运算,对应C.C++. Java等语言中的^运算.小璐提出了M个询问,每个询问用…
Relative atomic mass Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 66    Accepted Submission(s): 59 Problem Description Relative atomic mass is a dimensionless physical quantity, the ratio of…
题意:输入一棵树,输出前k小的点对最短距离dis(i,j)的和. 模拟,官方题解说得很清楚了.不重复了. http://bestcoder.hdu.edu.cn/ 需要注意的是,复杂度要O(n+k),不能用set,map之类的标记是否访问. 一开始TLE了,去掉标记后wa了.最后发现对队列的元素加个前缀,就可以了,即标记该条边是从哪个点延伸的. #include <cstdio> #include <cstring> #include <iostream> #inclu…
A. Broken Clock time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a broken clock. You know, that it is supposed to show time in 12- or 24-hours HH:MM format. In 12-hours format…
Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5578 Description N frogs from different countries are standing in a line. Each country is represented by a lowercase letter. The distance betwee…
ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5590 Description ZYB(ZJ−267)在NOIP拿到600分之后开始虐生物题,他现在扔给你一道简单的生物题:给出一个DNA序列和一个RNA序列,问它们是否配对. DNA序列是仅由A,C,G,T组成的字符串,RNA序列是仅由A,C,G,U组成的字符串. DNA和RNA匹配当且仅当每…
Dylans loves numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5272 Description Dylans是谁?你可以在 UOJ 和 Codeforces上看到他.在BestCoder里,他有另外一个ID:s1451900.今天的题目都和他有关哦.Dylans得到了一个数N.他想知道N的二进制中有几组1.如果两个1之间有若干个(至少一个)0…
NanoApe Loves Sequence 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5805 Description NanoApe, the Retired Dog, has returned back to prepare for the National Higher Education Entrance Examination! In math class, NanoApe picked up sequences once aga…
L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5538 Description Have you ever played the video game Minecraft? This game has been one of the world's most popular game in recent years. The wor…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4708 题目大意:给定一个方形矩阵,边长为3-10的奇数.每一圈的数字可以沿着顺时针方向和逆时针方向旋转,求使得矩阵主对角线和反对角线和最大时的数以及需要旋转的最小步骤. Sample Input 5 9 3 2 5 9 7 4 7 5 4 6 9 3 9 3 5 2 8 7 2 9 9 4 1 9 0   Sample Output 72 1 分析:简单的模拟.分别计算每一圈旋转后的四个角的值最大需…
Basic Data Structure Time Limit: 7000/3500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 872    Accepted Submission(s): 236 Problem Description Mr. Frog learned a basic data structure recently, which is called stac…
Minimum's Revenge Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 283    Accepted Submission(s): 219 Problem Description There is a graph of n vertices which are indexed from 1 to n. For any pai…
链接:http://acm.hdu.edu.cn/showproblem.php?pid=4814 题意:黄金比例切割点是,如今要求把一个10进制的的数转化成一个phi进制的数,而且不能出现'11'的情况. 思路:因为题目中给出了两个式子,题目就变成了一道简单的模拟题了.因为整个phi进制的数最多仅仅有200,而数据中最多仅仅有100位,所以从aa[50]=tot 開始模拟就可以. 代码: #include<iostream> #include<cstdio> #include&l…
主题链接:HDU 2414 Chessboard Dance 意甲冠军:鉴于地图,>,<,^,v的方向,字母相当于是箱子,箱子能够推出边界.人保证不会做出边界.以下输入指令,依照指令走,输出结束时图的状态. 强行模拟一遍,注意以下给出的案例. >t.p.p.p ...a.... ........ ...bfg.y ...c... ...d.... ...e.... ........ move 3 turn right move 3 turn left move 3 turn left m…
Dying Light Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 513    Accepted Submission(s): 122 Problem Description LsF is visiting a local amusement park with his friends, and a mirror room su…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4813 签到题. 把一个字符串按照格式输出就可以了,很水 #include <stdio.h> #include <string.h> #include <iostream> #include <algorithm> #include <queue> #include <map> #include <set> #include…
zxa and xor 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5683 Description zxa had a great interest in exclusive disjunction(i.e. XOR) recently, therefore he took out a non-negative integer sequence a1,a2,⋯,an of length n. zxa thought only doing th…
HDU 4847 Wow! Such Doge! pid=4847" style="">题目链接 题意:给定文本,求有几个doge,不区分大写和小写 思路:水题.直接一个个读字符每次推断就可以 代码: #include <stdio.h> #include <string.h> char c; char a[5]; int main() { a[5] = '\0'; int ans = 0; while ((c = getchar()) != E…
A. Combination Lock time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Scrooge McDuck keeps his most treasured savings in a home safe with a combination lock. Each time he wants to put there…
Description Too worrying about the house price bubble, poor Mike sold his house and rent an apartment in a 50-floor building several months ago. This building has only one elevator because it is a so called “rotten tail building”. There are always a…
A. Neverending competitions time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output There are literally dozens of snooker competitions held each year, and team Jinotega tries to attend them all (f…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1200 To and Fro Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5129    Accepted Submission(s): 3550 Problem Description Mo and Larry have devised…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=4414 CSUST:点击打开链接 Finding crosses Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 729    Accepted Submission(s): 411 Problem Description The Nazca L…