摘要:
http://ac.jobdu.com/problem.php?id=13751.大于N的,肯定需要被改变2.在N以内的,还没出现过的数字,不需要改变3.在N以内的,已经出现过的数字,需要改变 1 #include <stdio.h> 2 int N; 3 bool flag[100002]; 4 void init() 5 { 6 int i; 7 for(i=0;i<=N;i++){ 8 flag[i]=false; 9 }10 }11 12 int main()13 {14 while(scanf("%d",&N)!=EOF){15 ... 阅读全文
posted @ 2012-01-30 18:53
linyvxiang
阅读(270)
评论(0)
推荐(0)
摘要:
http://ac.jobdu.com/problem.php?id=1365基本BFS,好像一个月没写题了。。。写完这题继续看linux源码去。一定要坚持 1 #include <stdio.h> 2 #include <string.h> 3 #include <queue> 4 using namespace std; 5 int N; 6 int num[102][102]; 7 queue<int> Q; 8 int start_x,start_y,end_x,end_y; 9 int x_dire[]={-2,-2,-1,-1,1,1 阅读全文
posted @ 2012-01-30 14:58
linyvxiang
阅读(204)
评论(0)
推荐(0)

浙公网安备 33010602011771号