1002_A+B for Polynomials (25)5 分钟阅读1002. A+B for Polynomials Direct Link #include <iostream> #include …阅读全文
1006_Sign In and Sign Out (25)5 分钟阅读1006. Sign In and Sign Out Direct Link #include <iostream> #include …阅读全文
1007_Maximum Subsequence Sum (25)5 分钟阅读1007. Maximum Subsequence Sum Direct Link #include <cstdio> #include …阅读全文
1008_Elevator (20)5 分钟阅读1008. Elevator Direct Link #include <iostream> using namespace std; int …阅读全文
1009_Product of Polynomials (25)5 分钟阅读1009. Product of Polynomials Direct Link #include <iostream> #include …阅读全文
1010_Radix (25)10 分钟阅读1010. Radix Direct Link //第七组样例超时 //1、需要二分答案.... //2、结果用long long #include …阅读全文
1011_World Cup Betting (20)5 分钟阅读1011. World Cup Betting Direct Link #include <cstdio> #include …阅读全文
1013_Battle Over Cities (25)5 分钟阅读1013. Battle Over Cities Direct Link #include <iostream> #include …阅读全文
1015_Reversible Primes (20)5 分钟阅读1015. Reversible Primes Direct Link #include <iostream> #include …阅读全文
1016_Phone Bills (25)15 分钟阅读1016. Phone Bills Direct Link #include <iostream> #include <cstdio> …阅读全文
1017_Queueing at Bank (25)10 分钟阅读1017. Queueing at Bank Direct Link //原始版 //fuck 只要除以合法人数 而不是总人数 第一个Sample 老是跑不对, …阅读全文
1018_Public Bike Management (30)10 分钟阅读1018. Public Bike Management Direct Link //理解题目有误啊。 //Back 那个前面计算有问题 5和7测试用例一直过不 …阅读全文
1019_General Palindromic Number (20)5 分钟阅读1019. General Palindromic Number Direct Link #include <iostream> #include …阅读全文
1021_Deepest Root (25)10 分钟阅读1021. Deepest Root Direct Link /* 并查集判断 树的个数 第1次BFS找到最远叶子结点 第2次BFS …阅读全文
1023_Have Fun with Numbers (20)5 分钟阅读1023. Have Fun with Numbers Direct Link #include <iostream> #include …阅读全文
1024_Palindromic Number (25)5 分钟阅读1024. Palindromic Number Direct Link import java.math.BigInteger; import …阅读全文
1025_PAT Ranking (25)10 分钟阅读1025. PAT Ranking Direct Link #include <iostream> #include <vector> …阅读全文
1026_Table Tennis (30)15 分钟阅读1026. Table Tennis Direct Link #include <iostream> #include <cstdio> …阅读全文
1031_Hello World for U (20)5 分钟阅读1031. Hello World for U Direct Link #include <iostream> #include …阅读全文
1037_Magic Coupon (25)5 分钟阅读1037. Magic Coupon Direct Link #include <iostream> #include <cstdio> …阅读全文
1038_Recover the Smallest Number (30)5 分钟阅读1038. Recover the Smallest Number Direct Link #include <iostream> #include …阅读全文
1039_Course List for Student (25)10 分钟阅读1039. Course List for Student Direct Link /* HBQ 大神的代码 总结:思路不开阔,对程序运行的过程分析不透彻。 题 …阅读全文
1040_Longest Symmetric String (25)5 分钟阅读1040. Longest Symmetric String Direct Link #include <cstdio> #include …阅读全文
1042_Shuffling Machine (20)10 分钟阅读1042. Shuffling Machine Direct Link #include <iostream> #include …阅读全文
1043_Is It a Binary Search Tree (25)10 分钟阅读1043. Is It a Binary Search Tree Direct Link #include <iostream> #include …阅读全文
1044_Shopping in Mars (25)5 分钟阅读1044. Shopping in Mars Direct Link #include <iostream> #include …阅读全文
1045_Favorite Color Stripe (30)5 分钟阅读1045. Favorite Color Stripe Direct Link #include <iostream> #include …阅读全文
1046_Shortest Distance (20)5 分钟阅读1046. Shortest Distance Direct Link /* 累计 距离 ,用距离差 表示 某一段的距离 因为是环 所以 用总长减去当前段距离, …阅读全文
1047_Student List for Course (25)10 分钟阅读1047. Student List for Course Direct Link #include <cstdio> #include …阅读全文
1048_Find Coins (25)5 分钟阅读1048. Find Coins Direct Link /* map 用作hash 来记录个数了。 */ #include <iostream> …阅读全文
1049_Counting Ones (30)5 分钟阅读1049. Counting Ones Direct Link #include <cstdio> #include <cstring> …阅读全文
1050_String Subtraction (20)5 分钟阅读1050. String Subtraction Direct Link #include <iostream> #include …阅读全文
1052_Linked List Sorting (25)5 分钟阅读1052. Linked List Sorting Direct Link #include <iostream> #include …阅读全文
1053_Path of Equal Weight (30)10 分钟阅读1053. Path of Equal Weight Direct Link #include <iostream> #include …阅读全文
1054_The Dominant Color (20)5 分钟阅读1054. The Dominant Color Direct Link #include <cstdio> #include …阅读全文
1055_The World's Richest (25)10 分钟阅读1055. The World’s Richest Direct Link #include <cstdio> #include …阅读全文
1059_Prime Factors (25)5 分钟阅读1059. Prime Factors Direct Link #include <iostream> #include <cmath> …阅读全文
1061_Dating (20)15 分钟阅读1061. Dating Direct Link /********************************** * Author: Tiny656 * …阅读全文
1062_Talent and Virtue (25)15 分钟阅读1062. Talent and Virtue Direct Link /********************************** * …阅读全文
1064_Complete Binary Search Tree (30)5 分钟阅读1064. Complete Binary Search Tree Direct Link #include <iostream> #include …阅读全文
1065_A+B and C (64bit) (20)10 分钟阅读1065. A+B and C (64bit) Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1066_Root of AVL Tree (25)15 分钟阅读1066. Root of AVL Tree Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1067_Sort with Swap(0,) (25)10 分钟阅读1067. Sort with Swap(0, i) Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1068_Find More Coins (30)10 分钟阅读1068. Find More Coins Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1069_The Black Hole of Numbers (20)10 分钟阅读1069. The Black Hole of Numbers Direct Link #define _CRT_SECURE_NO_DEPRECATE …阅读全文
1070_Mooncake (25)10 分钟阅读1070. Mooncake Direct Link #define _CRT_SECURE_NO_DEPRECATE #define _SECURE_SCL …阅读全文
1071_Speech Patterns (25)10 分钟阅读1071. Speech Patterns Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1072_Gas Station (30)15 分钟阅读1072. Gas Station Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1073_Scientific Notation (20)15 分钟阅读1073. Scientific Notation Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1074_Reversing Linked List (25)15 分钟阅读1074. Reversing Linked List Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1075_PAT Judge (25)20 分钟阅读1075. PAT Judge Direct Link #define _CRT_SECURE_NO_DEPRECATE #define _SECURE_SCL …阅读全文
1076_Forwards on Weibo (30)15 分钟阅读1076. Forwards on Weibo Direct Link #define _CRT_SECURE_NO_DEPRECATE #define …阅读全文
1079_Total Sales of Supply Chain (25)5 分钟阅读1079. Total Sales of Supply Chain Direct Link #define _CRT_SECURE_NO_WARNINGS …阅读全文
1080_Graduate Admission (30)10 分钟阅读1080. Graduate Admission Direct Link #include <iostream> #include …阅读全文
1081_Rational Sum (20)5 分钟阅读1081. Rational Sum Direct Link #include <iostream> #include <cstdio> …阅读全文
1082_Read Number in Chinese (25)10 分钟阅读1082. Read Number in Chinese Direct Link #include <iostream> #include …阅读全文
1084_Broken Keyboard (20)5 分钟阅读1084. Broken Keyboard Direct Link s1 = list(raw_input()) s2 = list(raw_input()) …阅读全文
1085_Perfect Sequence (25)5 分钟阅读1085. Perfect Sequence Direct Link #include <iostream> #include …阅读全文
1086_Tree Traversals Again (25)10 分钟阅读1086. Tree Traversals Again Direct Link #include <iostream> #include …阅读全文
1087_All Roads Lead to Rome (30)15 分钟阅读1087. All Roads Lead to Rome Direct Link #include <iostream> #include …阅读全文
1088_Rational Arithmetic (20)15 分钟阅读1088. Rational Arithmetic Direct Link /** * 练习C++符号重载,参考《C++ Primer》 * 注意溢出,使用64 …阅读全文
1089_Insert or Merge (25)15 分钟阅读1089. Insert or Merge Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1090_Highest Price in Supply Chain (25)5 分钟阅读1090. Highest Price in Supply Chain Direct Link # Pyton 超时 n, p, r = map(float, …阅读全文
1091_Acute Stroke (30)10 分钟阅读1091. Acute Stroke Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1092_To Buy or Not to Buy (20)5 分钟阅读1092. To Buy or Not to Buy Direct Link #include <bits/stdc++.h> using …阅读全文
1094_The Largest Generation (25)5 分钟阅读1094. The Largest Generation Direct Link #include <bits/stdc++.h> using …阅读全文
1095_Cars on Campus (30)15 分钟阅读1095. Cars on Campus Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1096_Consecutive Factors (20)5 分钟阅读1096. Consecutive Factors Direct Link #include <bits/stdc++.h> using …阅读全文
1097_Deduplication on a Linked List (25)5 分钟阅读1097. Deduplication on a Linked List Direct Link #include <bits/stdc++.h> …阅读全文
1098_Insertion or Heap Sort (25)10 分钟阅读1098. Insertion or Heap Sort Direct Link #include <bits/stdc++.h> using …阅读全文
1099_Build A Binary Search Tree (30)5 分钟阅读1099. Build A Binary Search Tree Direct Link #include <bits/stdc++.h> …阅读全文
1101_Quick Sort (25)5 分钟阅读1101. Quick Sort Direct Link #include<bits/stdc++.h> using namespace std; …阅读全文
1102_Invert a Binary Tree (25)5 分钟阅读1102. Invert a Binary Tree Direct Link #include <bits/stdc++.h> using …阅读全文
1103_Integer Factorization (30)10 分钟阅读1103. Integer Factorization Direct Link /* dfs+回溯, 还有DP做法,类似于背包 */ #include …阅读全文
1104_Sum of Number Segments (20)5 分钟阅读1104. Sum of Number Segments Direct Link #coding: utf-8 n = int(raw_input()) v = …阅读全文
1105_Spiral Matrix (25)10 分钟阅读1105. Spiral Matrix Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1106_Lowest Price in Supply Chain (25)5 分钟阅读1106. Lowest Price in Supply Chain Direct Link #include <bits/stdc++.h> …阅读全文
1107_Social Clusters (30)5 分钟阅读1107. Social Clusters Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1108_Find Average (20)10 分钟阅读1108. Finding Average Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1109_Group Photo (25)10 分钟阅读1109. Group Photo Direct Link /* K为排数,开始弄错成每行人数,sigh!*/ /* 参考的简洁写法*/ #include …阅读全文
1110_Complete Binary Tree (25)5 分钟阅读1110. Complete Binary Tree Direct Link /* 1. 使用二维数组,[节点]-{[0]左孩子,[1]右孩子,[2]节点入度} …阅读全文
1111_Online Map (30)10 分钟阅读1111. Online Map Direct Link #include <bits/stdc++.h> using namespace std; …阅读全文
1112_Stucked Keyboard (20)5 分钟阅读1112. Stucked Keyboard Direct Link /* 模拟题意,使用count记录连续的键位,然后更新状态 */ #include …阅读全文
1113_Integer Set Partition (25)5 分钟阅读1113. Integer Set Partition Direct Link /* 排序,平分大端的和减去小端的和,注意偶数个数量之差为0,奇数个数量之差为1 …阅读全文
1115_Counting Nodes in a BST (30)5 分钟阅读1115. Counting Nodes in a Binary Search Tree Direct Link #coding: utf-8 import …阅读全文
1117_Eddington Number(25)5 分钟阅读1117. Eddington Number Direct Link #coding: utf-8 # 2 3 6 6 7 7 8 8 9 10 N = …阅读全文
1118_Birds in Forest (25)5 分钟阅读1118. Birds in Forest Direct Link #coding: utf-8 # 基础并查集 Union Set class …阅读全文
1119_Pre- and Post-order Traversals (30)5 分钟阅读1119. Pre- and Post-order Traversals Direct Link #coding: utf-8 # 树的先序和后序构造中序,遍历 …阅读全文
1120_Friend Numbers (20)5 分钟阅读1120. Friend Numbers Direct Link #coding: utf-8 raw_input() s = set([]) s = …阅读全文
1121_Damn Single (25)5 分钟阅读1121. Damn Single Direct Link #coding: utf-8 n = int(raw_input()) couple = {} …阅读全文
1122_Hamiltonian Cycle (25)5 分钟阅读1122. Hamiltonian Cycle Direct Link #coding: utf-8 # 1. cycle长度等于n+1 # 2. cycle首 …阅读全文
1123_Is It a Complete AVL Tree (30)10 分钟阅读1123. Is It a Complete AVL Tree Direct Link #coding: utf-8 import Queue # AVL …阅读全文
1124_Raffle for Weibo Followers (20)5 分钟阅读1124. Raffle for Weibo Followers Direct Link #coding: utf-8 def solve(m, n, s, …阅读全文
1125_Chain the Ropes (25)5 分钟阅读1125. Chain the Ropes Direct Link #coding: utf-8 n = int(raw_input()) elem = …阅读全文
1126_Eulerian Path (25)5 分钟阅读1126. Eulerian Path Direct Link #nclude <bits/stdc++.h> using namespace …阅读全文
1127_ZigZagging on a Tree (30)5 分钟阅读1127. ZigZagging on a Tree Direct Link #coding: utf-8 import Queue # 后序和中序构树,层次遍 …阅读全文
1128_N Queens Puzzle (20)5 分钟阅读1128. N Queens Puzzle Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1129_Recommendation System (25)5 分钟阅读1129. Recommendation System Direct Link #include <bits/stdc++.h> using …阅读全文
1131_Subway Map (30)10 分钟阅读1131. Subway Map Direct Link #coding: utf-8 import Queue # BFS搜索路径,DFS+回溯记录路径,简单 …阅读全文
1132_Cut Integer (20)5 分钟阅读1132. Cut Integer Direct Link #coding: utf-8 n = int(raw_input()) for i in …阅读全文
1133_Splitting A Linked List (25)5 分钟阅读1133. Splitting A Linked List Direct Link #include <bits/stdc++.h> using …阅读全文
1134_Vertex Cover (25)5 分钟阅读1134. Vertex Cover Direct Link #coding: utf-8 # 枚举所有边,判断是否能被点集覆盖 n, m = map(int, …阅读全文
1135_Is It A Red-Black Tree (30)10 分钟阅读1135. Is It A Red-Black Tree Direct Link #coding: utf-8 # 1. 每一个节点非红即黑 # 2. …阅读全文
1137_Final Grading (25)10 分钟阅读1137. Final Grading Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1138_Postorder Traversal (25)5 分钟阅读1138. Postorder Traversal Direct Link #include <bits/stdc++.h> using …阅读全文
1139_First Contact (30)10 分钟阅读1139. First Contact Direct Link #include <bits/stdc++.h> using namespace …阅读全文
1140_Look-and-say Sequence (20)5 分钟阅读1140. Look-and-say Sequence Direct Link #include <iostream> #include …阅读全文
1141_PAT Ranking of Institutions (25)10 分钟阅读1141. PAT Ranking of Institutions Direct Link #include <iostream> #include …阅读全文
1143_Lowest Common Ancestor (30)15 分钟阅读1143. Lowest Common Ancestor Direct Link #include <cstdio> #include …阅读全文
1144_The Missing Number (20)5 分钟阅读1144. The Missing Number Direct Link #include <iostream> #include …阅读全文
1145_Hashing - Average Search Time (25)10 分钟阅读1145. Hashing - Average Search Time Direct Link #include <cstdio> #include …阅读全文
1146_Topological Order (25)10 分钟阅读1146. Topological Order Direct Link #include <cstdio> #include …阅读全文
1148_Werewolf - Simple Version (20)5 分钟阅读1148. Werewolf - Simple Version Direct Link #include <iostream> using …阅读全文
1149_Dangerous Goods Packaging (25)5 分钟阅读1149. Dangerous Goods Packaging Direct Link #include <iostream> #include …阅读全文
1150_Travelling Salesman Problem (25)10 分钟阅读1150. Travelling Salesman Problem Direct Link #include <cstdio> #include …阅读全文
1151_LCA in a Binary Tree (30)10 分钟阅读1151. LCA in a Binary Tree Direct Link #include <iostream> #include …阅读全文
1152_Google Recruitment (20)5 分钟阅读1152. Google Recruitment Direct Link #include <iostream> #include …阅读全文
1153_Decode Registration Card of PAT (25)10 分钟阅读1153. Decode Registration Card of PAT Direct Link #include <iostream> …阅读全文
1156_Sexy Primes (20)5 分钟阅读1156. Sexy Primes Direct Link def isPrime(n): if n <= 1: return False for i …阅读全文
1157_Anniversary (25)5 分钟阅读1157. Anniversary Direct Link n = int(input()) alumnis = set() for i in …阅读全文
1158_Telefraud Detection (25)10 分钟阅读1158. Telefraud Detection Direct Link #include <iostream> #include …阅读全文
1159_Structure of a Binary Tree (30)15 分钟阅读1159. Structure of a Binary Tree Direct Link #include <iostream> #include …阅读全文
1160_Forever (20)10 分钟阅读1160. Forever Direct Link # search pruning for below conditions # 1. search set …阅读全文
1161_Merging Linked Lists (25)10 分钟阅读1161. Merging Linked Lists Direct Link #include <cstdio> #include …阅读全文
1162_Postfix Expression (25)5 分钟阅读1162. Postfix Expression Direct Link #include <iostream> #include …阅读全文
1163_Dijkstra Sequence (30)5 分钟阅读1163. Dijkstra Sequence Direct Link #include <iostream> #include …阅读全文