POJ经典题答案(20201109141908)
POJ题目分类

1000 A+B Problem 送分题1001 Exponentiation 高精度1003 Hangover 送分题1004 Financial Management 送分题1005 I Think I Need a Houseboat 几何1006 Biorhythms 送分题1007 DNA Sorting 送分题1008 Maya Calendar 日期处理1010 STAMPS 搜索+DP1011 Sticks 搜索1012 Joseph 模拟/数学方法1014 Dividing 数论/DP?/组合数学->母函数?1015 Jury Compromise DP1016 Numbers That Count 送分题1017 Packets 贪心1018 Communication System 贪心1019 Number Sequence 送分题1020 Anniversary Cake 搜索1023 The Fun Number System 数论1025 Department 模拟1026 Cipher 组合数学1027 The Same Game 模拟1028 Web Navigation 送分题1031 Fence 计算几何1034 The dog task 计算几何1037 A decorative fence DP/组合数学1039 Pipe 几何1042 Gone Fishing 贪心/DP1045 Bode Plot 送分题(用物理知识)1046 Color Me Less 送分题1047 Round and Round We Go 高精度1048 Follow My Logic 模拟1049 Microprocessor Simulation 模拟1050 To the Max DP1053 Set Me 送分题1054 The Troublesome Frog 搜索1060 Modular multiplication of polynomials 高精度1061 青蛙的约会数论1062 昂贵的聘礼DP1064 Cable master DP/二分查找1065 Wooden Sticks DP1067 取石子游戏博弈论1068 Parencodings 送分题1069 The Bermuda Triangle 搜索1070 Deformed Wheel 几何1071 Illusive Chase 送分题1072 Puzzle Out 搜索1073 The Willy Memorial Program 模拟1074 Parallel Expectations DP1075 University Entrance Examination 模拟1080 Human Gene Functions DP->LCS变形1082 Calendar Game 博弈论1084 Square Destroyer 搜索?1085 Triangle War 博弈论1086 Unscrambling Images 模拟?1087 A Plug for UNIX 图论->最大流1088 滑雪DFS/DP1090 Chain ->格雷码和二进制码的转换1091 跳蚤数论1092 Farmland 几何1093 Formatting Text DP1094 Sorting It All Out 图论->拓扑排序1095 Trees Made to Order 组合数学1096 Space Station Shielding 送分题1097 Roads Scholar 图论1098 Robots 模拟1099 Square Ice 送分题1100 Dreisam Equations 搜索1101 The Game 搜索->BFS1102 LC-Display 送分题1103 Maze 模拟1104 Robbery 递推1106 Transmitters 几何1107 W's Cipher 送分题1110 Double Vision 搜索1111 Image Perimeters 搜索1112 Team Them Up! DP1113 Wall 计算几何->convex hull1119 Start Up the Startup 送分题1120 A New Growth Industry 模拟1122 FDNY to the Rescue! 图论->Dijkstra 1125 Stockbroker Grapevine 图论->Dijkstra 1128 Frame Stacking 搜索1129 Channel Allocation 搜索(图的最大独立集)1131 Octal Fractions 高精度1135 Domino Effect 图论->Dijkstra1137 The New Villa 搜索->BFS1141 Brackets Sequence DP1142 Smith Numbers 搜索1143 Number Game 博弈论1147 Binary codes 构造1148 Utopia Divided 构造1149 PIGS 图论->网络流1151 Atlantis 计算几何->同等安置矩形的并的面积->离散化1152 An Easy Problem! 数论1157 LITTLE SHOP OF FLOWERS DP1158 TRAFFIC LIGHTS 图论->Dijkstra变形1159 Palindrome DP->LCS1160 Post Office DP1161 Walls 图论1162 Building with Blocks 搜索1163 The Triangle DP1170 Shopping Offers DP1177 Picture 计算几何->同等安置矩形的并的周长->线段树1179 Polygon DP1180 Batch Scheduling DP1182 食物链数据结构->并查集1183 反正切函数的应用搜索1184 聪明的打字员搜索1185 炮兵阵地DP->数据压缩1187 陨石的秘密DP(BalkanOI99 Par的拓展)1189 钉子和小球递推?1190 生日蛋糕搜索/DP1191 棋盘分割DP1192 最优连通子集图论->无负权回路的有向图的最长路->BellmanFord 1193 内存分配模拟1194 HIDDEN CODES 搜索+DP1197 Depot 数据结构->Young T ableau1201 Intervals 贪心/图论->最长路->差分约束系统1202 Family 高精度1209 Calendar 日期处理1217 FOUR QUARTERS 递推1218 THE DRUNK JAILER 送分题1233 Street Crossing 搜索->BFS1245 Programmer, Rank Thyself 送分题1247 Magnificent Meatballs 送分题1248 Safecracker 搜索1250 T anning Salon 送分题1251 Jungle Roads 图论->最小生成树1271 Nice Milk 计算几何1273 Drainage Ditches 图论->最大流1274 The Perfect Stall 图论->二分图的最大匹配1275 Cashier Employment 图论->差分约束系统->无负权回路的有向图的最长路->Bellman-Ford1280 Game 递推1281 MANAGER 模拟1286 Necklace of Beads 组合数学->Polya定理1288 Sly Number 数论->解模线性方程组1293 Duty Free Shop DP1298 The Hardest Problem Ever 送分题1316 Self Numbers 递推同Humble Number一样1322 Chocolate 递推/组合数学1323 Game Prediction 贪心1324 Holedox Moving BFS+压缩储存1325 Machine Schedule 图论->二分图的最大匹配1326 Mileage Bank 送分题1327 Moving Object Recognition 模拟?1328 Radar Installation 贪心(差分约束系统的特例)1338 Ugly Numbers 递推(有O(n)算法)1364 King 图论->无负权回路的有向图的最长路->BellmanFord1370 Gossiping (数论->模线性方程有无解的判断)+(图论->DFS)2184 Cow Exhibition DP2190 ISBN 送分题2191 Mersenne Composite Numbers 数论2192 Zipper DP->LCS变形2193 Lenny's Lucky Lotto Lists DP2194 Stacking Cylinders 几何2195 Going Home 图论->二分图的最大权匹配2196 Specialized Four-Digit Numbers 送分题2197 Jill's Tour Paths 图论->2199 Rate of Return 高精度2200 A Card Trick 模拟2210 Metric Time 日期处理2239 Selecting Courses 图论->二分图的最大匹配2243 Knight Moves 搜索->BFS2247 Humble Numbers 递推(最优O(n)算法)2253 Frogger 图论->Dijkstra变形(和1295是一样的)2254 Globetrotter 几何2261 France '98 递推2275 Flipping Pancake 构造2284 That Nice Euler Circuit 计算几何2289 Jamie's Contact Groups 图论->网络流?2291 Rotten Ropes 送分题2292 Optimal Keypad DP2299 Ultra-QuickSort 排序->归并排序2304 Combination Lock 送分题2309 BST 送分题2311 Cutting Game 博弈论2312 Battle City 搜索->BFS2314 POJ language 模拟2315 Football Game 几何2346 Lucky tickets 组合数学2351 Time Zones 时间处理2379 ACM Rank T able 模拟+排序2381 Random Gap 数论2385 Apple Catching DP(像NOI98“免费馅饼”)2388 Who's in the Middle 送分题(排序)2390 Bank Interest 送分题2395 Out of Hay 图论->Dijkstra变形2400 Supervisor, Supervisee 图论->二分图的最大权匹配?2403 Hay Points 送分题2409 Let it Bead 组合数学->Polya定理2416 Return of the Jedi 图论->2417 Discrete Logging 数论2418 Hardwood Species 二分查找2419 Forests 枚举2421 Constructing Roads 图论->最小生成树2423 The Parallel Challenge Ballgame 几何2424 Flo's Restaurant 数据结构->堆2425 A Chess Game 博弈论2426 Remainder BFS2430 Lazy Cows DP->数据压缩1375 Intervals 几何1379 Run Away 计算几何->1380 Equipment Box 几何1383 Labyrinth 图论->树的最长路1394 Railroad 图论->Dijkstra1395 Cog-Wheels 数学->解正系数的线性方程组1408 Fishnet 几何1411 Calling Extraterrestrial Intelligence Again 送分题1430 Binary Stirling Numbers 日期处理1431 Calendar of Maya 模拟1432 Decoding Morse Sequences DP1434 Fill the Cisterns! 计算几何->离散化/1445 Random number 数据结构->碓1447 Ambiguous Dates 日期处理1450 Gridland 图论(本来TSP问题是NP难的,但这个图比较特殊,由现成的构造方法)1458 Common Subsequence DP->LCS1459 Power Network 图论->最大流1462 Random Walk 模拟+解线性方程组1463 Strategic game 贪心1466 Girls and Boys 图论->n/a1469 COURSES 贪心1475 Pushing Boxes DP1476 Always On the Run 搜索->BFS1480 Optimal Programs 搜索->BFS1481 The Die Is Cast 送分题1482 It's not a Bug, It's a Feature! 搜索->BFS1483 Going in Circles on Alpha Centauri 模拟1484 Blowing Fuses 送分题1485 Fast Food DP(似乎就是ioi2000的postoffice)1486 Sorting Slides 图论->拓扑排序1505 Copying Books DP+二分查找1510 Hares and Foxes 数论1512 Keeps Going and Going and ... 模拟1513 Scheduling Lectures DP1514 Metal Cutting 几何1515 Street Directions 图论->把一个无向连通图改造成为有向强连通图1517 u Calculate e 送分题1518 Problem Bee 几何1519 Digital Roots 送分题(位数可能很大)1520 Scramble Sort 排序1547 Clay Bully 送分题1555 Polynomial Showdown 送分题(非常阴险)1563 The Snail 送分题1601 Pizza Anyone? 搜索1604 Just the Facts 送分题1605 Horse Shoe Scoring 几何1606 Jugs 数论/搜索1631 Bridging signals DP+二分查找1632 Vase collection 图论->最大完全图1633 Gladiators DP1634 Who's the boss? 排序1635 Subway tree systems 图论->不同表示法的二叉树判同1637 Sightseeing tour 图论->欧拉回路1638 A number game 博弈论1639 Picnic Planning 图论->1641 Rational Approximation 数论1646 Double Trouble 高精度1654 Area 几何1657 Distance on Chessboard 送分题1658 Eva's Problem 送分题1660 Princess FroG 构造1661 Help Jimmy DP1663 Number Steps 送分题1664 放苹果组合数学->递推1677 Girls' Day 送分题1688 Dolphin Pool 计算几何1690 (Your)((Term)((Project))) 送分题1691 Painting A Board 搜索/DP1692 Crossed Matchings DP1693 Counting Rectangles 几何1694 An Old Stone Game 博弈论?1695 Magazine Delivery 图论->1712 Flying Stars DP1713 Divide et unita 搜索1714 The Cave 搜索/DP1717 Dominoes DP1718 River Crossing DP1719 Shooting Contest 贪心1729 Jack and Jill 图论->1730 Perfect Pth Powers 数论1732 Phone numbers DP1734 Sightseeing trip 图论->Euler回路1738 An old Stone Game 博弈论?1741 Tree 博弈论?1745 Divisibility DP1751 Highways 图论->1752 Advertisement 贪心/图论->差分约束系统1753 Flip Game 搜索->BFS1755 Triathlon 计算几何?1770 Special Experiment 树形DP1771 Elevator Stopping Plan DP1772 New Go Game 构造?1773 Outernet 模拟1774 Fold Paper Strips 几何1775 Sum of Factorials 送分题1776 T ask Sequences DP1777 Vivian's Problem 数论1870 Bee Breeding 送分题1871 Bullet Hole 几何1872 A Dicey Problem BFS1873 The Fortified Forest 几何+回溯1874 Trade on Verweggistan DP1875 Robot 几何1876 The Letter Carrier's Rounds 模拟1877 Flooded! 数据结构->堆1879 Tempus et mobilius Time and motion 模拟+组合数学->Polya定理1882 Stamps 搜索+DP1883 Theseus and the Minotaur 模拟1887 Testing the CATCHER DP1889 Package Pricing DP1893 Monitoring Wheelchair Patients 模拟+几何1915 Knight Moves 搜索->BFS1916 Rat Attack 数据结构->?1936 All in All DP?1946 Cow Cycling DP1947 Rebuilding Roads 二分1985 Cow Marathon 图论->有向无环图的最长路1995 Raising Modulo Numbers 数论->大数的幂求余2049 Finding Nemo 图论->最短路2050 Searching the Web 模拟(需要高效实现)2051 Argus 送分题(最好用堆,不用也可以过)2054 Color a Tree 贪心2061 Pseudo-random Numbers 数论2080 Calendar 日期处理2082 Terrible Sets 分治/2083 Fractal 递归2084 Game of Connections 递推(不必高精度)2105 IP Address 送分题2115 C Looooops 数论->解模线性方程2136 Vertical Histogram 送分题2165 Gunman 计算几何2179 Inlay Cutters 枚举2181 Jumping Cows 递推2182 Lost Cows ->线段树/=============================================1370 Gossiping (数论->模线性方程有无解的判断)+(图论->DFS)1090 Chain ->格雷码和二进制码的转换2182 Lost Cows ->线段树/2426 Remainder BFS1872 A Dicey Problem BFS1324 Holedox Moving BFS+压缩储存1088 滑雪DFS/DP1015 Jury Compromise DP1050 To the Max DP1062 昂贵的聘礼DP1065 Wooden Sticks DP1074 Parallel Expectations DP1093 Formatting Text DP1112 Team Them Up! DP1141 Brackets Sequence DP1157 LITTLE SHOP OF FLOWERS DP1160 Post Office DP1163 The Triangle DP1170 Shopping Offers DP1179 Polygon DP1180 Batch Scheduling DP1191 棋盘分割DP1293 Duty Free Shop DP2184 Cow Exhibition DP2193 Lenny's Lucky Lotto Lists DP2292 Optimal Keypad DP1432 Decoding Morse Sequences DP1475 Pushing Boxes DP1513 Scheduling Lectures DP1633 Gladiators DP1661 Help Jimmy DP1692 Crossed Matchings DP1712 Flying Stars DP1717 Dominoes DP1718 River Crossing DP1732 Phone numbers DP1745 Divisibility DP1771 Elevator Stopping Plan DP1776 T ask Sequences DP1874 Trade on Verweggistan DP1887 Testing the CATCHER DP1889 Package Pricing DP1946 Cow Cycling DP1187 陨石的秘密DP(BalkanOI99 Par的拓展)1485 Fast Food DP(似乎就是ioi2000的postoffice) 2385 Apple Catching DP(像NOI98“免费馅饼”) 1064 Cable master DP/二分查找1037 A decorative fence DP/组合数学1936 All in All DP?1505 Copying Books DP+二分查找1631 Bridging signals DP+二分查找1159 Palindrome DP->LCS1458 Common Subsequence DP->LCS1080 Human Gene Functions DP->LCS变形2192 Zipper DP->LCS变形1185 炮兵阵地DP->数据压缩2430 Lazy Cows DP->数据压缩1067 取石子游戏博弈论1082 Calendar Game 博弈论1085 Triangle War 博弈论1143 Number Game 博弈论2311 Cutting Game 博弈论2425 A Chess Game 博弈论1638 A number game 博弈论1694 An Old Stone Game 博弈论?1738 An old Stone Game 博弈论?1741 Tree 博弈论?2083 Fractal 递归1104 Robbery 递推1217 FOUR QUARTERS 递推1280 Game 递推2261 France '98 递推2181 Jumping Cows 递推1316 Self Numbers 递推同Humble Number一样2084 Game of Connections 递推(不必高精度) 1338 Ugly Numbers 递推(有O(n)算法)2247 Humble Numbers 递推(最优O(n)算法)1322 Chocolate 递推/组合数学1189 钉子和小球递推?1947 Rebuilding Roads 二分2418 Hardwood Species 二分查找2082 Terrible Sets 分治/1001 Exponentiation 高精度1047 Round and Round We Go 高精度1060 Modular multiplication of polynomials 高精度1131 Octal Fractions 高精度1202 Family 高精度2199 Rate of Return 高精度1646 Double Trouble 高精度1147 Binary codes 构造1148 Utopia Divided 构造2275 Flipping Pancake 构造1660 Princess FroG 构造1772 New Go Game 构造?1005 I Think I Need a Houseboat 几何1039 Pipe 几何1070 Deformed Wheel 几何1092 Farmland 几何1106 Transmitters 几何2194 Stacking Cylinders 几何2254 Globetrotter 几何2315 Football Game 几何2423 The Parallel Challenge Ballgame 几何1375 Intervals 几何1380 Equipment Box 几何1408 Fishnet 几何1514 Metal Cutting 几何1518 Problem Bee 几何1605 Horse Shoe Scoring 几何1654 Area 几何1693 Counting Rectangles 几何1774 Fold Paper Strips 几何1871 Bullet Hole 几何1875 Robot 几何1873 The Fortified Forest 几何+回溯1031 Fence 计算几何1034 The dog task 计算几何1271 Nice Milk 计算几何2284 That Nice Euler Circuit 计算几何1688 Dolphin Pool 计算几何2165 Gunman 计算几何1755 Triathlon 计算几何?1379 Run Away 计算几何->1113 Wall 计算几何->convex hull1434 Fill the Cisterns! 计算几何->离散化/1151 Atlantis 计算几何->同等安置矩形的并的面积->离散化1177 Picture 计算几何->同等安置矩形的并的周长->线段树2419 Forests 枚举2179 Inlay Cutters 枚举1025 Department 模拟1027 The Same Game 模拟1048 Follow My Logic 模拟1049 Microprocessor Simulation 模拟1073 The Willy Memorial Program 模拟1075 University Entrance Examination 模拟1098 Robots 模拟1103 Maze 模拟1120 A New Growth Industry 模拟1193 内存分配模拟1281 MANAGER 模拟2200 A Card Trick 模拟2314 POJ language 模拟1431 Calendar of Maya 模拟1483 Going in Circles on Alpha Centauri 模拟1512 Keeps Going and Going and ... 模拟1773 Outernet 模拟1876 The Letter Carrier's Rounds 模拟1883 Theseus and the Minotaur 模拟2050 Searching the Web 模拟(需要高效实现)1012 Joseph 模拟/数学方法1086 Unscrambling Images 模拟?1327 Moving Object Recognition 模拟?1893 Monitoring Wheelchair Patients 模拟+几何1462 Random Walk 模拟+解线性方程组2379 ACM Rank T able 模拟+排序1879 Tempus et mobilius Time and motion 模拟+组合数学->Polya定理1520 Scramble Sort 排序1634 Who's the boss? 排序2299 Ultra-QuickSort 排序->归并排序1008 Maya Calendar 日期处理1209 Calendar 日期处理2210 Metric Time 日期处理1430 Binary Stirling Numbers 日期处理1447 Ambiguous Dates 日期处理2080 Calendar 日期处理2351 Time Zones 时间处理1770 Special Experiment 树形DP1916 Rat Attack 数据结构->?1197 Depot 数据结构->Young T ableau1182 食物链数据结构->并查集2424 Flo's Restaurant 数据结构->堆1877 Flooded! 数据结构->堆1445 Random number 数据结构->碓1023 The Fun Number System 数论1061 青蛙的约会数论1091 跳蚤数论1152 An Easy Problem! 数论2191 Mersenne Composite Numbers 数论2381 Random Gap 数论2417 Discrete Logging 数论1510 Hares and Foxes 数论1641 Rational Approximation 数论1730 Perfect Pth Powers 数论1777 Vivian's Problem 数论2061 Pseudo-random Numbers 数论1014 Dividing 数论/DP?/组合数学->母函数?1606 Jugs 数论/搜索1995 Raising Modulo Numbers 数论->大数的幂求余2115 C Looooops 数论->解模线性方程1288 Sly Number 数论->解模线性方程组1395 Cog-Wheels 数学->解正系数的线性方程组1000 A+B Problem 送分题1003 Hangover 送分题1004 Financial Management 送分题1006 Biorhythms 送分题1007 DNA Sorting 送分题1016 Numbers That Count 送分题1019 Number Sequence 送分题1028 Web Navigation 送分题1046 Color Me Less 送分题1053 Set Me 送分题1068 Parencodings 送分题1071 Illusive Chase 送分题1096 Space Station Shielding 送分题1099 Square Ice 送分题1102 LC-Display 送分题1107 W's Cipher 送分题1119 Start Up the Startup 送分题1218 THE DRUNK JAILER 送分题1245 Programmer, Rank Thyself 送分题1247 Magnificent Meatballs 送分题1250 T anning Salon 送分题1298 The Hardest Problem Ever 送分题1326 Mileage Bank 送分题2190 ISBN 送分题2196 Specialized Four-Digit Numbers 送分题2291 Rotten Ropes 送分题2304 Combination Lock 送分题2309 BST 送分题2390 Bank Interest 送分题2403 Hay Points 送分题1411 Calling Extraterrestrial Intelligence Again 送分题1481 The Die Is Cast 送分题1484 Blowing Fuses 送分题1517 u Calculate e 送分题1547 Clay Bully 送分题1563 The Snail 送分题1604 Just the Facts 送分题1657 Distance on Chessboard 送分题1658 Eva's Problem 送分题1663 Number Steps 送分题1677 Girls' Day 送分题1690 (Your)((Term)((Project))) 送分题1775 Sum of Factorials 送分题1870 Bee Breeding 送分题2105 IP Address 送分题2136 Vertical Histogram 送分题1555 Polynomial Showdown 送分题(非常阴险) 2388 Who's in the Middle 送分题(排序)1519 Digital Roots 送分题(位数可能很大)1045 Bode Plot 送分题(用物理知识)2051 Argus 送分题(最好用堆,不用也可以过) 1011 Sticks 搜索1020 Anniversary Cake 搜索1054 The Troublesome Frog 搜索1069 The Bermuda Triangle 搜索1072 Puzzle Out 搜索1100 Dreisam Equations 搜索1110 Double Vision 搜索1111 Image Perimeters 搜索1128 Frame Stacking 搜索1142 Smith Numbers 搜索1162 Building with Blocks 搜索1183 反正切函数的应用搜索1184 聪明的打字员搜索1248 Safecracker 搜索1601 Pizza Anyone? 搜索1713 Divide et unita 搜索1129 Channel Allocation 搜索(图的最大独立集)1190 生日蛋糕搜索/DP1691 Painting A Board 搜索/DP1714 The Cave 搜索/DP1084 Square Destroyer 搜索?1010 STAMPS 搜索+DP1194 HIDDEN CODES 搜索+DP1882 Stamps 搜索+DP1101 The Game 搜索->BFS1137 The New Villa 搜索->BFS1233 Street Crossing 搜索->BFS2243 Knight Moves 搜索->BFS2312 Battle City 搜索->BFS1476 Always On the Run 搜索->BFS1480 Optimal Programs 搜索->BFS1482 It's not a Bug, It's a Feature! 搜索->BFS 1753 Flip Game 搜索->BFS1915 Knight Moves 搜索->BFS1017 Packets 贪心1018 Communication System 贪心1323 Game Prediction 贪心1463 Strategic game 贪心1469 COURSES 贪心1719 Shooting Contest 贪心2054 Color a Tree 贪心1328 Radar Installation 贪心(差分约束系统的特例)1042 Gone Fishing 贪心/DP1752 Advertisement 贪心/图论->差分约束系统1201 Intervals 贪心/图论->最长路->差分约束系统1097 Roads Scholar 图论1161 Walls 图论1450 Gridland 图论(本来TSP问题是NP难的,但这个图比较特殊,由现成的构造方法)2197 Jill's Tour Paths 图论->2416 Return of the Jedi 图论->1639 Picnic Planning 图论->1695 Magazine Delivery 图论->1729 Jack and Jill 图论->1751 Highways 图论->1122 FDNY to the Rescue! 图论->Dijkstra1125 Stockbroker Grapevine 图论->Dijkstra1135 Domino Effect 图论->Dijkstra1394 Railroad 图论->Dijkstra1158 TRAFFIC LIGHTS 图论->Dijkstra变形2395 Out of Hay 图论->Dijkstra变形2253 Frogger 图论->Dijkstra变形(和1295是一样的)1734 Sightseeing trip 图论->Euler回路1466 Girls and Boys 图论->n/a1515 Street Directions 图论->把一个无向连通图改造成为有向强连通图1635 Subway tree systems 图论->不同表示法的二叉树判同1275 Cashier Employment 图论->差分约束系统->无负权回路的有向图的最长路->Bellman-Ford1274 The Perfect Stall 图论->二分图的最大匹配1325 Machine Schedule 图论->二分图的最大匹配2239 Selecting Courses 图论->二分图的最大匹配2195 Going Home 图论->二分图的最大权匹配2400 Supervisor, Supervisee 图论->二分图的最大权匹配?1637 Sightseeing tour 图论->欧拉回路1383 Labyrinth 图论->树的最长路1094 Sorting It All Out 图论->拓扑排序1486 Sorting Slides 图论->拓扑排序1149 PIGS 图论->网络流2289 Jamie's Contact Groups 图论->网络流?1192 最优连通子集图论->无负权回路的有向图的最长路->BellmanFord 1364 King 图论->无负权回路的有向图的最长路->BellmanFord1985 Cow Marathon 图论->有向无环图的最长路1087 A Plug for UNIX 图论->最大流1273 Drainage Ditches 图论->最大流1459 Power Network 图论->最大流1632 Vase collection 图论->最大完全图2049 Finding Nemo 图论->最短路1251 Jungle Roads 图论->最小生成树2421 Constructing Roads 图论->最小生成树1026 Cipher 组合数学1095 Trees Made to Order 组合数学2346 Lucky tickets 组合数学1286 Necklace of Beads 组合数学->Polya定理2409 Let it Bead 组合数学->Polya定理1664 放苹果组合数学->递推。
POJGrids基本练习题资料

