原创 PTA KMP 串的模式匹配 (25 分)

#include <bits/stdc++.h> using namespace std; typedef int Pos; #define NotFound -1 void BuildMatch(char *pattern, i

原创 PTA 11-散列2 Hashing (25 分)

#include <bits/stdc++.h> using namespace std; bool isPrime(int n); int main() { #ifdef ONLINE_JUDGE #else freopen(

原创 PTA 7-14 電話聊天狂人 (25 分)

#include <bits/stdc++.h> using namespace std; map<long long, int> p; int main() { #ifdef ONLINE_JUDGE #else freope

原创 PTA 7-15 QQ帳戶的申請與登陸 (25 分)

#include <bits/stdc++.h> using namespace std; map<string, string> M; int main() { #ifdef ONLINE_JUDGE #else freope

原创 PTA 7-13 統計工齡 (20 分)

#include <bits/stdc++.h> using namespace std; int main() { #ifdef ONLINE_JUDGE #else freopen("in.txt", "r", stdin)

原创 PTA 7-16 Sort with Swap(0, i) (25 分)

#include <bits/stdc++.h> using namespace std; struct Elem{ bool isSelec = false; int data; }; int ElemCntinEachCirc

原创 PTA 09-排序2 Insert or Merge (25 分)

#include <bits/stdc++.h> using namespace std; int main() { #ifdef ONLINE_JUDGE #else freopen("in.txt", "r", stdi

原创 PTA 09-排序3 Insertion or Heap Sort (25 分)

#include <bits/stdc++.h> using namespace std; int main() { #ifdef ONLINE_JUDGE #else freopen("in.txt", "r", stdin

原创 PTA 7-12 How Long Does It Take (25 分)

#include <bits/stdc++.h> using namespace std; const int maxn = 100; int mapn[maxn][maxn], dis[maxn]; int in[maxn];

原创 PTA 7-10 公路村村通 (30 分)

#include <bits/stdc++.h> using namespace std; const int inf = 999999; int n, m; //N爲城鎮數目,M爲候選道路數目 int g[1000][1000

原创 12.編寫程序,其功能是從鍵盤輸入n*n個整型數(n≤20),組成n行n列數組,打印出其上三角數組。

#include <stdio.h> int main() { int Matrix[20][20]; int size; int i, j; scanf("%d", &size); for(i = 0; i < si

原创 在Vs中調試查看隊列元素

*((((*((std::_Deque_alloc<std::_Deque_base_types<int,std::allocator<int> > >*)(&((q).c))))._Mypair)._Myval2)._Map),3

原创 中國大學MOOC-陳越、何欽銘-數據結構-2018秋 06-圖3 六度空間 (30 分)

#include <bits/stdc++.h> using namespace std; int const MAXV = 10000; int vertex, edge; int visited[MAXV] = {0}; in