ACM_c++
文章平均质量分 53
小白菜小青菜
平凡的脚步也可以走出伟大的行程!
展开
-
南阳理工 286 动物统计
动物统计时间限制:1000 ms | 内存限制:65535 KB 难度:2描述 在美丽大兴安岭原始森林中存在数量繁多的物种,在勘察员带来的各种动物资料中有未统计数量的原始动物的名单。科学家想判断这片森林中哪种动物的数量最多,但是由于数据太过庞大,科学家终于忍受不了,想请聪明如你的ACMer来帮忙。输入 第一行输入动物名字的数量N(1<= N <= 10000),接下来的N行原创 2017-04-09 15:05:18 · 380 阅读 · 0 评论 -
UVa 400 Unix ls 命令
UVA 400 The computer company you work for is introducing a brand new computer line and is developing a new Unix-like operating system to be introduced along with the new computer. Your assignment is原创 2017-07-12 16:53:52 · 560 阅读 · 0 评论 -
杭电oj 题目1021Fibonacci Again
Fibonacci AgainTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 61062 Accepted Submission(s): 28528Problem Description There are another kin原创 2017-06-12 20:32:03 · 348 阅读 · 0 评论 -
南阳oj 题目91 阶乘之和
阶乘之和时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 给你一个非负数整数n,判断n是不是一些数(这些数不允许重复使用,且为正数)的阶乘之和,如9=1!+2!+3!,如果是,则输出Yes,否则输出No; 输入 第一行有一个整数0#include<iostream>#include<cstdio>using namespace std;int main()原创 2017-07-08 19:05:21 · 359 阅读 · 0 评论 -
HDU 6078 Wavel Sequence
Wavel SequenceProblem Description Have you ever seen the wave? It’s a wonderful view of nature. Little Q is attracted to such wonderful thing, he even likes everything that looks like wave. Formally,原创 2017-08-08 14:36:04 · 219 阅读 · 0 评论 -
南阳理工 499 迷宫
迷宫时间限制:1000 ms | 内存限制:65535 KB 难度:4描述 一个由 n * m 个格子组成的迷宫,起点是(1, 1), 终点是(n, m),每次可以向上下左右四个方向任意走一步,并且有些格子是不能走动,求从起点到终点经过每个格子至多一次的走法数。输入 第一行一个整数 T 表示有 T 组测试数据。(T <= 110) 对于每组测试数据: 第一行两个整数 n, m,表示原创 2017-04-07 09:43:59 · 430 阅读 · 1 评论 -
杭电 2031 进制转换
进制转换输入一个十进制数N,将它转换成R进制数输出原创 2017-04-06 17:33:54 · 348 阅读 · 0 评论 -
南阳理工 987关于521
南阳理工 水题集原创 2017-04-06 16:20:31 · 325 阅读 · 0 评论 -
士兵杀敌(一)
描述 南将军手下有N个士兵,分别编号1到N,这些士兵的杀敌数都是已知的。 小工是南将军手下的军师,南将军现在想知道第m号到第n号士兵的总杀敌数,请你帮助小工来回答南将军吧。 注意,南将军可能会问很多次问题。输入 只有一组测试数据 第一行是两个整数N,M,其中N表示士兵的个数(1<N<1000000),M表示南将军询问的次数(1<M<100000) 随后的一行是N个整数,ai表示第i原创 2017-04-06 08:48:07 · 415 阅读 · 0 评论 -
HDU 6075 Questionnaire
Questionnaire#include<cstdio>#include<cmath>using namespace std;long long a[100010];int main(){ int T; scanf("%d",&T); while(T--) { int o=0; int n; scanf("%原创 2017-08-03 17:14:24 · 338 阅读 · 0 评论 -
HDU 6077 Time To Get Up
Time To Get Up无脑的枚举加模拟#include<iostream>#include<algorithm>#include<cstdio>#include<cstring>using namespace std;char mapp[8][22];int shu[10][7][4]={0,1,1,0,1,0,0,1,1,0,0,1,0,0,0,0,1,0,0,1,1,0,0,1原创 2017-08-03 17:11:44 · 260 阅读 · 0 评论 -
HPU 1415 小ho的01串 (字符串)
1415: 小ho的01串 [字符串]题目链接 时间限制: 1 Sec 内存限制: 128 MB河南省多校连萌(三)题目描述 有一个由0和1组成的字符串,它好长呀——–一望无际恩,说正题,小ho的数学不太好,虽然是学计算机的但是看见0和1也是很头疼的,现在他的老师想让他计算出来包含K个1的子串有多少个—–呀,头要炸了!!!小ho知道你的数学棒棒哒,所以来找你帮忙了。输入 第一行是一个数K。第二原创 2017-08-11 20:36:21 · 327 阅读 · 0 评论 -
HDU 6058 Kanade's sum(模拟)
Kanade’s sumTime Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 2553 Accepted Submission(s): 1065Problem Description Give you an array of lengt原创 2017-08-07 10:03:37 · 213 阅读 · 0 评论 -
南阳理工oj 题目26 孪生素数问题 素数筛选法
孪生素数问题时间限制:3000 ms | 内存限制:65535 KB 难度:3 描述 写一个程序,找出给出素数范围内的所有孪生素数的组数。一般来说,孪生素数就是指两个素数距离为2,近的不能再近的相邻素数。有些童鞋一看到题就开始写程序,不仔细看题,咱们为了遏制一下读题不认真仔细的童鞋,规定,两个素数相邻为1的也成为孪生素数。 输入 第一行给出N(0<N<100)表示测试数据组数。 接下原创 2017-07-10 15:30:51 · 406 阅读 · 0 评论 -
杭电oj 题目1196 Lowest Bit
Lowest BitTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 12204 Accepted Submission(s): 8905Problem Description Given an positive integer A原创 2017-06-08 22:51:04 · 304 阅读 · 0 评论 -
蛇形填数
蛇形填数时间限制:3000 ms | 内存限制:65535 KB 难度:3描述 在n*n方陈里填入1,2,…,n*n,要求填成蛇形。例如n=4时方陈为: 10 11 12 1 9 16 13 2 8 15 14 3 7 6 5 4输入 直接输入方陈的维数,即n的值。(n<=100) 输出 输出结果是蛇形方阵。 样例输入 3 样例输出 7 8 1 6 9 2 5原创 2017-05-31 19:44:03 · 293 阅读 · 0 评论 -
杭电 1103 Flo's Restaurant
Problem Description Sick and tired of pushing paper in the dreary bleary-eyed world of finance, Flo ditched her desk job and built her own restaurant.In the small restaurant, there are several two-sea原创 2017-04-14 11:09:03 · 961 阅读 · 0 评论 -
杭电 2100 Children’s Queue
Children’s QueueTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14884 Accepted Submission(s): 4940Problem Description There are many studen原创 2017-04-14 11:21:19 · 243 阅读 · 0 评论 -
杭电 1037 Online Judge 字符处理
Online JudgeIgnatius is building an Online Judge, now he has worked out all the problems except the Judge System. The system has to read data from correct output file and user’s result file, then the s原创 2017-04-13 09:51:26 · 392 阅读 · 0 评论 -
杭电 1088 字符处理
Problem Description If you ever tried to read a html document on a Macintosh, you know how hard it is if no Netscape is installed. Now, who can forget to install a HTML browser? This is very easy be原创 2017-04-12 15:29:06 · 390 阅读 · 0 评论 -
计算表达式 栈
读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值。Input 测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔。没有非法表达式。当一行中只有0时输入结束,相应的结果不要输出。Output 对每个测试用例输出1行,即该表达式的值,精确到小数点后2位。Sample Input 1 + 2 4 + 2 * 5 - 7原创 2017-04-11 23:40:07 · 428 阅读 · 0 评论 -
杭电 oj 3350 #define is unsafe
#define is unsafeTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 568 Accepted Submission(s): 359Problem Description Have you used #define i原创 2017-05-01 21:05:08 · 343 阅读 · 0 评论 -
杭电1896 queue 优先队列
Because of the wrong status of the bicycle, Sempr begin to walk east to west every morning and walk back every evening. Walking may cause a little tired, so Sempr always play some games this time. Th原创 2017-04-12 14:37:42 · 273 阅读 · 0 评论 -
字典字符串
In millions of newspapers across the United States there is a word game called Jumble. The object of this game is to solve a riddle, but in order to find the letters that appear in the answer it is nec原创 2017-04-11 16:25:27 · 396 阅读 · 0 评论 -
杭电 字符串处理 map
Problem Description Ignatius is so lucky that he met a Martian yesterday. But he didn’t know the language the Martians use. The Martian gives him a history book of Mars and a dictionary when it leaves原创 2017-04-11 10:02:58 · 386 阅读 · 0 评论 -
逃出迷宫 优先队列
逃出迷宫时间限制: 1 Sec 内存限制: 128 MB 提交: 24 解决: 12题目描述 现在有一个迷宫,’a’代表起点位置,’.’代表可以通行的路,’#’代表不能通过的墙,’x’代表迷宫的守卫,’r’代表终点位置, 现在要求你算出起点位置到终点位置的最短时间,其中通过’.’时,消耗1个单位时间,通过’x’消耗两个单位时间。 输入 多组测试数据,输入两个整数(X,Y)代表迷宫的长和原创 2017-04-10 10:06:25 · 347 阅读 · 0 评论 -
c++ string
初学string,下面是一些简单的函数,后续增加更多。 string s1 ; 默认构造函数,s1为空。 string s2(s1);将s2初始化为s1的副本。 string s1(“wuyang”);将s1初始化为一个字符串的副本。 string s1(n,‘w’);将s1初始化为‘w’的n个副本。 cin>>s1;读取有效字符与空格结束。 getline(cin,s1);读取字符直原创 2017-05-04 08:00:20 · 222 阅读 · 0 评论 -
南阳oj 题目66 分数拆分
分数拆分时间限制:3000 ms | 内存限制:65535 KB 难度:1描述 现在输入一个正整数k,找到所有的正整数x>=y,使得1/k=1/x+1/y.输入 第一行输入一个整数n,代表有n组测试数据。 接下来n行每行输入一个正整数k 输出 按顺序输出对应每行的k找到所有满足条件1/k=1/x+1/y的组合 样例输入 2 2 12 样例输出 1/2=1/6+1/3原创 2017-05-04 19:39:40 · 380 阅读 · 0 评论 -
while(~scanf("%d %d",&a,&b))和while(scanf("%d %d",&a,&b)!=EOF)
#include<stdio.h>int main(){ int a,b; while(scanf("%d %d",&a,&b)!=EOF) { printf("%d\n",a+b); } return 0;} 多组输入求两个数的和,然后突然发现while(~scanf("%d %d",&a,&b))的效果和while(scanf("%d原创 2017-10-26 15:58:51 · 1891 阅读 · 0 评论