4756: [Usaco2017 Jan]Promotion Counting Description The cows have once again tried to form a startup company, failing to remember from past experience ...
分类:
其他好文 时间:
2017-10-24 19:43:36
阅读次数:
159
1.什么是自动引用计数? 顾明思义,自动引用计数(ARC,Automatic Reference Counting)是指内存管理中对引用采取自动计数的技术。 在OC中采用ARC机制,让编译器来进行内存管理。在新一代apple LLVM编译器中设置ARC为有效状态,就无需再次键入retain或者rel ...
分类:
其他好文 时间:
2017-10-24 18:16:33
阅读次数:
152
【题意】带点权树,统计每个结点子树内点权比它大的结点数。 【算法】线段树合并 【题解】对每个点建权值线段树(动态开点),DFS中将自身和儿子线段树合并后统计。 注意三个量tot,cnt,tots,细心查错。 #include<cstdio> #include<algorithm> #include< ...
分类:
其他好文 时间:
2017-10-24 17:09:28
阅读次数:
177
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and r ...
分类:
其他好文 时间:
2017-10-24 13:06:04
阅读次数:
132
Description The cows have once again tried to form a startup company, failing to remember from past experience that cows make terrible managers!The co ...
分类:
其他好文 时间:
2017-10-23 20:45:10
阅读次数:
157
Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there ar ...
分类:
其他好文 时间:
2017-10-22 22:20:11
阅读次数:
196
【题意】给定坐标系上n个点,求能构成的包含原点的三角形个数,n<=10^5。 【算法】极角排序 【题解】补集思想,三角形个数为C(n,3)-不含原点三角形。 将所有点极角排序。 对于一个点和原点构成的直线,如果选择这个点和直线一侧的两个点就可以构成不含原点的三角形。 每个点只统计半圈,这样扫1~n下 ...
分类:
其他好文 时间:
2017-10-21 16:29:31
阅读次数:
176
Lake Counting Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37384 Accepted: 18586 Description Due to recent rains, water has pooled in va ...
分类:
其他好文 时间:
2017-10-13 22:25:20
阅读次数:
253
深度优先搜索的用法——lake counting 问题主题:Lake Counting 问题描述: 有一个大小为N*M的园子,雨后积了很多水。八连通的积水被认为是在一起的。请求出园子里共有多少个水洼?(八连通是指下图中相对+的*部分) +++ +*+ +++ 限制条件: N,M <= 100 样例: ...
分类:
其他好文 时间:
2017-10-10 00:15:59
阅读次数:
180
Lake Counting 链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1249 【题目描述】 题意:有一块N*M的土地,雨后积起了水,有水标记为‘W’,干燥为‘.’。八连通的积水被认为是连接在一起的。请求出院子里共有多少水洼? 【输入】 第一 ...
分类:
其他好文 时间:
2017-10-06 19:04:57
阅读次数:
191