無名小站已進入全站唯讀模式,12/26服務終止
用來記錄暑假寫了哪些東西 (慢慢補充CODE 一天一題) USACO: 1.3: Calf Flac Prime Cryptarithm Packing Rectangles 1.4: The Clocks Arithmetic Progressions Mother's Milk Number Triangles 1.5: Prime Palindromes SuperPrime Rib Checker Challenge 2.1: The Castle Ordered Fractions Sorting A Three-Valued Sequence Healthy Holsteins Hamming Codes 2.2: Preface Numbering Subset Sums Runaround Numbers Party Lamps The Longest Prefix Cow Pedigrees 2.3: Zero Sum Money Systems Controlling Companies The Tamworth Two 2.4: Overfencing Cow Tours Bessie Come Home Fractions to Decimals UVA 104 Arbitrage 108 Maximum Sum 111 History Grading 113 Power of Cryptography 136 Ugly Numbers 147 Dollars 151 Power Crisis 202 Repeating Decimals 231 Testing the Catcher 240 Variable Radix Huffman Encoding 260 Il Gioco dell'X 275 Expanding Fractions 280 Vertex 291 The House of Santa Claus 294 Divisors 299 Train Swapping 343 What Base Is This? 348 Optimal Array Multiplication Sequence 350 Pseudo-Random Numbers 352 Seasonal War 357 Let Me Count The Ways 369 Combinations 374 Big Mod 402 M*A*S*H 406 Primes Cuts 423 MPI Maelstrom 424 Integer Inquiry 441 Lotto 442 Matrix Chain Multiplication 481 What Goes Up 495 Fibonacci Freeze 497 Strategic Defense Initiative 507 Jill Rides Again 524 Prime Ring Problem 530 Binomial Showdo 531 Compromise 532 Dungeon Master 534 Frogger 543 Goldbach's Conjecture 558 Wormholes 567 Risk 572 Oil Deposits 583 Prime Factors 673 Parentheses Balance 644 Immediate Decodability 674 Coin Change 784 Maze Exploration 928 Eternal Truths 993 Product of digits 10003 Cutting Sticks 10015 Joseph's Cousin 10020 Minimal Coverage 10035 Primary Arithmetic 10048 Audiophobia 10066 The Twin Towers 10075 Airlines 10090 Marbles 10099 Tourist Guide 10104 Euclid Problem 10106 Product 10130 SuperSale 10131 Is Bigger Smarter? 10140 Prime Distance >li>10179 Irreducable Basic Fractions 10192 Vacation 10193 All You Need Is Love 10226 Hardwood Species 10229 Modular Fibonacci 10252 Common Permutation 10261 Ferry Loading 10282 Babelfish 10290 {Sum+=i++} to Reach N 10295 Hay Points 10298 Power Strings 10299 Relative 10306 e-Coins 10311 Goldbach and Euler 10340 All in All 10391 Compound Words 10392 Factoring Large Numbers 10405 Longest Common Subsequence 10440 Ferry Loading II 10465 Homer Simpson 10474 Where is the Marble? 10579 Fibonacci Numbers 10622 Perfect P-th Powers 10664 Luggage 10898 Combo Deal 10945 Mother bear 11221 Magic Square Palindromes 11475 Extend to Palindrome GPE( 數字系列部分與UVA 同 不列出) 2008-01 2008-02 2008-03 2008-04 2008-05 2008-08 2008-09 2008-10 2008-11 2008-12 2008-13 2008-14 2008-15 2008-16 2008-17 2008-18 2008-19 2008-20 2008-21 2008-22 2008-23 2008-24 2008-25 2008-27 2008-29 2008-30 2008-31 2008-32 2008-34 2008-35 2008-36A 2008-36B 2008-37 2008-38 2008-39 2008-40 2009-04 2009-05 2009-07 2009-08 2009-16 2009-17 2009-19 2009-21 2009-22 2009-24 2009-25 2009-26 10002 10116
霍夫曼解碼 上網發現 這題還有一個隱藏規則combination跟letter的fequence一樣的話,combination會比較優先所以她的sample input/output的第二個是有錯誤的 我的AC code跟他不同
我是用Trie下去解當過程中 該點已經是word 或者是 字串結束後 該點依然可以繼續往下 就代表 重複了
類似Josephus 不過是直線的 並非是個圓圈用了LINK-LIST 來建構
單純的判斷是否迴文排除標點符號
跟以往的不同,沒有固定的M M是第ith個質數//http://www.csie.ntnu.edu.tw/~u91029/ModularArithmetic.html//
跟USACO的很像 在找循環小數 紀錄該除數 是否重複出現即可
與543 相似 但是這次要考慮2與質數的組合 且範圍改大先找出(1E)^0.5內的質數 用來判斷N是否為質數
兩題幾乎完全一樣都是在給你一個N輸出 小於N 且互質的數量有多少
輸入一個數字 將此數字 拆成兩個奇數的質數和由 奇+奇=偶 可以得知 輸入的若是奇數 則必無答案
最難的點在於 圓球平面上 任兩點的航線距離上網找到的公式R*acos( cos(a_lat)*cos(b_lat)*cos(a_long-b_long)+sin(a_lat)*sin(b_lat) );
Permutation 的問題 重覆的組合出現一次即可// DFS