POJ Grids基本练习题资料POJ——1004 Financial Management .............................................. - 3 -POJ——1664 放苹果 ........................................................................ - 5 -POJ——2675 计算书费...................................................................... - 7 -POJ——2676 整数的个数................................................................... - 9 -POJ——2679 整数的立方和.............................................................. - 11 -POJ——2680化验诊断 .................................................................... - 12 -POJ——2684 求阶乘的和................................................................. - 15 -POJ——2687数组逆序重放............................................................... - 16 -POJ——2688求字母的个数............................................................... - 17 -POJ——2689 大小写字母互换 ........................................................... - 18 -POJ——2694逆波兰表达式............................................................... - 19 -POJ——2696 计算表达式的值 ........................................................... - 20 -POJ——2699自整除数 .................................................................... - 22 -POJ——2701 与7无关的数 ............................................................. - 23 -POJ——2702密码翻译 .................................................................... - 24 -POJ——2703骑车与走路.................................................................. - 26 -POJ——2707求一元二次方程的根....................................................... - 27 -POJ——2714求平均年龄.................................................................. - 29 -POJ——2715 谁拿了最多的奖学金...................................................... - 30 -POJ——2718晶晶赴约会.................................................................. - 32 -POJ——2719陶陶摘苹果.................................................................. - 33 -POJ——2720 大象喝水.................................................................... - 34 -POJ——2722 学分绩点.................................................................... - 35 -POJ——2733判断闰年 .................................................................... - 37 -POJ——2734十进制到八进制............................................................ - 38 -POJ——2750 鸡兔同笼.................................................................... - 39 -POJ——2753菲波那契数列............................................................... - 40 -POJ——2758 菲波那契数列(2) ......................................................... - 41 -POJ——2764数根.......................................................................... - 42 -POJ——2767简单密码 .................................................................... - 44 -POJ——2780 Eva’s Problem ......................................................... - 47 -POJ——2786 Pell数列................................................................... - 48 -POJ——2796数字求和 .................................................................... - 49 -POJ——2807两倍.......................................................................... - 50 -POJ ——2808校门外的树................................................................. - 52 -POJ——2856 计算邮资.................................................................... - 54 -POJ——2870 求矩阵的加法.............................................................. - 56 -POJ——2871 整数奇偶排序.............................................................. - 58 -POJ——2882 Program I ............................................................... - 60 -POJ——2883 checking order ........................................................ - 62 -POJ——2886能被3除尽的数之和...................................................... - 64 -POJ——2887 能被3、5、7整除的数 ................................................. - 65 -POJ——2888字符串中的数字............................................................ - 67 -POJ——2926算数运算 .................................................................... - 69 -POJ——2927判断数字个数............................................................... - 70 -POJ——2930 加减乘除.................................................................... - 72 -POJ——2933停车场收费.................................................................. - 74 -POJ——2938 按顺序输出................................................................. - 76 -POJ——2943 小白鼠排队................................................................. - 77 -POJ——3142 球弹跳高度的计算......................................................... - 79 -POJ——3164 奇偶排序.................................................................... - 80 -POJ——3195最大公约数.................................................................. - 81 -POJ——3248 最大公约数................................................................. - 82 -POJ——3255 十进制到六进制 ........................................................... - 84 -POJ——3670 计算鞍点.................................................................... - 86 -POJ——3708 1的个数.................................................................... - 88 -POJ——3756多边形内角和............................................................... - 90 -POJ——1004 Financial Management思路:这道题就是计算一下12个月的平均工资。
2020高考数学(理)二轮专题复习专题02 常用逻辑用语真题分项版解析(解析版)

