关闭
当前搜索:

实现简单的对拍

自带WA自动机属性的ACMer,经常会遇到无限提交然后就是wa的情况,但是就是不知道自己到底哪里出错了。除了cf之类的网站能得到部分数据以外,很难有网站会告诉你数据。所以可以暴力写一发或者找一个正确的cpp文件,产生几组随机数,简单跑几次,,如果出现两者不一样的情况,再做分析。对拍就完成了这么一个功能。 首先,对拍的前提是你的暴力代码是完全正确的,你的随机数产生的数据是完全符合题意的。 ...
阅读(46) 评论(1)

线段树模板

这个月要写4篇博客,工作量太大了,今天最后一天了,贴一下这几天整理过的线段树的模板吧。 int sum[maxn*4],minn[maxn*4],maxx[maxn*4],vis[maxn*4],Map[maxn],n; //sum储存和,minn最小值,maxx最大值,vis作为求最值的标记数组,Map是原数组  建树 void built(int l,int r,int root)...
阅读(86) 评论(0)

Codeforces Round #361 (Div. 2) D (树状数组+二分)

D. Friends and Subsequences time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output Mike and !Mike are old childhoo...
阅读(66) 评论(0)

Codeforces Round #365 (Div. 2) D (树状数组)

D. Mishka and Interesting sum time limit per test 3.5 seconds memory limit per test 256 megabytes input standard input output standard output Little Mishka enjoys progra...
阅读(78) 评论(0)

树状数组模板(max,min,区间和,区间修改,单点查询)

好久不写博客,为了保证持之以恒,就写写最近搞的模板吧,感觉有时候模板比思想实用的多。 树状数组是个神奇的东西,能在log2(n)的时间内完成相应操作,所以我觉得有必要整理一下,但又觉得书面性的东西太多,所以就直接放模板了,有机会写点总结。 首先,创建树状数组。 数组C是储存树状数组的空间,下标从1开始。 void add(int x,int y) //C[x]的值增加y ...
阅读(111) 评论(0)

两个循环单链表实现插入操作

随机产生两组两位整数,建立两个带有头结点的循环单链表,并设尾指针为RL1和RL2,将第二个链表插入到第一个链表的第i个结点前。   函数为:    ① void createList(LinkList&rear)                   ② void insertList(LinkList &CR1, LinkList &CR2, int i) 分析:首先建立循环链表,将...
阅读(119) 评论(0)

Codeforces Round #452 (Div. 2) A-C题解

哎............ A. Splitting in Teams time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There wer...
阅读(325) 评论(1)

Codeforces Round #451 (Div. 2) A-C题解

伤心总是难免的,明明是送分场,愣是掉了61分。 A. Rounding time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has...
阅读(359) 评论(0)

Codeforces Round #450 (Div. 2) A-C题解

A. Find Extra One time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output You have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining ...
阅读(380) 评论(0)

Codeforces Round #449 (Div. 2) A-C题解

A. Scarborough Fair time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He once was the true l...
阅读(245) 评论(0)

Codeforces Round #422 (Div. 2) C Hacker, pack your bags! (二分orDP)

Hacker, pack your bags! time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output It's well known that the best way to distract from something is to do one's favourite thing. Job is such a thing for Leha. So...
阅读(197) 评论(0)

Codeforce 839C Journey (dfs+概率)

C. Journey time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output There are n cities and n - 1 roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roa...
阅读(545) 评论(0)

Educational Codeforces Round 33 (Rated for Div. 2) A-C题解

A. Chess For Three time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Alex, Bob and Carl will soon participate in a team chess tournament. Since they are all in the same team, they have decided to pract...
阅读(446) 评论(0)

Codeforces Round #447 (Div. 2) A-C题解

A. QAQ time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output "QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth. Now Diamond has given Bort a string consi...
阅读(531) 评论(0)

FZU_2216 The Longest Straight (二分)

Problem 2216 The Longest Straight Accept: 441    Submit: 1380 Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description ZB is playing a card game where the goal is to make str...
阅读(329) 评论(0)

Codeforces Round #446 (Div. 2) A-C 题解

A. Greed time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Jafar has n cans of cola. Each can is described by two integers: remaining volume of cola ai and can's capacity bi (ai  ≤  bi). Jafar has de...
阅读(451) 评论(2)

Codeforces Round #444 (Div. 2) A-C 题解

A. Div. 64 time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Top-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills. Her problem is following:...
阅读(511) 评论(0)

Codeforces Round #443 (Div. 2) A-C 题解

A. Borya's Diagnosis time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output It seems that Borya is seriously sick. He is going visit n doctors to find out the exact diagnosis. Each of the doctors needs the...
阅读(373) 评论(0)

洛谷P3031 中石油2557 Above the Median (数组模拟or树状数组求逆序数)

Farmer John has lined up his N (1 <= N <= 100,000) cows in a row to measure their heights; cow i has height H_i (1 <= H_i <= 1,000,000,000) nanometers--FJ believes in precise measurements! He wants to take a picture of some contiguous subsequence of the co...
阅读(374) 评论(0)

HDU 5927 Auxiliary Set (DFS+模拟)

Auxiliary Set Time Limit: 9000/4500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1934 Accepted Submission(s): 564 Problem Description Given a rooted tree with n vertices, some of the vertices are important. An a...
阅读(384) 评论(0)
155条 共8页1 2 3 4 5 ... 下一页 尾页
    个人资料
    • 访问:59175次
    • 积分:2087
    • 等级:
    • 排名:千里之外
    • 原创:154篇
    • 转载:1篇
    • 译文:0篇
    • 评论:17条
    联系方式
    欢迎谈论交流:1245985209
    博客专栏