原创 重聯通分量(Tarjan+模擬棧)

在求關節點的過程中順便把每個重聯通分量求出。用數組模擬棧。 #include<iostream> #include<cstring> #include<cstdio> using namespace std; #define MAXN 2

原创 Codeforces Round #315 (Div. 2)A. Music

A. Music time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standa

原创 網絡流之標號法

時隔一個月,雜事也都差不多解決好了,新的學期新的開始。這是我初步學習網絡流,爲增廣路問題做一個小的總結,以後有更好的模板再修改。 6 10 //頂點個數和弧數 0 1 8 2 //弧的起點,終點,容量,流量 0 2 4 3 1 3 2 2

原创 hdu 2553 N皇后問題(回溯)

N皇后問題 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 13998 

原创 ( 貪心/並查集)Codeforces Round #480 (Div. 2) C. Posterized

C. Posterizedtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputProfe

原创 基於MNIST設計神經網絡識別手寫數字(version 1.1 兩層結構)

基於MNIST設計神經網絡識別手寫數字     這個項目只用了MNIST的數據集,官網地址是這個點擊打開鏈接。基於tensorflow設計神經網絡,網絡結構只設計了兩層,以後會繼續優化。升級版做出來了,鏈接->基於MNIST設計神經網絡識

原创 TensorBoard:可視化學習

TensorBoard:可視化學習1. 數據序列化如何將數據序列化,使之圖表可視化?對於一個簡單的神經網絡,如下所示:import tensorflow as tf import numpy as np def add_layer(i

原创 (DFS/並查集)Codeforces Round #479 (Div. 3) E. Cyclic Components

E. Cyclic Componentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard out

原创 快速冪取模算法

1.如果b是偶數,我們可以記k = a2 mod c,那麼求(k)b/2 mod c就可以了。 2.如果b是奇數,我們也可以記k = a2 mod c,那麼求 ((k)b/2 mod c × a ) mod c =((k)b/2 mo

原创 bzoj 2783 樹(dfs 前綴和 鄰接表)(中等)

【bzoj2783】[JLOI2012]樹 Description 第一行是兩個整數N和S,其中N是樹的節點數。 第二行是N個正整數,第i個整數表示節點i的正整數。 接下來的N-1行每行是2個整數x和y,表示y是x的兒子。

原创 Tensorflow 基本用法

Tensorflow 基本用法綜述TensorFlow 是一個編程系統, 使用圖來表示計算任務. 圖中的節點被稱之爲 op (operation 的縮寫). 一個 op 獲得 0 個或多個 Tensor, 執行計算, 產生 0 個或多個 

原创 CodeForces 567B Berland National Library(模擬)(簡單)

B. Berland National Library time limit per test 1 second memory limit per test 256 megabytes input standard inp

原创 poj 1149 PIGS(網絡流 BFS 標號法)(困難)

PIGS Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 18402   Accepted: 8373 Description Mirko works

原创 padding='SAME'和'VALID'的區別

In this example: Input width = 13 Filter width = 6 Stride = 5 Notes: "VALID" only ever drops the right-most columns (o

原创 基於MNIST設計神經網絡識別手寫數字(version 2 CNN結構)

基於MNIST設計神經網絡識別手寫數字(version 2 CNN結構)       這是基於卷積神經網絡設計的,他的結構是兩個卷積層加上兩個全連接層。用tf.train.AdamOptimizer()作爲優化器進行優化。準確度比 ver