摘要: 题目链接数字三角形的加强版,寻找到顶部对100取模最大的,想一想如果枚举的话2^24复杂度肯定会挂,转念一想,肯定都是小于100的数,100个数枚举一下就好。。。开始写了一个不靠谱的程序居然过了9组,也太假了,那个程序只会输出99,后9组数据全是99。。。改了改错,水过了。。。 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 int p[25][25],dp[26][26][101]; 5 int main() 6 { 7 int i,j,k,n; 8 scanf(&quo 阅读全文
posted @ 2012-09-06 19:10 Naix_x 阅读(373) 评论(0) 推荐(0) 编辑
摘要: 第一个Java程序。。。神似去年打hello world的时候,虽然不知道敲的是啥,但是成功迈出第一步了。 1 package main; 2 3 /** 4 * 5 * @author cuizhe 6 */ 7 public class Main { 8 9 /**10 * @param args the command line arguments11 */12 public static void main(String[] args) {13 System.out.println("Hello,Java!");14 ... 阅读全文
posted @ 2012-09-06 15:54 Naix_x 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 题目链接和Vijos上的选课一模一样。。无奈效率700+,怎么这么慢啊。。。 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 struct node 5 { 6 int left,right; 7 }tree[301]; 8 int p[301],dp[301][301]; 9 int max(int a,int b)10 {11 return a > b? a:b;12 }13 void insert(int son,int father)14 {15 int t; 阅读全文
posted @ 2012-09-06 10:36 Naix_x 阅读(247) 评论(8) 推荐(0) 编辑