PKU 1002解题总结】的更多相关文章

闲来无事,研究了一下PKU1002的题目,大意就是把含有字母的电话号码,转换为数字,然后再计算每个电话号码出现的次数,输出.本来蛮简单的一道题,结果折腾了好久,主要也是自己的水平太菜了,先是直接用字符串来处理,结果也都对,但是提交就是出现runtime error,后来才发现,要输入10W个电话号码,字符串光分配空间估计都够呛呀,也是自己审题不清,后来仔细阅读了了一下题目,也怪自己英文太挫了,在网上借鉴了一下思路,因为题目限制最大7位完全可以用整数来存储,然后保存之后,考虑要计算重复次数,结果楼…
GitHub markdownPDF 问题描述 解题思路 代码 提交记录 问题描述 A+B for Polynomials (25) 时间限制 400 ms 内存限制 65536 kB 代码长度限制 16000 B 判题程序 Standard 作者 CHEN, Yue This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one test…
首先庆祝一下,今天连A了3题.感觉后面这题太简单了.. 由于英文不好 ,找了个翻译: 若将一叠卡片放在一张桌子的边缘,你能放多远?如果你有一张卡片,你最远能达到卡片长度的一半.(我们假定卡片都正放在桌子上.)如果你有两张卡片,你能使最上的一张卡片覆盖下面那张的1/2,底下的那张可以伸出桌面1/3的长度,即最远能达到 1/2 + 1/3 = 5/6 的卡片长度.一般地,如果你有n张卡片,你可以伸出 1/2 + 1/3 + 1/4 + ... + 1/(n + 1) 的卡片长度,也就是最上的一张卡片…
本来以前也写过,但是由于许多细节问题,没有AC,今天修改了一下,终于AC了,以前没有AC的具体原因总结了了一下,必须任何数的0次方都等于1没有考虑,还有就是首0和末尾0以及小数点没有处理好,下面贴代码,应该还可以优化一下, 比如乘数和被乘数如果是0,可以忽略,求指数也可以采用分治法,以后再有时间了补充吧 // bigMulMul.cpp : 定义控制台应用程序的入口点. // #include "stdafx.h" #include <string> #include &l…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1002 解题思路:就是把大的数用数组存放起来,像小学的时候用竖式加法来算两个数相加那样算: 反思:思路很简单,可是有很多细节考虑不好,有时候没有进位,有时候又没有输出正确的答案,然后有时候数组长度又开小了什么的,所以还要多多练习. #include<stdio.h> #include<string.h> #define max 1000 void add(char a[],char b[…
The sum of gcd Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 641    Accepted Submission(s): 277 Problem Description  You have an array A with the length of $n$ \[Let\quad f(l,r) = \sum_{i = l}…
PKU OJ 1002 487-3279 487-3279 Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or phrase. For example, you can call the University of Waterloo by dialin…
    487-3279 Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 228365   Accepted: 39826 Description Businesses like to have memorable telephone numbers. One way to make a telephone number memorable is to have it spell a memorable word or p…
1002. Phone Numbers Time limit: 2.0 secondMemory limit: 64 MB In the present world you frequently meet a lot of call numbers and they are going to be longer and longer. You need to remember such a kind of numbers. One method to do it in an easy way i…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1002 题目意思:就是大整数加法. 两年几前做的,纯粹是整理下来的. #include <stdio.h> #include <string.h> #define max 1010 char a[max], b[max]; int main() { int i, k, s, c, T, len1, len2; scanf("%d", &T); ; k <…