原创 priority_queue優先隊列 按照由小到大順序

C++優先隊列的基本使用方法 #include<iostream> #include<functional> #include<queue> using namespace std; struct node {

原创 SDUTOJ 1449 子串

#include<iostream> #include<string.h> #include<stdio.h> using namespace std; char s1[101],s2[21]; int next[105],cont; v

原创 SDUT OJ 2463 學密碼學一定得學程序

#include<iostream> #include<string.h> #include<stdio.h> #define N 10010 #define M 1000100 using namespace std; int next

原创 SDUTOJ 2482 二叉排序樹

#include<iostream> #include<string.h> using namespace std; char c[100],d[100]; int o=0,e=0; typedef struct bitnode { c

原创 SDUTOJ 2476Period

#include<iostream> #include<string.h> #include<stdio.h> #define N 1000010 using namespace std; char s[N]; int next[N];

原创 SDUTOJ 2826 小P尋寶記——好基友一起走

#include<iostream> #include<memory.h> using namespace std; int dp[10010]; int max(int a,int b) { return a>b?a:b; } int

原创 SDUTOJ 2776 小P的故事——神奇的分組

#include<iostream> #include<math.h> #include<memory.h> using namespace std; int dp[200],a[200]; int main() { int n,i,j

原创 SDUTOJ 2127 樹-堆結構練習——合併果子之哈夫曼樹

#include<iostream> #include<stdlib.h> #define N 30000 using namespace std; int a[N+1],o=0; typedef struct { int weigh

原创 SDUTOJ 2713 5-3 多級派生類的構造函數

#include<iostream> #include<string> using namespace std; class Person { protected: string name; int age; char se

原创 SDUTOJ 2712 5-2 派生類的構造函數

#include<iostream> #include<string> using namespace std; class Person { protected: char sex; int age; string name; p

原创 SDUT OJ 2783 小P尋寶記

#include<iostream> #include<memory.h> #define N 10020 using namespace std; int dp[N],pi[N],wi[N]; int max(int a,int b

原创 SDUT OJ 2862 勾股定理

#include<iostream> using namespace std; int a[1010]; void qsort(int a[],int l,int r) { int x=a[l],i=l,j=r; if(l>=r)

原创 SDUTOJ 2128 樹結構練習——排序二叉樹的中序遍歷

#include<iostream> using namespace std; int f; typedef struct BiTNode { int data; struct BiTNode *lchild,*rchild; }Bi

原创 JAVA學習第一課

                                          JAVA概述 首先先複習一下基礎常識: 1.軟件開發 2.人機交互 3.常用的DOS命令 一、軟件開發 什麼是軟件? 軟件是一系列按照

原创 HDU OJ 1016 Prime Ring Problem

#include <iostream> #include <stdio.h> using namespace std; int n,map[30],vis[30]; void dfs(int s[30], int x, int vis[