想必大家都用过UILabel,但是怎么来设计label上的字体呢?有一个方法:
label.font = [UIFont fontWithName:@"Avenir-Light" size:28];
但是fontWithName后面的参数从哪里来得呢?我们不妨来打印出familyNames NSArray
*familyNames = [UIFont familyNames];
...
分类:
移动开发 时间:
2014-06-20 11:34:49
阅读次数:
295
题目来源:Light OJ 1168 Wishing Snake
题意:有点难看懂题意 看了一个小时再加别人的代码才懂意思
从0开始 输入的那些每一对u v 都要经过 就是从0到到达那些点
思路:首先缩点 每一个强连通分量里面的点都是可达的
缩点后的图是有向无环图 如果从0这个强连通分量可以出去到2个强连通分量 那么这两个强连通分量是不可能相互可达
所以可行的方案就是所有的强连通分量...
分类:
其他好文 时间:
2014-06-11 00:50:25
阅读次数:
242
题目来源:Light 1289 LCM from 1 to n
题意:。。
思路:从1到n 打过某个数是以一个素数的几次方 那么答案就乘以这个素数
主要是筛选素数 存不下 位优化 一个整数32位标记32个数 内存缩小32倍
是学习别人的
#include
#include
#include
#include
using namespace std;
const int maxn ...
分类:
其他好文 时间:
2014-06-10 18:05:45
阅读次数:
250
题目来源:Light OJ 1278 Sum of Consecutive Integers
题意:N拆分成连续整数和的方案数
思路:奇因数的个数
#include
#include
#include
#include
using namespace std;
//筛素数
const int maxn = 10000010;
bool vis[maxn];
int prime[10...
分类:
其他好文 时间:
2014-06-08 15:34:09
阅读次数:
295
acm菜鸡必备
1 runtime! debian.vim
2 if has("syntax")
3 syntax on
4 endif
5 if filereadable("/etc/vim/vimrc.local")
6 source /etc/vim/vimrc.local
7 endif
8 "syntax high light
9 synta...
分类:
其他好文 时间:
2014-06-08 09:45:09
阅读次数:
286
题目来源:Light OJ 1251 Forming the Council
题意:若干了条件至少满足一个 求是否有方案 输出任意一种可能的方案 留下的人的个数
思路:2-SAT基础题
#include
#include
#include
using namespace std;
const int maxn = 100010;
int n, m;
vector G[maxn*2];...
分类:
其他好文 时间:
2014-06-08 08:15:18
阅读次数:
261
题目来源:Light OJ 1026 Critical Links
题意:输出桥
思路:模版
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 10010;
struct Edge
{
int u, v;
Edge(){}
Edge(int u, int v):...
分类:
其他好文 时间:
2014-06-08 04:07:05
阅读次数:
235
题目来源:Light OJ 1291 Real Life Traffic
题意:最少添加几条边 可以使全图边双连通
思路:缩点 重新构图 答案就是(叶子节点数+1)/ 2
#include
#include
#include
#include
#include
using namespace std;
const int maxn = 10010;
struct Edge
{
i...
分类:
其他好文 时间:
2014-06-08 02:57:26
阅读次数:
276
题目来源:Light OJ 1268 Unlucky Strings
题意:给你一些可以用的字符 然后求组成不包含给定字符串的方案数
思路:矩阵经典问题 从i走k步路到达j的方案数 可以用矩阵快速幂求解
对于求长度为n的字符的方案数 就是走n步路 求走法
可以用KMP求出走一步 从前i个字符到前j个字符的方案数 这点有点不好理解 想一想
#include
#include
#...
分类:
其他好文 时间:
2014-06-07 14:33:43
阅读次数:
303
Mac OS的一些:华文细黑:STHeiti Light
[STXihei]华文黑体:STHeiti华文楷体:STKaiti华文宋体:STSong华文仿宋:STFangsong儷黑 Pro:LiHei Pro
Medium儷宋 Pro:LiSong Pro Light標楷體:BiauKai蘋果儷中黑...
分类:
其他好文 时间:
2014-06-06 09:11:29
阅读次数:
289