[BZOJ3295][Cqoi2011]动态逆序对 试题描述 对于序列A,它的逆序对数定义为满足i<j,且Ai>Aj的数对(i,j)的个数。给1到n的一个排列,按照某种顺序依次删除m个元素,你的任务是在每次删除一个元素之前统计整个序列的逆序对数。 输入 输入第一行包含两个整数n和m,即初始元素的个数 ...
分类:
其他好文 时间:
2017-02-03 22:46:36
阅读次数:
190
scanf的返回值由后面的参数决定 scanf("%d%d", &a, &b); 如果a和b都被成功读入,那么scanf的返回值就是2 如果只有a被成功读入,返回值为1 如果a和b都未被成功读入,返回值为0 如果遇到错误或遇到end of file,返回值为EOF。 且返回值为int型. 验证: s ...
分类:
其他好文 时间:
2017-02-02 11:00:21
阅读次数:
221
1 //A~Z是从大到小。。。 2 #include 3 int main() 4 { 5 int n; 6 char a,b; 7 scanf("%d",&n); 8 while(n--) 9 { 10 getchar(); 11 scanf("%c %c",&a,&b); 12 if(a... ...
分类:
其他好文 时间:
2017-02-02 02:15:44
阅读次数:
141
1 #include 2 #include 3 #include 4 #include 5 6 HANDLE g_hEvent; 7 UINT __stdcall ThreadProc(LPVOID); 8 int main(int argc,char* argv[]) 9 { 10 unsigne... ...
分类:
其他好文 时间:
2017-02-01 23:41:09
阅读次数:
378
【题目分析】 GSS1的基础上增加修改操作。 同理线段树即可,多写一个函数就好了。 【代码】 ...
分类:
其他好文 时间:
2017-02-01 20:39:50
阅读次数:
253
How many integers can you find Time Limit: 12000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description Now you get a num ...
分类:
其他好文 时间:
2017-02-01 17:22:28
阅读次数:
231
[HDU5919]Sequence II 试题描述 Mr. Frog has an integer sequence of length n, which can be denoted as a1,a2,?,an There are m queries.In the i-th query, you ...
分类:
其他好文 时间:
2017-02-01 13:22:07
阅读次数:
242
stdio 1、int getc(FILE *fp) 函数功能:从fp指向的文件中读取一个字符。 返回值:返回所读的字符,若文件结束或出错则返回EOF. 用法:ch=getc(stdin);或ch=getc(fp); 2、int getchar(void); 函数功能:从标准输入文件stdin读入一 ...
分类:
编程语言 时间:
2017-01-31 15:57:49
阅读次数:
249
本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作。 本文版权归ljh2000和博客园共有,欢迎转载,但须保留此声明,并给出原文链接,谢谢合作。 本文作者:ljh2000 作者博客:http://www.cnblogs.com/ljh2000-jump/转载请注 ...
http://acm.hdu.edu.cn/showproblem.php?pid=1686 题意:给定一个文本串和给定一个模式串,求文本串中有几个模式串。 思路:直接套用KMP模板。 ...
分类:
其他好文 时间:
2017-01-30 12:34:45
阅读次数:
177