一、选择题1.设θ∈R ,则“ππ||1212θ-<”是“1sin 2θ<”的( ) (A )充分而不必要条件 (B )必要而不充分条件(C )充要条件(D )既不充分也不必要条件 【答案】A【解析】πππ||012126θθ-<⇔<< 1sin 2θ⇒<,但10,sin 2θθ=<,不满足 ππ||1212θ-<,所以是充分不必要条件,选A. 【考点】 充要条件件,若B 是A 的真子集,则A 是B 的必要不充分条件。
2.已知命题p:;命题q :若a >b ,则,下列命题为真命题的是( )(A ) ∧p q (B )⌝∧p q (C ) ⌝∧p q (D )⌝⌝∧p q 【答案】B【解析】试题分析:由时有意义,知p 是真命题,由可知q 是假命题,即均是真命题,故选B.【考点】1.简易逻辑联结词.2.全称命题.【名师点睛】解答简易逻辑联结词相关问题,关键是要首先明确各命题的真假,利用或、且、非真值表,进一步作出判断.3.命题“*x n ∀∈∃∈,R N ,使得2n x >”的否定形式是( )A .*x n ∀∈∃∈,R N ,使得2n x < B .*x n ∀∈∀∈,R N ,使得2n x < C .*x n ∃∈∃∈,R N ,使得2n x < D .*x n ∃∈∀∈,R N ,使得2n x <【答案】D 【解析】试题分析:∀的否定是∃,∃的否定是∀,2n x ≥的否定是2n x <.故选D . 考点:全称命题与特称命题的否定.【方法点睛】全称命题的否定是特称命题,特称命题的否定是全称命题.对含有存在(全称)量词的命题进行否定需要两步操作:①将存在(全称)量词改成全称(存在)量词;②将结论加以否定.4.已知直线a ,b 分别在两个不同的平面α,β内.则“直线a 和直线b 相交”是“平面α和平面β相交”的( ) (A )充分不必要条件(B )必要不充分条件 (C )充要条件(D )既不充分也不必要条件【答案】A 【解析】 试题分析:“直线a 和直线b 相交”⇒“平面α和平面β相交”,但“平面α和平面β相交”⇒“直线a 和直线b 相交”,所以“直线a 和直线b 相交”是“平面α和平面β相交”的充分不必要条件,故选A .考点:1.充要条件;2.直线与平面的位置关系.能力等。
定积分典型例题20例答案之欧阳家百创编

