摘要:
09、序列计数 到了八九十题一定要考虑效率的问题了,尽量向最好的优化 题目 java static int N; static int count = 0; static final int MOD = 10000; static int[][] mem = new int[1000][1000]; 阅读全文
摘要:
09、分巧克力 题目: public static void main(String[] args) { //练习一下暴力枚举 Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int K = sc.nextInt(); int[] 阅读全文
摘要:
包子问题(动态规划) 1、题目 static int n, g ; static int[] a = new int[101]; static boolean[] f = new boolean[10000]; static int gcd(int a, int b) { if (b == 0) r 阅读全文
摘要:
区间的定义及一些位运算的知识意见 1、区间定义 我们一般都是定义左闭由开,【begin,end】,这样直接 end begin 就是区间长度,for循环默认也是这 2、和 位 运算之间的关系,定义变量:a 、b ==大前提:b必须是2的次幂才有以下优化== 1. a % b = a & (b 1) 阅读全文