原创 擴展 GCD板子

 擴展 GCD    求x, y使得gcd(a, b) = a * x + b * y;   int extgcd(int a, int b, int & x, int & y) { if (b == 0) { x=1; y

原创 快速GCD板子

int kgcd(int a, int b) { if (a == 0) return b; if (b == 0) return a; if (!(a & 1) && !(b & 1))

原创 確定比賽名次 -拓撲排序板子

轉載一下學長的模板 有N個比賽隊(1<=N<=500),編號依次爲1,2,3,。。。。,N進行比賽,比賽結束後,裁判委員會要將所有參賽隊伍從前往後依次排名,但現在裁判委員會不能直接獲得每個隊的比賽成績,只知道每場比賽的結果,即P1贏P2,

原创 差分數組-

  #include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> #include<queue> #include<m

原创 RMQ板子

 RMQ是求數組快速查詢區間最大最小值的板子 #include <iostream> #include<cstring> #include<cstdio> #define N 1010 #define mem(a,x) memset(a

原创 Miller-Rabin素性測試-板子-

判斷是否是素數  long long power(long long v, long long p, long long m) { long long r = 1; while(p) { if(p & 1) r = r * v

原创 線段樹板子2

區間修改O(log2(n)) ll st[MAXN<<2],stmin[MAXN<<2],stvis[MAXN<<2],stmax[MAXN<<2]; ll a[MAXN]; void push_up(int rt) { s

原创 成績管理系統-增刪改查

主要功能:  錄入學生信息和成績 修改成績 刪除成績   成績查詢(學號查詢和姓名查詢) 成績排序(以某門科目分數進行排序,或以總分進行排序,或以平均分進行排序)  信息(學生姓名,學生學號,高數,計算機,體育,C語言,大學英語,總分,平

原创 學生成績管理系統

實現 增刪改查 #include<bits/stdc++.h>//萬能頭 #include<windows.h>//特效必備頭 #include<cstdio> #include<algorithm> #include<cstrin

原创 c四則運算自動生成程序

#include<bits/stdc++.h> #include<windows.h> using namespace std; int sum = 0; int rr = 0; int mulu() { puts("請選擇難度:\n

原创 c語言狀態機系統

讀取文件並實現了把裏面的數字讀取出來並加以求平均數  #include<stdio.h> #include<string.h> using namespace std; int a1[1000009]; int r = 0; int s

原创 迪傑斯特拉路徑輸出模板

#include <iostream> #include <cstdio> #include <cstring> #include <queue> using namespace std; const int MAXN = 1e5+5;

原创 南陽理工課程設計-校園導航

    #include<bits/stdc++.h> using namespace std; const int MAXN = 1e5+5; typedef long long LL; const LL INF = 0x3f3f3f

原创 簡述一下文件操作

#include <fstream> #include <iostream> using namespace std; int main () { char data[100]; // 以寫模式打開文件

原创 數獨-dfs

題目描述          數獨是一種運用紙、筆進行演算的邏輯遊戲。玩家需要根據9×9盤面上的已知數字,推理出所有剩餘空格的數字,並滿足每一行、每一列、每一個3*3宮內的數字均含1-9,不重複。 每一道合格的數獨謎題都有且僅有唯一答案,推