定积分典型例题20例答案欧阳家百(2021.03.07)例1 求3321lim )n n n→∞+.分析 将这类问题转化为定积分主要是确定被积函数和积分上下限.若对题目中被积函数难以想到,可采取如下方法:先对区间[0,1]n 等分写出积分和,再与所求极限相比较来找出被积函数与积分上下限.解 将区间[0,1]n 等分,则每个小区间长为1i x n∆=,然后把2111n n n=⋅的一个因子1n 乘入和式中各项.于是将所求极限转化为求定积分.即3321lim)n n n →∞+=31lim )n n n n →∞+=34=⎰.例2 0⎰=_________.解法 1 由定积分的几何意义知,0⎰等于上半圆周22(1)1x y -+= (0y ≥)与x 轴所围成的图形的面积.故0⎰=2π.解法 2 本题也可直接用换元法求解.令1x -=sin t(22t ππ-≤≤),则0⎰=22tdt ππ-⎰=2tdt =2202cos tdt π⎰=2π 例3 (1)若22()x t x f x e dt -=⎰,则()f x '=___;(2)若0()()xf x xf t dt =⎰,求()f x '=___.分析 这是求变限函数导数的问题,利用下面的公式即可()()()[()]()[()]()v x u x d f t dt f v x v x f u x u x dx ''=-⎰.解 (1)()f x '=422xxxe e ---;(2) 由于在被积函数中x 不是积分变量,故可提到积分号外即0()()xf x x f t dt =⎰,则可得()f x '=0()()xf t dt xf x +⎰.例4 设()f x 连续,且31()x f t dt x -=⎰,则(26)f =_________.解 对等式31()x f t dt x -=⎰两边关于x 求导得32(1)31f x x -⋅=,故321(1)3f x x -=,令3126x -=得3x =,所以1(26)27f =. 例5函数1()(3(0)xF x dt x =>⎰的单调递减开区间为_________.解()3F x '=,令()0F x '<得3>,解之得109x <<,即1(0,)9为所求.例6 求0()(1)arctan xf x t tdt =-⎰的极值点.解 由题意先求驻点.于是()f x '=(1)arctan x x -.令()f x '=0,得x 故1x =为()f x 的极大值点,0x =为极小值点.例7 已知两曲线()y f x =与()y g x =在点(0,0)处的切线相同,其中2arcsin 0()x t g x e dt -=⎰,[1,1]x ∈-,试求该切线的方程并求极限3lim ()n nf n→∞.分析 两曲线()y f x =与()y g x =在点(0,0)处的切线相同,隐含条件(0)(0)f g =,(0)(0)f g ''=.解 由已知条件得2(0)(0)0t f g e dt -===⎰,且由两曲线在(0,0)处切线斜率相同知(0)(0)1f g =''===.故所求切线方程为y x =.而3()(0)3lim ()lim33(0)330n n f f n nf f n n→∞→∞-'=⋅==-. 例8 求 22000sin lim(sin )x x xtdtt t t dt→-⎰⎰;分析 该极限属于00型未定式,可用洛必达法则.解 22000sin lim (sin )x x xtdtt t t dt→-⎰⎰=2202(sin )lim (1)(sin )x x x x x x →-⋅⋅-=220()(2)limsin x x x x→-⋅-=304(2)lim 1cos x x x→-⋅-=2012(2)limsin x x x→-⋅=0.注 此处利用等价无穷小替换和多次应用洛必达法则. 例9 试求正数a 与b,使等式201lim1sin x x x b x →=-⎰成立. 分析 易见该极限属于00型的未定式,可用洛必达法则.解2001lim sin x x x b x →-⎰=20x →=20lim 1cos x x x b x →→-2011cos x x b x →==-,由此可知必有0lim(1cos )0x b x →-=,得1b =.又由2011cos x x x →==-, 得4a =.即4a =,1b =为所求. 例10 设sin 20()sin x f x t dt =⎰,34()g x x x =+,则当0x →时,()f x 是()g x 的( ).A .等价无穷小.B .同阶但非等价的无穷小.C .高阶无穷小. D .低阶无穷小.解法1 由于 22300()sin(sin )cos lim lim()34x x f x x xg x x x →→⋅=+ 22011lim 33x x x →==. 故()f x 是()g x 同阶但非等价的无穷小.选B .解法2 将2sin t 展成t 的幂级数,再逐项积分,得到sin 223370111()[()]sin sin 3!342x f x t t dt x x =-+=-+⎰,则344340001111sin (sin )sin ()1342342lim lim lim ()13x x x x x x f x g x x x x→→→-+-+===++. 例11 计算21||x dx -⎰.分析 被积函数含有绝对值符号,应先去掉绝对值符号然后再积分.解 21||x dx -⎰=0210()x dx xdx --+⎰⎰=220210[][]22x x --+=52.注 在使用牛顿-莱布尼兹公式时,应保证被积函数在积分区间上满足可积条件.如33222111[]6dx x x --=-=⎰,则是错误的.错误的原因则是由于被积函数21x 在0x =处间断且在被积区间内无界.例12 设()f x 是连续函数,且10()3()f x x f t dt =+⎰,则()________f x =.分析 本题只需要注意到定积分()b af x dx ⎰是常数(,a b 为常数).解 因()f x 连续,()f x 必可积,从而10()f t dt ⎰是常数,记1()f t dt a =⎰,则()3f x x a =+,且11(3)()x a dx f t dt a +==⎰⎰.所以2101[3]2x ax a +=,即132a a +=,从而14a =-,所以 3()4f x x =-.例13 计算21-⎰.分析 由于积分区间关于原点对称,因此首先应考虑被积函数的奇偶性.解 21-⎰=211--+⎰⎰2是偶是奇函数,有10-=⎰, 于是21-⎰=214⎰=04⎰=1044dx -⎰⎰ 由定积分的几何意义可知4π=⎰, 故2114444dx ππ-=-⋅=-⎰⎰.例14 计算220()xd tf x t dt dx -⎰,其中()f x 连续. 分析 要求积分上限函数的导数,但被积函数中含有x ,因此不能直接求导,必须先换元使被积函数中不含x ,然后再求导.解 由于220()xtf x t dt -⎰=2221()2x f x t dt -⎰.故令22x t u -=,当0t =时2u x =;当t x =时0u =,而2dt du =-,所以220()xtf x t dt -⎰=201()()2x f u du -⎰=201()2x f u du ⎰, 故220()x d tf x t dt dx -⎰=201[()]2x d f u du dx ⎰=21()22f x x ⋅=2()xf x . 错误解答220()xd tf x t dt dx -⎰22()(0)xf x x xf =-=. 错解分析 这里错误地使用了变限函数的求导公式,公式 中要求被积函数()f t 中不含有变限函数的自变量x ,而22()f x t -含有x ,因此不能直接求导,而应先换元. 例15 计算30sin x xdx π⎰.分析 被积函数中出现幂函数与三角函数乘积的情形,通常采用分部积分法.解 30sin x xdx π⎰30(cos )xd x π=-⎰330[(cos )](cos )x x x dx ππ=⋅---⎰30cos 6xdx ππ=-+⎰6π=-. 例16 计算120ln(1)(3)x dx x +-⎰.分析 被积函数中出现对数函数的情形,可考虑采用分部积分法.解 120ln(1)(3)x dx x +-⎰=101ln(1)()3x d x+-⎰=1100111[ln(1)]3(3)(1)x dx x x x +-⋅--+⎰=101111ln 2()2413dx x x-++-⎰ 11ln 2ln324=-. 例17 计算20sin x e xdx π⎰.分析 被积函数中出现指数函数与三角函数乘积的情形通常要多次利用分部积分法.解 由于20sin xe xdx π⎰20sin xxde π=⎰220[sin ]cos xx e x e xdx ππ=-⎰220cos x e e xdxππ=-⎰,(1) 而20sin 1x e xdx π=-⎰, (2)将(2)式代入(1)式可得20sin xe xdx π⎰220[sin 1]x e e xdx ππ=--⎰,故20sin xe xdx π⎰21(1)2e π=+.例18 计算10arcsin x xdx ⎰.分析 被积函数中出现反三角函数与幂函数乘积的情形,通常用分部积分法.解 10arcsin x xdx ⎰210arcsin ()2x xd =⎰221100[arcsin ](arcsin )22x x x d x =⋅-⎰21142π=-⎰. (1)令sin x t =,则201cos22t dt π-==⎰20sin 2[]24t t π-4π=. (2)将(2)式代入(1)式中得1arcsin x xdx =⎰8π.例19设()f x [0,]π上具有二阶连续导数,()3f π'=且[()()]cos 2f x f x xdx π''+=⎰,求(0)f '.分析 被积函数中含有抽象函数的导数形式,可考虑用分部积分法求解.解 由于0[()()]cos f x f x xdx π''+⎰0()sin cos ()f x d x xdf x ππ'=+⎰⎰()(0)2f f π''=--=.故 (0)f '=2()235f π'--=--=-. 例20 计算243dxx x +∞++⎰. 分析 该积分是无穷限的的反常积分,用定义来计算. 解 2043dx x x +∞++⎰=20lim 43t t dx x x →+∞++⎰=0111lim ()213t t dx x x →+∞-++⎰=011lim [ln ]23t t x x →+∞++=111lim (ln ln )233t t t →+∞+-+ =ln 32.。
poj dp题目列表

[1]POJ 动态规划题目列表容易:1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1208, 1276, 1322, 1414, 1456, 1458, 1609, 1644, 1664, 1690, 1699, 1740(博弈), 1742, 1887, 1926(马尔科夫矩阵,求平衡), 1936, 1952, 1953, 1958, 1959, 1962, 1975, 1989, 2018, 2029, 2039, 2063, 2081, 2082, 2181, 2184, 2192, 2231, 2279, 2329, 2336, 2346, 2353, 2355, 2356, 2385, 2392, 2424,不易:1019, 1037, 1080, 1112, 1141, 1170, 1192, 1239, 1655, 1695, 1707, 1733(区间减法加并查集), 1737, 1837, 1850, 1920(加强版汉罗塔), 1934(全部最长公共子序列), 1937(计算几何), 1964(最大矩形面积,O(n)算法), 2138, 2151, 2161, 2178,推荐:1015, 1635, 1636(挺好的), 1671, 1682, 1692(优化), 1704, 1717, 1722, 1726, 1732, 1770, 1821, 1853, 1949, 2019, 2127, 2176, 2228, 2287, 2342, 2374, 2378, 2384, 24111015 Jury Compromise1029 False coin1036 Gangsters1037 A decorative fence1038 Bugs Integrated, Inc.1042 Gone Fishing1050 To the Max1062 昂贵的聘礼1074 Parallel Expectations1080 Human Gene Functions1088 滑雪1093 Formatting Text1112 Team Them Up!1141 Brackets Sequence1143 Number Game1157 LITTLE SHOP OF FLOWERS1159 Palindrome1160 Post Office1163 The Triangle1170 Shopping Offers1178 Camelot1179 Polygon1180 Batch Scheduling1185 炮兵阵地1187 陨石的秘密1189 钉子和小球1191 棋盘分割1192 最优连通子集1208 The Blocks Problem1239 Increasing Sequences1240 Pre-Post-erous!1276 Cash Machine1293 Duty Free Shop1322 Chocolate1323 Game Prediction1338 Ugly Numbers1390 Blocks1414 Life Line1432 Decoding Morse Sequences 1456 Supermarket1458 Common Subsequence1475 Pushing Boxes1485 Fast Food1505 Copying Books1513 Scheduling Lectures1579 Function Run Fun1609 Tiling Up Blocks1631 Bridging signals 2分+DP NLOGN 1633 Gladiators1635 Subway tree systems1636 Prison rearrangement1644 To Bet or Not To Bet1649 Market Place1651 Multiplication Puzzle1655 Balancing Act1661 Help Jimmy1664 放苹果1671 Rhyme Schemes1682 Clans on the Three Gorges 1690 (Your)((Term)((Project)))1691 Painting A Board1692 Crossed Matchings1695 Magazine Delivery1699 Best Sequence1704 Georgia and Bob1707 Sum of powers1712 Flying Stars1714 The Cave1717 Dominoes1718 River Crossing1722 SUBTRACT1726 Tango Tango Insurrection 1732 Phone numbers1733 Parity game1737 Connected Graph1740 A New Stone Game1742 Coins P1745 Divisibility1770 Special Experiment1771 Elevator Stopping Plan 1776 Task Sequences1821 Fence1837 Balance1848 Tree1850 Code1853 Cat1874 Trade on Verweggistan 1887 Testing the CATCHER 1889 Package Pricing1920 Towers of Hanoi1926 Pollution1934 Trip1936 All in All1937 Balanced Food1946 Cow Cycling1947 Rebuilding Roads1949 Chores1952 BUY LOW, BUY LOWER 1953 World Cup Noise1958 Strange Towers of Hanoi 1959 Darts1962 Corporative Network 1964 City Game1975 Median Weight Bead 1989 The Cow Lineup2018 Best Cow Fences2019 Cornfields2029 Get Many Persimmon Trees 2033 Alphacode2039 To and Fro2047 Concert Hall Scheduling 2063 Investment2081 Recaman's Sequence 2082 Terrible Sets2084 Game of Connections2127 Greatest Common Increasing Subsequence 2138 Travel Games2151 Check the difficulty of problems2152 Fire2161 Chandelier2176 Folding2178 Heroes Of Might And Magic2181 Jumping Cows2184 Cow Exhibition2192 Zipper2193 Lenny's Lucky Lotto Lists2228 Naptime2231 Moo Volume2279 Mr. Young's Picture Permutations2287 TianJi -- The Horse Racing2288 Islands and Bridges2292 Optimal Keypad2329 Nearest number - 22336 Ferry Loading II2342 Anniversary party2346 Lucky tickets2353 Ministry2355 Railway tickets2356 Find a multiple2374 Fence Obstacle Course2378 Tree Cutting2384 Harder Sokoban Problem2385 Apple Catching2386 Lake Counting2392 Space Elevator2397 Spiderman2411 Mondriaan's Dream2414 Phylogenetic Trees Inherited2424 Flo's Restaurant2430 Lazy Cows2915 Zuma3017 Cut the Sequence3028 Shoot-out3124 The Bookcase3133 Manhattan Wiring3345 Bribing FIPA3375 Network Connection3420 Quad Tiling ?/?cat=5[2]动态规划方法总结1. 按状态类型分写在前面:从状态类型分,并不表示一题只从属于一类。
西工大C语言POJ习题答案

一.1.第一季10题全(注:第五题问题已经解决,确认AC!)#include<>intmain(){inta,b,sum;scanf("%d%d",&a,&b);sum=a+b;printf("%d\n",sum);return0;}2.#include<>#definePIintmain(){ doubler,h,l,s,sq,vq,vz; scanf("%lf%lf",&r,&h); l=2*PI*r;s=PI*r*r;sq=4*PI*r*r;vq=4*PI*r*r*r/3;vz=s*h;printf("%.2lf\n%.2lf\n%.2lf\n%.2lf\n%.2lf\n",l, s,sq,vq,vz);return0;}3.#include<>intmain(){inta,b,c;doubled,e;scanf("%d%d%d",&a,&b,&c); d=a+b+c;e=d/3;printf("%lf\n%lf\n",d,e); return0;} 4.#include<>intmain(){inta,b,c;scanf("%d%d%d",&a,&b,&c); if(a<b)a=b;if(a<c)a=c;printf("%d\n",a);return0; }5.#include<> intmain()inti=0,j=0,k=1;chara[6];while((a[i]=getchar())!='\n') {i++;}for(;i>0;i--){if(a[j]==a[i-1]){j++;continue;}else{k=0;break;}}if(k==1)printf("yes\n");elseprintf("no\n");}6.#include<> intmain(){doublea,c; scanf("%lf",&a); switch((int)a/10) {case0:c=a*;break;case1:c=(a-10)*+10*;break;case2:case3:c=(a-20)*+10*+10*;break;case4:case5:c=(a-40)*+20*+10*+10*;break; case6:case7:case8:case9:c=(a-60)*+20*+20*+10*+10*;break; default:c=(a-100)*+40*+20*+20*+10*+10*; }printf("%lf\n",c);return0;}7.#include<> intmain(){doublea,b,c; scanf("%lf",&a); c=(int)a;if(a>c)a=c+1;if(a>15)b=(a-15)*+7+13*; else{if(a>2)b=(a-2)*+7; elseb=7;}printf("%lf\n",b); return0;}8.#include<>intmain(){inta,b,c,e,f=30,g=31,n;scanf("%d-%d-%d",&a,&b,&c);if((a%400==0)||(a%100!=0&&a%4==0)) e=29;elsee=28;switch(b){case1:n=c;break;case2:n=g+c;break;case3:n=g+e+c;break;case4:n=g+e+g+c;break;case5:n=g+e+g+f+c;break;case6:n=g+e+g+f+g+c;break;case7:n=g+e+g+f+g+f+c;break;case8:n=g+e+g+f+g+f+g+c;break;case9:n=g+e+g+f+g+f+g+g+c;break; case10:n=g+e+g+f+g+f+g+g+f+c;break; case11:n=g+e+g+f+g+f+g+g+f+g+c;break; default:n=g+e+g+f+g+f+g+g+f+g+f+c;}printf("%d\n",n);return0;}9.#include<>intmain(){intx;scanf("%d",&x);if(x>=90&&x<=100) printf("A\n"); elseif(x>=80) printf("B\n"); elseif(x>=70) printf("C\n"); elseif(x>=60) printf("D\n");elseprintf("E\n"); return0;}10.#include<> intmain() {doublex,y,s;scanf("%lf,%lf",&x,&y);s=(x+2)*(x+2)+(y-2)*(y-2);if(s>1){s=(x+2)*(x+2)+(y+2)*(y+2); if(s>1){s=(x-2)*(x-2)+(y+2)*(y+2);if(s>1){s=(x-2)*(x-2)+(y-2)*(y-2);if(s>1){printf("0\n");return1;} }}}printf("10\n");return0;}二。
西工大POJ100题(全新)(DOC)

1·计算A+B2·圆及圆球等的相关计算3·计算成绩4·找最大数5·找幸运数6·奖金发放7·出租车费8·是该年的第几天9·成绩转换10·求建筑高度11·区间内素数12·计算π13·两个整数之间所有的素数14·最次方数15·自然数立方的乐趣16·五猴分桃17·完全数18·二分求根19·你会存钱吗?20·级数和21·幸运数字722·粒子裂变23·特殊整数24·最大乘积25·解不等式26·危险的组合27·子序列的和29·探索合数世纪30·韩信点兵31·亲和数32·高低交换33·循环移位35·组合数36·积分计算37·数据加密38·获取指定二进制位39·ACKERMAN40·不会吧,又是A+B 41·平均值函数42·插入排序43·一维数组赋值44·右下角45·右上角46·山迪的麻烦47·冒泡排序48·恐怖水母49·左上角50·一维数组加法51·字符串排序52·字符串左中右53·文章统计54·找出数字55·字符串比较56·THE CLOCK 57·合并字符串58·特殊要求的字符串59·字符串逆序60·COIN TEST 61·小型数据库62·单词频次65·检测位图长宽67·子字符串替换68·复数69·字符串加密编码70·重组字符串71·大数除法72·创建与遍历职工链表73·大数加法74·大数减法75·链表节点删除76·链表动态增长或缩小77·大数乘法78·精确乘幂80·火车站81·操场训练82·HAILSTONE84·阶乘合计85·王的对抗86·三点顺序87·公园喷水器88·勇闯天涯89·不屈的小蜗90·THE RATIO OF GAINERS TO LOSERS 91·GRAVEYARD92·ARITHMETIC PROGRESSIONS 93·SCORING94·HOUSEBOAT97·BEE98·CHECKSUM ALGORITHM99·Hanoi 2100·Specialized number1·计算A+B#include<stdio.h>int main(){int a,b,sum;scanf("%d %d",&a,&b);sum=a+b;printf("%d",sum);}2·圆及圆球等的相关计算#include<stdio.h>int main(){float r,h,l,s,sq,vq,vz,pi=3.141592653;scanf("%f %f",&r,&h);l=2*pi*r;s=pi*r*r;sq=4*pi*r*r;vq=4.0/3*pi*r*r*r;vz=pi*r*r*h;printf("%.2f\n%.2f\n%.2f\n%.2f\n%.2f\n",l,s,sq,v q,vz);return 0;}3·计算成绩#include <stdio.h>int main(){float a,b,c,sum,ave;scanf("%f %f %f",&a,&b,&c);sum=a+b+c;ave=sum/3.0;printf("%.6f\n%.6f",sum,ave);return 0;}4·找最大数#include<stdio.h>int main(){int a,b,c,t;scanf("%d %d %d",&a,&b,&c);if (a<b) t=a,a=b;if(a<c) t=a,a=c;printf("%d",a);return 0;}5·找幸运数#include <stdio.h>int main(){int i,j,a;scanf("%d",&a);i=0;j=a;while(j){i=10*i+(j%10);j=j/10;}if(i==a)printf("yes\n");else printf("no\n");return 0;}6·奖金发放#include<stdio.h>int main (){float l;scanf("%f",&l);if (l<=10)l=l*0.1;else if(l<=20)l=10*0.1+(l-10)*0.075;else if(l<=40)l=10*0.1+10*0.075+(l-20)*0.05;elseif(l<=60)l=10*0.1+10*0.075+20*0.05+(l-40)*0.03;elseif(l<=100)l=10*0.1+10*0.075+20*0.05+20*0.03+(l-60)* 0.015;elsel=10*0.1+10*0.075+20*0.05+20*0.03+40*0.015+(l-100)* 0.01;printf("%.6f",l);return 0;}7·出租车费#include<stdio.h>#include<math.h>int main(){float a,n,t;scanf("%f",&a);if (a<=2) n=7;else if (a<=15) {t=a-floor(a);if(t==0)n=7+(floor(a)-2)*1.5;else n=7+(floor(a)-1)*1.5;}else {t=a-floor(a);if(t==0) n=7+13*1.5+(floor(a)-15)*2.1;else n=7+13*1.5+(floor(a)-14)*2.1;} printf("%.6f",n);return 0;}8·是该年的第几天#include<stdio.h>int main(){int y,m,d,n,a;scanf("%d-%d-%d",&y,&m,&d);if((y%4==0&&y%100!=0)||(y%400==0)) a=29;else a=28;switch(m){case 1:n=d;break;case 2:n=31+d;break;case 3:n=31+a+d;break;case 4:n=62+a+d;break;case 5:n=92+a+d;break;case 6:n=123+a+d;break;case 7:n=153+a+d;break;case 8:n=184+a+d;break;case 9:n=215+a+d;break;case 10:n=245+a+d;break;case 11:n=276+a+d;break;case 12:n=306+a+d;break;}printf("%d",n);return 0;}9·成绩转换#include<stdio.h>int main(){int n;scanf("%d",&n);if(n<60)printf("E\n");else if(n<70)printf("D\n");else if(n<80)printf("C\n");else if(n<90)printf("B\n");else printf("A\n");return 0;}10·求建筑高度#include<stdio.h>int main(){float x,y,a,b,c,d;scanf("%f,%f",&x,&y);a=(x-2)*(x-2)+(y-2)*(y-2);b=(x-2)*(x-2)+(y+2)*(y+2);c=(x+2)*(x+2)+(y-2)*(y-2);d=(x+2)*(x+2)+(y+2)*(y+2);if(a<=1||b<=1||c<=1||d<=1)printf("10");else printf("0");return 0;}11·区间内素数#include<stdio.h>#include<math.h>int main(){int i,n=500,cnt=0,sum=0;while(n<=800){for (i=2;i<=n-1;i++)if (n%i==0)break;if (i==n)cnt=cnt+1,sum=sum+pow((-1),cnt)*n; n=n+1;}printf("%d %d",cnt,sum);return 0;}12·计算π#include<stdio.h>#include<math.h>int main(){int s=1;double pi=0,n=1,t=1;while (fabs(t)>1e-6)pi=pi+t,n=n+2,s=-s,t=s/n;pi=pi*4;printf("%.6f",pi);return 0;}13·两个整数之间所有的素数#include<stdio.h>int main(){int a,b,t,i;scanf("%d%d",&a,&b);if(a>b)t=a,a=b,b=t;while (a<=b){for (i=2;i<=a-1;i++)if (a%i==0)break;if(i==a)printf("%d ",a);a++;}return 0;}14·最次方数#include<stdio.h>int main(){int x,a,m=1,n=1;scanf("%d %d",&x,&a);while (m<=a){n=n*x;n=n%1000;m=m+1;}printf("%d",n);return 0;}15·自然数立方的乐趣#include<stdio.h>int main(){int n,a,i,t;scanf("%d",&n);a=n*(n-1)+1;t=n*n*n;printf("%d*%d*%d=%d=",n,n,n,t);for(i=1;i<n;i++){printf("%d+",a);a=a+2;}printf("%d",a);return 0;}16·五猴分桃#include<stdio.h>int divides(int n,int m){if (n/5==0||n%5!=1)return 0;if (m==1)return 1;return divides(n-n/5-1,m-1);}int main(){int n,a;for (n=1;;n++)if(divides(n,5)){printf("%d ",n);break;}a=(((((n-1)*4/5-1)*4/5-1)*4/5-1)*4/5-1)*4/5;printf("%d",a);return 0;}17·完全数#include<stdio.h>int main(){int i,n,sum=0;for(n=2;n<1000;n++){sum=0;for (i=1;i<=n/2;i++){if(n%i==0)sum=sum+i;}if(sum==n){printf("%d=",n);for(i=1;i<n/2;i++)if(n%i==0)printf("%d+",i);i=n/2;printf("%d\n",i);}}return 0;}18·二分求根#include<math.h>#include<stdio.h>double fun(double x) {return 2*x*x*x-4*x*x+3*x-6;} double root(double a,double b,double e){double x1,x2,y1,x,y;x1=a;x2=b;do {x=(x1 + x2)/2;y=fun(x);y1=fun(x1);if((y<0&&y1<0)||(y>0&&y1>0))x1=x;elsex2=x;/*end if*/}while(fabs(y) > e);return x;}int main(void){double m,n;scanf("%f %f",&m,&n);double x=root(m,n,1e-8);printf("%.2f\n",x);return 0;}19·你会存钱吗?#include<stdio.h>#include<math.h>int main(){int i8,i5,i3,i2,i1,n8,n5,n3,n2,n1;float max=0,term;for(i8=0;i8<3;i8++) /*穷举所有可能的存款方式*/for(i5=0;i5<=(20-8*i8)/5;i5++)for(i3=0;i3<=(20-8*i8-5*i5)/3;i3++)for(i2=0;i2<=(20-8*i8-5*i5-3*i3)/2;i2++){i1=20-8*i8-5*i5-3*i3-2*i2;term=2000.0*pow((double)(1+0.0063*12),(double)i1) *pow((double)(1+2*0.0063*12),(double)i2)*pow((double)(1+3*0.0069*12),(double)i3)*pow((double)(1+5*0.0075*12),(double)i5)*pow((double)(1+8*0.0084*12),(double)i8);/*计算到期时的本利合计*/if(term>max){max=term;n1=i1;n2=i2;n3=i3;n5=i5;n8=i8;}}printf("%d ",n8);printf("%d ",n5);printf("%d ",n3);printf("%d ",n2);printf("%d\n",n1);printf("%.2f",max);/*输出存款方式*/}20·级数和#include<stdio.h>#include<math.h>int main(){ int j,t,i,a,n;double s=0;scanf("%d",&n);j=-1; i=1; t=1;for (a=0;a<n;a++){t=t*2; j*=-1; i*=-1; s=s+j*t/((t+i)*(2*t+j)+0.0);}printf("%.6lf\n",s);return 0;}21·幸运数字7#include<stdio.h>int main(){int n,i;scanf("%d",&n);//n不大于30000if(n<7);else {for (i=7;i<=n;i++)if(i%7==0||i%10==7||i/1000%10==7||i/100%10==7||i/10 %10==7)printf("%d ",i);}return 0;}22·粒子裂变#include<stdio.h>int main(){int n[100],m[100],t,i;n[0]=1;m[0]=0;scanf("%d",&t);for(i=1;i<=t;i++){n[i]=m[i-1];m[i]=3*n[i-1]+2*m[i-1]; }printf("%d %d",n[t],m[t]); return 0;}23·特殊整数#include<stdio.h>#include <stdlib.h>#include<math.h>int main(){int m,n,g=0,s=0,i,j,x,x1,x2;scanf("%d %d",&m,&n);x1=(int)(pow(10.0,n)/10);x2=(int)(pow(10.0,n)-1);for(i=x1;i<=x2;i++){j=i;do{x=j%10;if(x==m){if(i%m!=0)g++,s=s+i;break;}else j=j/10;}while(j!=0);}printf("%d %d\n",g,s);return 0;}24·最大乘积#include<stdio.h>int main(){int A[18],i,j,n,x,y=0;scanf("%d",&n);for(i=0;i<n;i++)scanf("%d",&A[i]);for(i=0;i<n;i++){x=1;for(j=i;j<n;j++){x=x*A[j];if(x>y) y=x;}}if(y>0)printf("%d",y);else printf("-1");return 0;}25·解不等式#include<stdio.h>int main(){int a,b;float n,s=0,sum=0;scanf("%d %d",&a,&b);for (n=1;sum<=a;n++){s=s+1/n;sum=sum+1/s;}printf("%.0f ",n=n-1); for (n;sum<=b;n++){s=s+1/n;sum=sum+1/s;}printf("%.0f",n=n-1); return 0;}26·危险的组合#include<stdio.h>#include<math.h>int main(){int n;int f(int);scanf("%d",&n);printf("%d",f(n));return 0;}int f(int n){int a;if(n==1||n==2)a=0;else if(n==3)a=1;else if(n==4)a=3;else a=f(n-1)*2+pow(2,n-4)-f(n-4);return a;}27·子序列的和#include<stdio.h>#include<math.h>int main(){int m,n,i; //n<m<1000000double a,sum=0;scanf("%d %d",&n,&m);for (i=n;i<=m;i++){a=pow(i,2.0);sum=sum+1/a;}printf("%.5lf",sum);return 0;}29·探索合数世纪#include<stdio.h>int main(){int n,i=500,s,x,count=0;long j,k;scanf("%d",&n);while(count<n){s=0;for(j=i*100-99;j<i*100;j+=2){x=0;for(k=3;k*k<=j;k+=2)if(j%k==0){x=1;break;}s+=x;}if(s==50)count++;i++;}printf("%d %d",j-101,j-2);return 0;}30·韩信点兵include<stdio.h>int main(){int a,b,c,n;//a<3,b<5,c<7scanf("%d %d %d",&a,&b,&c);for (n=10;n<=100;n++){if((n-a)%3==0&&(n-b)%5==0&&(n-c)%7==0)break;}if(n>100)printf("-1");else printf("%d ",n);return 0;}31·亲和数#include<stdio.h>int fun(int a){int b=0,i;for(i=1;i<=a/2;i++){if(a%i==0)b+=i;}return b;}int main(){int a,b;scanf("%d %d",&a,&b);if(fun(a)==b&&fun(b)==a)printf("YES");else printf("NO");return 0;}32·高低交换#include<stdio.h>inline int xchg(unsigned char n) {char left=n<<4;char right=n>>4;return left+right;}int main(){int n;scanf("%d",&n);n=xchg(n);printf("%d",n);return 0;33·循环移位#include<stdio.h>int move(int value,int n){if(n==0) return value;else if(n<0){n=-n;value=(value<<n)|(value>>(32-n));}else value=(value>>n)|(value<<(32-n));return value;}int main(){int value,n;scanf("%d %d",&value,&n);value=move(value,n);printf("%d",value);return 0;35·组合数#include<stdio.h>int C(int m,int n){int i,p=1;for (i=1;i<=n;i++)p*=(m+1-i)/(double)i;return p;}int main(){int m,n,t;scanf("%d %d",&m,&n);if(n>m) printf("wrong\n");else {t=C(m,n);printf("%d\n",t);}return 0;}36·积分计算#include<stdio.h>double f(double x){return 1.0/(1.0+x*x);}double jf(double a,double b) {double h,s=0;;int i;h=(b-a)/5000000;for(i=1;i<5000000;i++){s+=(f(a)+f(a+h))*0.5*h;a+=h;}return s;}int main(){double a,b,s;scanf("%lf%lf",&a,&b); s=jf(a,b);printf("%lf",s);return 0;}37·数据加密#include<stdio.h>int fun(int n){return (n+5)%10;}int main(){int a,b[4],i=0;scanf("%d",&a);while(a){b[i]=fun(a%10);a/=10;i++;}a=b[0]*1000+b[1]*100+b[2]*10+b[3]; printf("%d",a);return 0;}38·获取指定二进制位#include <stdio.h>int getbit(int n,int k){int count=0;while(1){count++;if(count==k)break;n/=2;}return n%2;}int main(){int n,k;scanf("%d %d",&n,&k);k=getbit(n,k);printf("%d",k);return 0;}39·ACKERMAN#include<stdio.h>int ack(int m,int n){if(m==0) return n+1;else if(n==0) return ack(m-1,1); else return ack(m-1,ack(m,n-1)); }int main(){int m,n;scanf("%d %d",&m,&n);m=ack(m,n);printf("%d",m);return 0;}40·不会吧,又是A+B#include<stdio.h>int main(){int a1,a2,a3,b1,b2,b3,a,b,c;scanf("%d %d %d %d %d %d",&a1,&a2,&a3,&b1,&b2,&b3); c=(a3+b3)%60;b=(a2+b2+(a3+b3)/60)%60;a=a1+b1+((a3+b3)/60+a2+b2)/60;printf("%d %d %d ",a,b,c);return 0;}41·平均值函数#include<stdio.h>double avg(int A[],int s,int e){int i;double t,sum;for(i=s;i<=e;i++)sum+=A[i];t=sum/(e-s+1);return t;}int main(){int n,s,e,i,A[100];double t;scanf("%d\n",&n);for(i=0;i<n;i++)scanf("%d ",&A[i]);scanf("%d %d",&s,&e);t=avg(A,s,e);printf("%f",t);return 0;}42·插入排序#include<stdio.h>void InsertionSort(int a[],int s,int m) {int t,i,j,k;for(i=0;i<m;i++){for(j=s+1;j<s+m-i;j++){t=a[j];k=j-1;while(t>a[k]){a[k+1]=a[k];k--;if(k==(s-1))break;}a[k+1]=t;}}}int main(){int n,a[100],i,s,m;scanf("%d",&n);for(i=0;i<n;i++)scanf("%d",&a[i]);scanf("%d %d",&s,&m);InsertionSort(a,s,m);for(i=0;i<n;i++)printf("%d ",a[i]);printf("\n");return 0;}43·一维数组赋值#include<stdio.h>int main(){int A[100],B[100],i,n;scanf("%d",&n);for(i=0;i<n;i++)scanf("%d",&A[i]);for(i=0;i<n;i++){B[i]=A[i];if(i%2!=0)printf("%d ",B[i]);}return 0;}44·右下角#include<stdio.h>int main(){int n,a[10][10],i,j;scanf("%d",&n);for(i=0;i<n;i++)for(j=0;j<n;j++)scanf("%d",&a[i][j]);for(i=0;i<n;i++){for(j=0;j<n;j++){if(j<=n-i-2)printf(" "); else printf("%d ",a[i][j]);} printf("\n");}return 0;}45·右上角#include<stdio.h>int main(){int n,a[10][10],i,j;scanf("%d",&n);for(i=0;i<n;i++)for(j=0;j<n;j++)scanf("%d",&a[i][j]);for(i=0;i<n;i++){for(j=0;j<n;j++){if(j>=i)printf("%d ",a[i][j]); else printf(" ");}printf("\n");}return 0;}46·山迪的麻烦#include<stdio.h>int main(){int n,count=0,i,j,a[100],k;scanf("%d",&n);for(i=0;i<n;i++)scanf("%d",&a[i]);for(i=1;i<n;i++){k=a[i];for(j=i-1;j>=0&&k<a[j];j--){count++;a[j+1]=a[j];}a[j+1]=k;}printf("%d\n",count);return 0;}47·冒泡排序#include<stdio.h>void BubbleSort(int a[],int s,int m) {int t,i,j;for(i=0;i<m-1;i++){for(j=s;j<s+m-i-1;j++)if(a[j]<a[j+1]){t=a[j];a[j]=a[j+1];a[j+1]=t;}}}int main(){int n,a[100],i,s,m;scanf("%d",&n);for(i=0;i<n;i++)scanf("%d",&a[i]);scanf("%d %d",&s,&m);BubbleSort(a,s,m);for(i=0;i<n;i++)printf("%d ",a[i]);printf("\n");return 0;}48·恐怖水母#include<stdio.h>int main(){int n,m,i,j,a[100],b[100],t,sum=0; scanf("%d%d",&n,&m);for(i=0;i<n;i++)scanf("%d",&a[i]);for(i=0;i<m;i++)scanf("%d",&b[i]);for(i=0;i<n-1;i++){for(j=0;j<n-1-i;j++)if(a[j]>a[j+1]){t=a[j];a[j]=a[j+1];a[j+1]=t;}}for(i=0;i<m-1;i++){for(j=0;j<m-1-i;j++)if(b[j]>b[j+1]){t=b[j];b[j]=b[j+1];b[j+1]=t;}}for(i=0,j=0;i<n&&j<m;j++){if(a[i]<=a[j]){sum+=b[j];i++;}}printf("%d\n",sum);return 0;}49·左上角#include<stdio.h>int main(){int n,a[10][10],i,j;scanf("%d",&n);for(i=0;i<n;i++)for(j=0;j<n;j++)scanf("%d",&a[i][j]); for(i=0;i<n;i++){for(j=0;j<n-i;j++)printf("%d ",a[i][j]);printf("\n");}return 0;}50·一维数组加法#include<stdio.h>int main(){int A[100],B[100],C[100],n,i;scanf("%d",&n);for(i=0;i<n;i++)scanf("%d",&A[i]);for(i=0;i<n;i++)scanf("%d",&B[i]);for(i=0;i<n;i++){C[i]=A[i]+B[i];printf("%d ",C[i]);}return 0;}51·字符串排序#include<stdio.h>#include<string.h>int main(){char str[10][10];int i,j;char t[10];for(i=0;i<10;i++){scanf("%s",str[i]);}for(i=0;i<10;i++){for(j=0;j<10-i;j++){if(strcmp(str[j],str[j+1])>0) {strcpy(t,str[j]);strcpy(str[j],str[j+1]);strcpy(str[j+1],t);}}}for(i=0;i<10;i++)printf("%s ",str[i]);return 0;}52·字符串左中右#include<stdio.h>#include<string.h>void Left(char str[],int n,char dest[]) {int i;for(i=0;i<n;i++)dest[i]=str[i];}void Right(char str[],int n,char dest[]) {int i,m,j=0;m=strlen(str);for(i=m-n;i<=m;i++){。
欧拉回路题解

题目大意: 如果一个单词的首字母和另一个单词的尾字母相同,我们规定这两个单词可以 前后相连。现在给出一些单词,求是否可以构造一个序列,让所有的单词都可 以前后相连。
输入: 输入包含 T 组测试数据,T 在输入的第一行里给出。每一组测试数据的第一行 包含一个整数 N(1<=N<=100000),表示有多少个单词。接下来有 N 行,每一 行有一个单词,前后没有空格,单词由小写字母组成。两个测试数据之间没有 空行。
输入: 第一行有两个整数 N 和 M。接下来有 M 行,每一行有两个整数 M+1 行,表示 Bessie 依次经过的谷仓的编号。
题解: 这题是求有向图的欧拉回路,做法其实和无向图的没有多大区别。只是 Special Judge 比较蛋疼。还是先深搜后输出点。这一题的代码我用 C++来写 了,才 54 行,好久没有写过那么短的代码了……
POJ2337【基础】
题目大意: 如果一个单词的首字母和另一个单词的尾字母相同,我们规定这两个单词可以 前后相连。现在给出一些单词,求是否可以构造一个序列,让所有的单词都可 以前后相连,并且相连的序列字典序最小。
输入: 第一行有一个整数 t,表示有 t 组测试数据。每一组测试数据的第一行有一个 整数 n(3<=n<=1000),表示有 n 个由小写字母构成的单词。接下来有 n 行, 每一行是一个长度不超过 20 个字符的单词。两个测试数据之间没有空行。
POJ1300【基础】
题目大意: 大厦里有若干间房间,依次从 0 开始编号为 0,1,2,3……,0 号是你的房 间。作为一个管家,你需要找一条路径经过所有开着的门,并满足以下几个要 求: 1、通过一扇开着的门以后马上把它关上; 2、关上的门不可以再打开; 3、最后回到你自己的房间(房间 0)。