原创 Chinese Rings 矩陣快速冪

題意:把n個環拆下來的最小步驟 操作:第一個環可一步取走或戴上,要取走或戴上第n個環,前n-2個環必須取走,且第n-1個環還在; 思路:設取走前n個環要f[n]步,此時前n-2個環已取走,因此f[n]=f[n-2]+1,取走第n個環走一步

原创 Goldbach`s Conjecture 素數篩選

Goldbach's conjecture is one of the oldest unsolved problems in number the

原创 Harmonic Number 調和級數的歐拉公式

In mathematics, the nth harmonic number is the sum of the reciprocals of the first n natural numbers: In this problem

原创 UML類圖中關係的表示說明

這篇文章說的很明白,通俗易懂http://www.uml.org.cn/oobject/201211231.asp 下面是我的一些筆記 可見性 名稱:類型 -name:String==private String name; 第一個矩陣

原创 css選擇器

[class*="col-"] 選擇所有類名中含有"col-"的元素 與此類似的還有: [class^="col-"] 選擇所有類名中以"col-"開頭的元素 [class$="-col"] 選擇所有類名中以"-col"結尾的元素

原创 BigInteger 用法詳解

import java.math.BigInteger; import java.util.Scanner;  in = Scanner (System.in); 輸入 while(in.hasNext())             

原创 零起點學算法68——刪除字符

#include <cstdio> #include <cstring> #include <string> int main() { char str[150],ch; while(gets(str)!=NULL) {

原创 中國剩餘定理

公式 編輯 用現代數學的語言來說明的話,中國剩餘定理給出了以下的一元線性同餘方程組: 有解的判定條件,並用構造法給出了在有解情況下解的具體形式。 中國剩餘定理說明:假設整數m1,m2, ... ,mn兩兩互質,則對任意

原创 Strange Way to Express Integers 擴展歐幾里得

題意: 給定數組數據a1,r1,a2,r2,使得存在x,x%a1=r1,x%a2=r2,求出最小的x,沒有輸出-1; 擴展歐幾里得的定義自己去網上搜搜,我這講一些公式的推導。 設 a1*k1+ a2*k2= gcd(a,b); 會求解

原创 java JDK檢驗安裝是否成功

1.設置jdk環境變量(http://blog.csdn.net/afei__/article/details/51464783)這個人講的特別詳細2.在d:\下建一個文件Hello.java,用記事本打開,輸入以下內容public cl

原创 零起點學算法96——折線分割平面(找規律)

#include <cstdio> #include <iostream> #include <cstring> #include <string> #include<algorithm> using namespace std; in

原创 layer實現關閉彈出層刷新父界面功能

用途:js關閉頁面打開的彈出層layer,然後刷新主頁面 window.parent.location.reload(); var index = parent.layer.getFrameIndex(window.name); pare

原创 原生JS添加類名 刪除類名

用途:主要用來給元素動態添加和移除css樣式。將樣式封裝,避免樣式代碼冗餘。 <div class="myDIV"></div> <style> .mystyle{  display="none"; } </style> 爲 <div>

原创 layui.use模塊外部使用其內部定義的js封裝函數

 用途:常用於監聽輸入框(其內部不提供監聽函數)。  用法:需要在 use 中定義 window 函數供外部引用。 // 調用成功  <div class="layui-form-item " >                 <lab

原创 零起點學算法95——骨牌鋪方格(找規律)

#include <cstdio> #include <iostream> #include <cstring> #include <string> #include<algorithm> using namespace std; lo