输入技巧
文章平均质量分 71
huadong_fcy56
这个作者很懒,什么都没留下…
展开
-
zoj3432 Find the Lost Sock 亦或的运用
只有一个出现奇数次,答案就是它了:#include#include#include#include#includeusing namespace std;char s[10],c;int main(){ int n; while(~scanf("%d\n",&n)){ for(int i=0;i<=7;i++) s[i]='\0'; for(int i=1;原创 2017-08-16 12:01:15 · 195 阅读 · 0 评论 -
HDU2057 A + B Again
Problem DescriptionThere must be many A + B problems in our HDOJ , now a new one is coming.Give you two hexadecimal integers , your task is to calculate the sum of them,and print it in hexadecimal原创 2017-09-22 22:02:55 · 181 阅读 · 0 评论 -
zoj1151 zoj1295 Word Reversal 字符串的简单处理
Word Reversal 字符串的处理For each list of words, output a line with each word reversed without changing the order of the words.This problem contain原创 2017-08-10 16:30:18 · 253 阅读 · 0 评论 -
ZOJ2286 Sum of Divisors 筛选式打表
我想我是和Segmentation Fault有仇,我一直以为是空间开大的问题,然后一直减少空间,还是SF,谁让n没有给范围了,qwq。教训:以后注意输入范围和开的空间大小。#include#include#include#includeusing namespace std;int a[3400010];int ans[1000011];int sum[3400010];原创 2017-08-21 14:40:06 · 286 阅读 · 0 评论 -
zoj2818 Root of the Problem 简单数学 开方
Root of the ProblemTime Limit: 2 Seconds Memory Limit:65536 KB Given positive integers B and N, find an integer A such that AN is as close as possible to B. (The result A is an approx原创 2017-08-13 17:53:36 · 206 阅读 · 0 评论 -
ZOJ2006 一道很尴尬的string操作题
ZOJ2006(最小表示法) 题目大意:输出第一个字符串的最小字典序字串的下标!然后我居然想试一试string的erase的能力,暴力一下,然后20msAC了,尴尬的数据。。。。。。。。。。#include#include#include#includeusing namespace std;string s,Min;char temp;int Pos;void _wo原创 2017-08-19 16:18:12 · 186 阅读 · 0 评论 -
IBM Minus One 简单字符处理
IBM Minus OneTime Limit: 2 Seconds Memory Limit:65536 KB You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or the film of the same name by Stanley Kubrick.原创 2017-08-12 18:55:01 · 424 阅读 · 2 评论 -
zoj1109 水题(大神绕道) Language of FatMouse
Language of FatMouseWe all know that FatMouse doesn't speak English. But now he has to be prepared since our nation will join WTO soon. Th原创 2017-08-12 15:26:10 · 384 阅读 · 0 评论 -
zoj 3778 Talented Chef
zoj3778题目大意:有n个数,每一次操作你可以最多选择m个数自减一,求直到所有数都为零,的最小操作次数。第一想法肯定是贪心排序:用一个大根堆,每次选前面的min(m,n)个自减一,这样保证了每一次可以选最接近m个数自减一。然后发现超时。规律:1,n不大于m,不必计算。ans=max(ai);1 2, n大于m,前ans-1次操作必然要每次有m个对象,第a原创 2017-08-16 18:49:36 · 181 阅读 · 0 评论 -
HDU 1219 AC Me
strlen能不用就不用#include#include#include#include#include#include#include#includeusing namespace std;char s[100010];int a[30];int main(){ int i,L; while(gets(s)){ memset(a,0,sizeof(a)原创 2017-09-25 15:24:24 · 183 阅读 · 0 评论