随笔分类 -  nyist

素数求和问题 (今天见到了一个很不错的标记方法)
摘要:素数求和问题 http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=22时间限制:3000ms | 内存限制:65535KB难度:2描述现在给你N个数(00){ int m = cin.nextInt(); int total = 0; while(m-->0){ int n = cin.nextInt(); if(arr[n]==0) total += n; //标记为0的是素数 } ... 阅读全文
posted @ 2013-12-07 17:21 HPU---张振强 阅读(365) 评论(0) 推荐(0)
stl算法:next_permutation剖析
摘要:stl算法:next_permutation剖析permutation算法class在标准库算法中,next_permutation应用在数列操作上比较广泛.这个函数可以计算一组数据的全排列.但是怎么用,原理如何,我做了简单的剖析.首先查看stl中相关信息.函数原型:template bool next_permutation( BidirectionalIterator_First, BidirectionalIterator_Last );template bool next_permutation( BidirectionalIterator_First, BidirectionalIt 阅读全文
posted @ 2013-11-24 22:40 HPU---张振强 阅读(186) 评论(0) 推荐(0)
南阳10Sking 类似poj1088
摘要:import java.io.BufferedInputStream;import java.util.Scanner;public class poj1088 { static int vis[][];//应该每次初始化。。。。wa了好多次 public static void main(String[] args) { Scanner cin = new Scanner(new BufferedInputStream(System.in)); int n=cin.nextInt(); while(n-->0){ int r = cin.nextInt(); int c = c... 阅读全文
posted @ 2013-08-09 18:40 HPU---张振强 阅读(192) 评论(0) 推荐(0)