摘要:
线性表插入与删除操作Time Limit: 1000 ms Case Time Limit: 1000 ms Memory Limit: 65536 KBSubmit: 78 Accepted: 40 [Prev][Next]Description实现线性表的插入和删除基本操作Input第一行给出线性表内现有数据元素的数目N,1<=N<=10;第二行给出N个整数:a1、a2、a3…aN,整数之间用一个空格隔开,表示线性表现有的数据元素。第三行给出两个整数K、E1,1<=K<=N,表示在第K个元素前插入值为E1的数据元素;第四行给出一个整数E2,表示在线性表中删除第一个值 阅读全文
posted @ 2012-07-30 21:25
加拿大小哥哥
阅读(443)
评论(0)
推荐(0)
摘要:
时间限制:1000ms内存限制:65536kB描述在 skew binary表示中, 第 k 位的值xk表示xk*(2k+1-1)。 每个位上的可能数字是0 或 1,最后面一个非零位可以是2, 例如, 10120(skew) = 1*(25-1) + 0*(24-1) + 1*(23-1) + 2*(22-1) + 0*(21-1) = 31 + 0 + 7 + 6 + 0 = 44. 前十个skew数是 0、1、2、10、11、12、20、100、101、以及102。输入输入包含一行或多行,每行包含一个整数n。 如果 n = 0 表示输入结束,否则n是一个skew 数输出对于每一个输入,输出 阅读全文
posted @ 2012-07-30 18:55
加拿大小哥哥
阅读(298)
评论(0)
推荐(0)
摘要:
时间限制:1000ms内存限制:65536kB描述6*9 = 42 对于十进制来说是错误的,但是对于13进制来说是正确的。即, 6(13) * 9(13) = 42(13), 而 42(13) = 4 * 131 + 2 * 130 = 54(10)。 你的任务是写一段程序读入三个整数p、q和 r,然后确定一个进制 B(2#include#include#includeint vis[35];int vis_temp1[35];int vis_temp2[35];int max;long long My_Pow(int m,int n){ int i; int ans=1; ... 阅读全文
posted @ 2012-07-30 18:41
加拿大小哥哥
阅读(464)
评论(0)
推荐(0)
摘要:
//123*20 相当于 100*20 + 20*20+3 //常规方法N>=13就溢出 #include#include#include#define N 10000//因为每位里存储的是小于10000的数,所以缩小4倍 int vis[N];int main(){ int i,j,m; ... 阅读全文
posted @ 2012-07-30 14:58
加拿大小哥哥
阅读(185)
评论(0)
推荐(0)
摘要:
Problem DescriptionIgnatius was born in a leap year, so he want to know when he could hold his birthday party. Can you tell him?Given a positive integers Y which indicate the start year, and a positive integer N, your task is to tell the Nth leap year from year Y.Note:if year Y is a leap year, then 阅读全文
posted @ 2012-07-30 10:11
加拿大小哥哥
阅读(1133)
评论(0)
推荐(0)
摘要:
大致题意:给出自从2000 1 1过的天数,以-1结束,输出日期和星期//以后遇到闰年的问题,坚决用二维数组 #include<stdio.h>#include<string.h>#define N 10010char date[7][10]={"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};int vis[2][12]={31,28,3 阅读全文
posted @ 2012-07-30 09:57
加拿大小哥哥
阅读(277)
评论(0)
推荐(0)
摘要:
字符串替换Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7290Accepted: 3451Description编写一个C程序实现将字符串中的所有"you"替换成"we"Input输入包含多行数据 每行数据是一个字符串,长度不超过1000 数据以EOF结束Output对于输入的每一行,输出替换后的字符串Sample Inputyou are what you doSample Outputwe are what we do第一:#include<stdio.h> char 阅读全文
posted @ 2012-07-30 08:42
加拿大小哥哥
阅读(757)
评论(0)
推荐(0)

浙公网安备 33010602011771号