手机短号Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 9653 Accepted Submission(s): 6102Problem Description大家都知道,手机号是一个11位长的数字串,同时,作为学生,还可以申请加入校园网,如果加入成功,你将另外拥有一个短号。假设所有的短号都是是 6+手机号的后5位,比如号码为13512345678的手机,对应的短号就是645678。现在,如果给你一个11位长的手机号码,你能找出对应的短号吗?
转载 2012-06-24 13:59:00
46阅读
2评论
Recaman's SequenceTime Limit: 3000MSMemory Limit: 60000KTotal Submissions: 18575Accepted: 7751DescriptionThe Recaman's sequence is defined by a0 = 0 ; for m > 0, am = am−1 − m if the rsulting am is positive and not already in the sequence, otherwise am = am−1 + m. The first few numbers in
转载 2012-08-02 10:28:00
93阅读
2评论
2011-12-15 00:33:26地址:http://acm.hdu.edu.cn/showproblem.php?pid=2081题意:中文。。。不说了。代码:# include <stdio.h>char str[15] ;int main (){ int n ; scanf ("%d%*c", &n) ; while (gets(str)) printf ("6%s\n", str+6) ; return 0 ;}
转载 2012-01-06 14:54:00
25阅读
此题是一道简单题,可以有多种方法,这里将我所知道的每种方法都列出来,仅供参考,其实原理都差不多,方法一:利用字符数组来存放电话号码:#include<iostream>using namespace std;int main(){ int i,N; cin>>N; char a[20]; getchar(); while(N--) {  scanf("%s",a);    
转载 2012-10-25 11:23:00
52阅读
2评论
#include#include#define N 510000int dp[N];int f[10000000];int main() { int k,n,m,i,j; dp[0]=0; memset(f,0,sizeof(f)); for(i=1;i0&&f[dp[i-...
转载 2015-02-06 19:59:00
86阅读
Problem Description 大家都知道,手机号是一个11位长的数字串,同时,作为学生,还可以申请加入校园网,如果加入成功,你将另外拥有一个短号。假设所有的短号都是是 6+手机号的后5位,比如号码为13512345678的手机,对应的短号就是645678。 现在,如果给你一个11位长的手机号码,你能找出对应的短号吗?Input 输入数据的第一行是一个N(N <= 200),表示有N个
原创 2022-05-14 11:43:26
23阅读
手机短号:#include<iostream> #include<string.h> using namespace std; #define N 11 char str[N]; int main(){ int n; cin>>n; cin.ignore(); while(n--){ cin&
原创 2013-07-27 17:56:35
1529阅读
题目:http://acm.hdu.edu.cn/showpro
原创 2022-08-22 21:39:56
83阅读
感觉这一题上传过…… 结果并没有…… 好像...
转载 2015-12-20 18:37:00
38阅读
2评论
#include<iostream> #include<cstring> #include<cstdio> using namespace std; void init(int*data,bool*visit){ int t = 0; data[0] = 0; for(int i=1;i<=5000 ...
转载 2021-08-15 15:07:00
38阅读
2评论
题目链接:手机短号int类型最大值是Integer.MAX_VALUE = 21 4748 3647所以使用long型水题import j System
原创 2023-02-20 11:00:51
54阅读
#include <iostream> using namespace std;int list[500001];bool flag[10000000];int main(){ int n,top=0; fill(flag,flag+sizeof(flag),1); list[0]=0;flag[0]=0; while(scanf("%d",&n)&&n!=-1) { while(top<n) { if(list[top]-top-1>0&&flag[list[top]-top-1]) { top++; lis
转载 2011-07-18 11:37:00
36阅读
Recaman's SequenceTime Limit: 3000msMemory Limit: 60000KBThis problem will be judged onPKU. Original ID:208164-bit integer IO format:%lld Java class n...
转载 2015-01-20 16:25:00
35阅读
题意: 翻转是指其中一段长度为k的子串全部翻转 n<=200000 a[i]<=n 思路:枚举k,直接哈希判充即可 时间复杂度是n/i求和,根据定理可得是O(n log n)级别的 单哈双哈都可能被卡,我用的是单哈+哈希表判重
转载 2017-04-15 09:48:00
29阅读
2评论
Recaman’s Sequence Time Limit: 3000MS Memory Limit: 60000K Total Submissions: 22392 Accepted: 9614 DescriptionThe Recaman’s sequen...
原创 2022-10-18 13:41:05
43阅读
调和级数+hash+map
原创 2023-02-16 11:26:29
35阅读
Description 问把n截成每个长度后不同子串个数. Sol 调和极数+Hash. 首先这是一个式子 \(n\sum_{i=1}^n \frac {1}{i}\) . 这东西就是调和极数再乘上 \(n\) ,他趋近于\(nlnn\) 正反哈希一下. Code
原创 2021-08-04 09:22:54
102阅读
C - Recaman's SequenceCrawling in process...Crawling failedTime Limit:3000MS    Memory Limit:60000KB     64bit IO Format:%I64d & %I64uSubmitStatus Practice POJ 2081 Appoint d
原创 2022-08-08 16:55:19
28阅读
字符串 HASH
转载 2017-06-16 16:10:00
62阅读
2评论
  • 1
  • 2
  • 3