原创 sgu 135. Drawing Lines 找規律

135. Drawing Linestime limit per test: 0.25 sec. memory limit per test: 4096 KBLittle Johnny likes to draw a lot. A few

原创 sgu 551. Preparing Problem 優先隊列或數學方法?

551. Preparing ProblemTime limit per test: 1 second(s)Memory limit: 262144 kilobytesinput: standardoutput: standardIt i

原创 sgu 172. eXam dfs二分圖判定

172. eXamtime limit per test: 0.25 sec.memory limit per test: 4096 KBinput: standardoutput: standardIn Russia school pu

原创 cf 967 c Stairs and Elevators 二分

C. Stairs and Elevatorstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard

原创 codeforces 1043 F. Make It One 數學?隨機?

https://codeforces.com/contest/1043/problem/F 沒搜到中文題解,看了一下官方題解,翻譯解釋一發。 題意,從n個數中選最少個數的數使得取出的數gcd爲1。數據範圍是n最大3e5,每個數最大3e5.

原创 sgu 549. Dumbbells 排序

549. DumbbellsTime limit per test: 1 second(s)Memory limit: 262144 kilobytesinput: standardoutput: standardA sports sho

原创 sgu 443. Everlasting...? 素數篩

443. Everlasting...?Time limit per test: 0.5 second(s)Memory limit: 262144 kilobytesinput: standardoutput: standardEver

原创 sgu 127. Telephone directory

127. Telephone directorytime limit per test: 0.25 sec. memory limit per test: 4096 KBCIA has decided to create a specia

原创 RSA 簡單實現

rsa.rb 生成公鑰密鑰puts "公鑰密鑰生成程序開始" $bitlen = 1024 # 素數二進制長度 $t = 500 # 費馬小素性測試次數 # 生成隨機大整數且爲奇數 def bignum() len = $bitlen

原创 sgu 406. Goggle

406. GoggleTime limit per test: 0.25 second(s)Memory limit: 65536 kilobytesinput: standardoutput: standardEverybody kno

原创 sgu 217. Two Cylinders 積分

217. Two Cylinderstime limit per test: 0.5 sec.memory limit per test: 65536 KBinput: standardoutput: standardIn this pr

原创 sgu 296. Sasha vs. Kate 貪心

296. Sasha vs. KateTime limit per test: 0.5 second(s)Memory limit: 65536 kilobytesinput: standardoutput: standardDuring

原创 sgu 181. X-Sequence 答案出現循環

181. X-Sequencetime limit per test: 0.25 sec.memory limit per test: 4096 KBinput: standardoutput: standardLet {xi} be t

原创 sgu 118 Digital Root 數學規律

118. Digital Roottime limit per test: 0.25 sec. memory limit per test: 4096 KBLet f(n) be a sum of digits for positive

原创 cf 985 F. Isomorphic Strings 字符串hash

F. Isomorphic Stringstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard ou