码迷,mamicode.com
首页 >  
搜索关键字:ignatius and the pri    ( 1549个结果
Object-C 多线程中锁的使用-NSLock
在多线程的编程环境中,锁的使用必不可少! 于是,今天来总结一下为共享资源加锁的操作方法。 一、使用synchronized方式 ????//线程1 ????dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRI...
分类:编程语言   时间:2014-08-18 18:58:33    阅读次数:276
HDU 1074 Doing Homework(状压DP)
Problem Description Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands i...
分类:其他好文   时间:2014-08-17 10:29:42    阅读次数:246
你所知道的Java单例模式并不是单例模式
当我们搜索单例模式的时候,能看到很多例子,什么懒汉式、饿汉式,大概如下:public class Singleton { private static Singleton instance=null; private Singleton(){ System.out.pri...
分类:编程语言   时间:2014-08-16 11:05:50    阅读次数:182
用星号打印等边三角形
#include void main(){ int i,j,k; for (i=1;i<6;i++) { for(k=0;k<5-i;k++) { printf(" "); } for (j=0;j<2*i-1;j++) { pri...
分类:其他好文   时间:2014-08-16 09:42:40    阅读次数:186
用星号画菱形
#include void main(){ int i,j,k; for (i=1;i<6;i++) { for(k=0;k<5-i;k++) { printf(" "); } for (j=0;j<2*i-1;j++) { pri...
分类:其他好文   时间:2014-08-16 09:39:00    阅读次数:176
Protected和Default的区别
private :本类访问;Default :默认,同包访问。Protected:同包访问+子类访问Public :所有均可访问。Private和Public都好说,Default和Protected的区别在于:外包的子类,Default是不能访问的,而Protected确可以访问。问题:1 Pri...
分类:其他好文   时间:2014-08-15 12:24:18    阅读次数:206
PHP Functions
PHP Array 函数定义和用法array_shift() 函数删除数组中的第一个元素,并返回被删除元素的值。注释:如果键是数字的,所有元素都将获得新的键,从 0 开始,并以 1 递增带有数字键:"Dog",1=>"Cat",2=>"Horse");echo array_shift($a);pri...
分类:Web程序   时间:2014-08-14 10:37:28    阅读次数:236
HDU 1026 Ignatius and the Princess I
广搜的一个简单变形,思路还是一样的,依旧是维护一个队列,将一个节点不断的扩展,扩展完后出队。这道题还有两个特点就是:可能遇到怪兽,因此需要额外花费n秒的时间来打败它。最终还要输出路径。因此结构体里面prex 和 prey就是来记录下一个格子的坐标的。因为有了怪兽所以我们不能一搜到起点就退出搜索,因为...
分类:其他好文   时间:2014-08-14 01:17:58    阅读次数:313
输入一个长方形的宽和高(正整数),请打印出它的边长和面积
请输入一个长方形的宽和高(正整数),请打印出它的边长和面积。#include void main(){ int l; // 宽 int high; // 高 int c; //边长 int s; //面积 pri...
分类:其他好文   时间:2014-08-13 00:27:44    阅读次数:253
题目48-小明的调查作业-nyoj20140811
#include //#include int main(){ int N; scanf("%d",&N); int i,num,a[1005]={0}; num=0; while(N--) { scanf("%d",&i); if(a[i]==0) { a[i]=1; num++; } } pri...
分类:其他好文   时间:2014-08-11 14:25:32    阅读次数:185
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!