原创 【Poj1703】Find them, Catch them(關係並查集)

Find them, Catch them Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 42064   Accepted: 12936 Descrip

原创 java中虛方法的應用舉例

虛方法 我們將介紹在Java中,當設計類時,被重寫的方法的行爲怎樣影響多態性。 我們已經討論了方法的重寫,也就是子類能夠重寫父類的方法。 當子類對象調用重寫的方法時,調用的是子類的方法,而不是父類中被重寫的方法。 要想調用父

原创 【Light OJ 1414】February 29(容斥原理)

February 29 Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %lld & %llu Submit Status Description It

原创 天平平衡(遞歸)

天平平衡 時間限制: 1 Sec  內存限制: 128 MB提交: -  解決: - [提交][狀態][討論版] 題目描述 天平是一種衡器,是衡量物體質量的儀器。它依據槓桿原理製成,在槓桿的兩端各有一小盤,一端放砝碼,另一端放要

原创 【codeforces div2 A】Calculating Function(思維)

A. Calculating Function time limit per test  1 second memory limit per test  256 megabytes input  standard inp

原创 【hihocoder】機會渺茫(map,離散化,概率計算,gcd)

#1284 : 機會渺茫 時間限制:5000ms 單點時限:1000ms 內存限制:256MB 描述 小Hi最近在追求一名學數學的女生小Z。小Z其實是想拒絕他的,但是找不到好的說辭,於是提出了這樣的要求:對於給定的兩個正整

原创 二叉樹的基本操作

二叉樹作爲一種非常重要的數據結構,今天對其做簡單的回顧 1、二叉樹的定義 [cpp] view plain copy typedef char ElementType;      typedef struct

原创 【light oj1078】Integer Divisibility(同餘定理)

PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB If an integer is not divisible by 2

原创 【hdoj5908】Abelian Period

Abelian Period Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/131072 K (Java/Others) Total Submission

原创 【codeforces】Non-square Equation(數學推導)

time limit per test  1 second memory limit per test  256 megabytes input  standard input output  standard out

原创 【codeforces】378BParade(簡單思維+英語閱讀理解-.-)

B. Parade time limit per test 1 second memory limit per test 256 megabytes input standard input output standa

原创 【hihocoder】hiho密碼(水題)

一、問題描述 時間限制:10000ms 單點時限:1000ms 內存限制:256MB 描述 小Ho根據最近在密碼學課上學習到的知識,開發出了一款hiho密碼,這款密碼的祕鑰是這樣生成的:對於一種有N個字母的語言,選擇一

原创 【codeforces486B】OR in Matrix(思維)

B. OR in Matrix time limit per test 1 second memory limit per test 256 megabytes input standard input ou

原创 QAQ的公式求解(一)

QAQ的公式求解(一) 時間限制: 1 Sec  內存限制: 128 MB提交: 113  解決: 51 [提交][狀態][討論版] 題目描述 QAQ給定一個小公式,即:f[i]=f[i−1]∗xf[i]=f[i−1]∗x(i>

原创 【codeforces237C】Primes on Interval

C. Primes on Interval  time limit per test1 second  memory limit per test256 megabytes  inputstandard input  outputsta