├── uri-online-judge ├── 1001 │ └── main.c ├── 1002 │ └── main.c ├── 1003 │ └── main.c ├── 1004 │ └── main.c ├── 1005 │ └── main.c ├── 1006 │ └── main.c ├── 1007 │ └── main.c ├── 1008 │ └── main.c ├── 1009 │ └── main.c ├── 1010 │ └── main.c ├── 1011 │ └── main.c ├── 1012 │ └── main.c ├── 1013 │ └── main.c ├── 1014 │ └── main.c ├── 1015 │ └── main.c ├── 1016 │ └── main.c ├── 1017 │ └── main.c ├── 1018 │ └── main.c ├── 1019 │ └── main.c ├── 1020 │ └── main.c ├── 1022 │ └── input.txt ├── 1023 │ └── input.txt ├── 1024 │ └── input.txt ├── 1025 │ └── input.txt ├── 1026 │ ├── input.txt │ └── main.c ├── 1027 │ └── input.txt ├── 1028 │ └── main.c ├── 1029 │ └── main.c ├── 1030 │ ├── input.txt │ └── main-recur.c ├── 1031 │ ├── input.txt │ └── gen.cpp ├── 1032 │ ├── input.txt │ └── gerarPrimos.c ├── 1034 │ └── input.txt ├── 1035 │ └── main.c ├── 1037 │ └── main.c ├── 1038 │ └── main.c ├── 1039 │ └── input.txt ├── 1044 │ └── main.c ├── 1046 │ └── main.c ├── 1052 │ └── main.c ├── 1059 │ └── main.c ├── 1060 │ └── main.c ├── 1061 │ └── input.txt ├── 1062 │ └── input-1.txt ├── 1063 │ └── input.txt ├── 1064 │ └── main.c ├── 1065 │ └── main.c ├── 1067 │ └── main.c ├── 1068 │ └── input.txt ├── 1070 │ └── main.c ├── 1071 │ └── main.c ├── 1072 │ └── main.c ├── 1073 │ └── main.c ├── 1075 │ └── main.c ├── 1076 │ └── input.txt ├── 1077 │ └── input.txt ├── 1078 │ └── main.c ├── 1079 │ ├── input.txt │ └── main.c ├── 1080 │ └── main.c ├── 1081 │ └── input.txt ├── 1082 │ └── input.txt ├── 1084 │ └── input.txt ├── 1087 │ └── input.txt ├── 1088 │ └── input.txt ├── 1089 │ └── input.txt ├── 1091 │ └── input.txt ├── 1094 │ └── input.txt ├── 1095 │ └── main.c ├── 1096 │ └── main.c ├── 1097 │ └── main.c ├── 1098 │ └── main.c ├── 1099 │ └── input.txt ├── 1100 │ └── input.txt ├── 1101 │ ├── input.txt │ └── main.c ├── 1103 │ └── input.txt ├── 1104 │ └── input.txt ├── 1105 │ └── input.txt ├── 1107 │ └── input.txt ├── 1110 │ └── input.txt ├── 1113 │ ├── input.txt │ └── main.c ├── 1114 │ ├── input.txt │ └── main.c ├── 1115 │ ├── input.txt │ └── main.c ├── 1116 │ ├── input.txt │ └── main.c ├── 1117 │ ├── input.txt │ └── main.c ├── 1118 │ └── input.txt ├── 1120 │ └── input.txt ├── 1124 │ └── input.txt ├── 1128 │ └── input.txt ├── 1129 │ └── input.txt ├── 1131 │ └── input.txt ├── 1132 │ ├── input.txt │ └── main.c ├── 1133 │ ├── input.txt │ └── main.c ├── 1134 │ └── input.txt ├── 1136 │ └── input.txt ├── 1140 │ └── input.txt ├── 1142 │ └── main.c ├── 1143 │ └── main.c ├── 1144 │ └── main.c ├── 1145 │ └── main.c ├── 1146 │ └── main.c ├── 1148 │ └── input.txt ├── 1149 │ └── main.c ├── 1150 │ └── main.c ├── 1151 │ └── main.c ├── 1152 │ └── input.txt ├── 1153 │ └── main.c ├── 1154 │ ├── input.txt │ └── main.c ├── 1155 │ └── main.c ├── 1156 │ └── main.c ├── 1157 │ └── main.c ├── 1158 │ ├── input.txt │ └── main.c ├── 1159 │ ├── input.txt │ └── main.c ├── 1160 │ └── input.txt ├── 1161 │ └── input.txt ├── 1162 │ └── input.txt ├── 1163 │ └── input.txt ├── 1164 │ ├── input.txt │ └── main.c ├── 1165 │ └── input.txt ├── 1168 │ └── input.txt ├── 1169 │ ├── main.c │ └── input.txt ├── 1170 │ ├── input.txt │ └── main.c ├── 1171 │ ├── input.txt │ └── main.c ├── 1172 │ ├── input.txt │ └── main.c ├── 1173 │ └── main.c ├── 1174 │ └── main.c ├── 1175 │ └── main.c ├── 1176 │ └── input.txt ├── 1177 │ └── main.c ├── 1178 │ └── main.c ├── 1179 │ └── input.txt ├── 1180 │ └── input.txt ├── 1191 │ ├── input-01.txt │ └── compile-and-run.sh ├── 1192 │ └── input.txt ├── 1193 │ └── input.txt ├── 1195 │ └── input.txt ├── 1196 │ └── input.txt ├── 1197 │ ├── input.txt │ └── main.c ├── 1198 │ ├── input.txt │ └── main.c ├── 1199 │ ├── input.txt │ └── main.c ├── 1211 │ └── input.txt ├── 1212 │ └── input.txt ├── 1214 │ └── input.txt ├── 1216 │ ├── input.txt │ └── main.c ├── 1217 │ └── input.txt ├── 1218 │ └── input.txt ├── 1221 │ └── input.txt ├── 1228 │ └── input.txt ├── 1234 │ └── input.txt ├── 1235 │ └── input.txt ├── 1237 │ └── input.txt ├── 1238 │ └── input.txt ├── 1239 │ └── input.txt ├── 1240 │ └── input.txt ├── 1241 │ ├── input.txt │ └── main.c ├── 1244 │ └── input.txt ├── 1245 │ └── input.txt ├── 1247 │ ├── input.txt │ └── main.c ├── 1248 │ └── input.txt ├── 1249 │ └── input.txt ├── 1250 │ └── input.txt ├── 1251 │ └── input.txt ├── 1252 │ └── input.txt ├── 1253 │ └── input.txt ├── 1255 │ └── input.txt ├── 1256 │ └── input.txt ├── 1257 │ └── input.txt ├── 1258 │ └── input.txt ├── 1259 │ └── input.txt ├── 1260 │ └── input.txt ├── 1262 │ └── input.txt ├── 1263 │ └── input.txt ├── 1267 │ └── input.txt ├── 1272 │ └── input.txt ├── 1273 │ └── input.txt ├── 1277 │ └── input.txt ├── 1281 │ └── input.txt ├── 1285 │ └── input.txt ├── 1286 │ └── input.txt ├── 1300 │ ├── input.txt │ └── main.cpp ├── 1305 │ ├── input.txt │ └── main.cpp ├── 1309 │ └── input.txt ├── 1310 │ └── input.txt ├── 1318 │ └── input.txt ├── 1323 │ ├── input.txt │ └── main.c ├── 1329 │ ├── input.txt │ └── main.c ├── 1332 │ └── input.txt ├── 1367 │ └── input.txt ├── 1379 │ ├── input.txt │ └── main.cpp ├── 1383 │ └── input.txt ├── 1387 │ ├── input.txt │ └── main.c ├── 1393 │ ├── input.txt │ └── main.cpp ├── 1397 │ └── input.txt ├── 1410 │ └── input.txt ├── 1429 │ └── input.txt ├── 1430 │ └── input.txt ├── 1435 │ └── input.txt ├── 1436 │ └── input.txt ├── 1441 │ ├── input.txt │ └── main.cpp ├── 1457 │ ├── input.txt │ └── main.cpp ├── 1467 │ ├── input.txt │ └── main.c ├── 1471 │ └── input.txt ├── 1478 │ └── input.txt ├── 1495 │ └── input.txt ├── 1514 │ └── input.txt ├── 1515 │ └── input.txt ├── 1533 │ └── input.txt ├── 1534 │ └── input.txt ├── 1541 │ ├── input.txt │ └── main.c ├── 1542 │ └── input.txt ├── 1546 │ └── input.txt ├── 1547 │ └── input.txt ├── 1548 │ └── input.txt ├── 1550 │ ├── input-01.txt │ └── compile-and-run.sh ├── 1551 │ └── input.txt ├── 1553 │ └── input.txt ├── 1555 │ └── input.txt ├── 1557 │ └── input.txt ├── 1558 │ └── input.txt ├── 1564 │ ├── input.txt │ └── main.c ├── 1566 │ └── input.txt ├── 1574 │ └── input.txt ├── 1581 │ └── input.txt ├── 1582 │ └── input.txt ├── 1585 │ ├── input.txt │ └── main.c ├── 1589 │ ├── input.txt │ └── main.c ├── 1607 │ └── input.txt ├── 1609 │ ├── input.txt │ └── main.cpp ├── 1610 │ └── input.txt ├── 1612 │ ├── input.txt │ └── main.cpp ├── 1618 │ ├── input.txt │ └── main.cpp ├── 1708 │ ├── input.txt │ └── main.cpp ├── 1715 │ ├── input.txt │ └── main.cpp ├── 1743 │ └── input.txt ├── 1759 │ └── main.c ├── 1763 │ ├── input-01.txt │ └── compile-and-run.sh ├── 1774 │ ├── compile-and-run.sh │ └── input-01.txt ├── 1789 │ └── input.txt ├── 1794 │ └── main.cpp ├── 1796 │ └── main.cpp ├── 1805 │ └── main.c ├── 1827 │ └── input.txt ├── 1828 │ └── input.txt ├── 1837 │ └── main.c ├── 1848 │ └── input.txt ├── 1855 │ └── input.txt ├── 1858 │ ├── input.txt │ └── main.c ├── 1864 │ └── main.c ├── 1865 │ ├── input.txt │ └── main.c ├── 1866 │ ├── input.txt │ └── main.c ├── 1868 │ └── input.txt ├── 1871 │ └── input.txt ├── 1873 │ └── input.txt ├── 1893 │ ├── input.txt │ └── main.cpp ├── 1914 │ └── input.txt ├── 1921 │ └── main.c ├── 1924 │ └── main.c ├── 1929 │ └── main.c ├── 1930 │ └── main.c ├── 1933 │ └── main.c ├── 1943 │ └── input.txt ├── 1957 │ └── main.c ├── 1958 │ └── main.c ├── 1959 │ └── main.c ├── 1961 │ └── input.txt ├── 1962 │ └── input.txt ├── 1963 │ └── main.c ├── 1973 │ └── input.txt ├── 1983 │ └── input.txt ├── 1984 │ └── main.c ├── 1985 │ └── input.txt ├── 2003 │ ├── input.txt │ └── main.c ├── 2006 │ ├── input.txt │ └── main.c ├── 2023 │ └── input.txt ├── 2028 │ └── input.txt ├── 2029 │ ├── input.txt │ └── main.c ├── 2031 │ └── input.txt ├── 2059 │ └── input.txt ├── 2060 │ └── input.txt ├── 2061 │ ├── input.txt │ └── main.c ├── 2062 │ └── input.txt ├── 2126 │ └── input.txt ├── 2137 │ └── input.txt ├── 2139 │ └── input.txt ├── 2140 │ └── input.txt ├── 2146 │ ├── input.txt │ └── main.cpp ├── 2147 │ ├── input.txt │ └── main.cpp ├── 2149 │ └── input.txt ├── 2152 │ └── input.txt ├── 2159 │ └── input.txt ├── 2160 │ ├── input.txt │ └── main.cpp ├── 2161 │ ├── input.txt │ └── main.cpp ├── 2162 │ └── input.txt ├── 2163 │ └── input.txt ├── 2164 │ ├── input.txt │ └── main.cpp ├── 2165 │ ├── input.txt │ └── main.cpp ├── 2166 │ └── input.txt ├── 2167 │ └── input.txt ├── 2172 │ ├── input.txt │ └── main.cpp ├── 2174 │ ├── input.txt │ └── main.cpp ├── 2176 │ ├── input.txt │ └── main.cpp ├── 2221 │ └── input.txt ├── 2232 │ └── input.txt ├── 2233 │ └── input.txt ├── 2234 │ ├── input.txt │ └── main.c ├── 2235 │ └── input.txt ├── 2237 │ └── input.txt ├── 2238 │ └── input.txt ├── 2242 │ └── input.txt ├── 2243 │ ├── input.txt │ ├── desc.txt │ └── gen.c ├── 2246 │ └── input.txt ├── 2253 │ ├── input.txt │ └── out.txt ├── 2310 │ └── input.txt ├── 2313 │ ├── input.txt │ └── out.txt ├── 2314 │ ├── input-1.txt │ └── input-2.txt ├── 2334 │ ├── input.txt │ └── main.py ├── 2345 │ └── main.cpp ├── 2348 │ ├── input-2.txt │ ├── input-1.txt │ └── input-3.txt ├── 2349 │ ├── input-3.txt │ ├── input-2.txt │ ├── input-1.txt │ └── main.cpp ├── 2374 │ ├── input-01.txt │ ├── input-02.txt │ ├── input-03.txt │ ├── compile-and-run.sh │ └── main.cpp ├── 2406 │ └── input.txt ├── 2413 │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp ├── 2454 │ ├── input.txt │ └── main.cpp ├── 2483 │ ├── input.txt │ └── main.cpp ├── 2484 │ ├── input.txt │ └── out.txt ├── 2602 │ └── main.sql ├── 2660 │ └── input.txt ├── 2661 │ ├── input.txt │ └── main.py ├── 2666 │ └── input.txt ├── 2670 │ ├── input.txt │ └── main.cpp ├── c-template │ ├── input.txt │ └── main.c ├── cpp-template │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp └── sql-template │ └── main.sql ├── codechef ├── cpp-template │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp └── H1 │ └── input.txt ├── hacker-rank ├── cpp-template │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp ├── max-array-sum │ ├── input-01.txt │ ├── input-02.txt │ ├── input-03.txt │ └── compile-and-run.sh ├── counting-valleys │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp ├── ctci-bubble-sort │ ├── input-01.txt │ ├── input-02.txt │ └── compile-and-run.sh ├── ctci-fibonacci-numbers │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp ├── richie-rich │ ├── input-01.txt │ ├── input-02.txt │ ├── input-03.txt │ ├── input-04.txt │ ├── input-99-a.txt │ └── compile-and-run.sh ├── abbr │ ├── input-01.txt │ └── compile-and-run.sh ├── candies │ ├── input-01.txt │ ├── input-03.txt │ ├── input-02.txt │ ├── input-04.txt │ └── compile-and-run.sh ├── ctci-making-anagrams │ ├── input-01.txt │ └── compile-and-run.sh ├── greedy-florist │ ├── input-01.txt │ ├── input-02.txt │ ├── input-03.txt │ └── compile-and-run.sh ├── minimum-swaps-2 │ ├── input-01.txt │ ├── input-02.txt │ ├── input-03.txt │ └── compile-and-run.sh ├── repeated-string │ ├── input-01.txt │ ├── input-02.txt │ └── compile-and-run.sh ├── sherlock-and-anagrams │ ├── input-03.txt │ ├── input-01.txt │ ├── input-02.txt │ └── compile-and-run.sh ├── sherlock-and-valid-string │ ├── input-01.txt │ ├── input-02.txt │ ├── input-03.txt │ └── compile-and-run.sh ├── string-construction │ ├── input-01.txt │ └── compile-and-run.sh ├── compare-the-triplets │ ├── input.txt │ └── main.cpp ├── ctci-array-left-rotation │ ├── input-01.txt │ └── compile-and-run.sh ├── jumping-on-the-clouds │ ├── input-01.txt │ └── compile-and-run.sh ├── mark-and-toys │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp ├── angry-children │ ├── input-03.txt │ ├── input-01.txt │ ├── input-02.txt │ ├── compile-and-run.sh │ └── main.cpp ├── balanced-brackets │ ├── input-01.txt │ └── compile-and-run.sh ├── fraudulent-activity-notifications │ ├── input-02.txt │ ├── input-01.txt │ └── compile-and-run.sh ├── frequency-queries │ ├── input-02.txt │ ├── input-01.txt │ ├── input-03.txt │ └── compile-and-run.sh ├── minimum-absolute-difference-in-an-array │ ├── input-01.txt │ ├── input-03.txt │ ├── input-02.txt │ └── compile-and-run.sh ├── two-strings │ ├── input-01.txt │ └── compile-and-run.sh ├── luck-balance │ └── input.txt ├── a-very-big-sum │ ├── input.txt │ └── main.cpp ├── alternating-characters │ ├── input-01.txt │ └── compile-and-run.sh ├── ctci-ransom-note │ ├── input-01.txt │ ├── input-02.txt │ ├── input-03.txt │ └── compile-and-run.sh ├── dynamic-programming-classics-the-longest-common-subsequence │ ├── input-01.txt │ ├── input-02.txt │ └── compile-and-run.sh ├── 2d-array │ ├── input-01.txt │ └── compile-and-run.sh ├── missing-numbers │ ├── input-01.txt │ └── compile-and-run.sh └── hexagonal-grid │ ├── compile-and-run.sh │ └── input-01.txt ├── spoj-brasil ├── cpp-template │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp ├── troia13 │ ├── input-01.txt │ ├── input-03.txt │ ├── input-02.txt │ └── compile-and-run.sh ├── frete08 │ ├── input-01.txt │ ├── input-02.txt │ └── compile-and-run.sh └── redotica │ ├── input-01.txt │ └── compile-and-run.sh ├── topcoder └── cpp-template │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp ├── leetcode ├── problems │ ├── palindrome-number │ │ ├── input-01.txt │ │ ├── input-02.txt │ │ ├── input-03.txt │ │ └── compile-and-run.sh │ ├── two-sum │ │ ├── input-01.txt │ │ ├── input-02.txt │ │ └── compile-and-run.sh │ ├── add-two-numbers │ │ ├── input-02.txt │ │ ├── input-01.txt │ │ ├── input-03.txt │ │ └── compile-and-run.sh │ ├── word-frequency │ │ ├── words.txt │ │ └── main.sh │ ├── path-sum │ │ └── compile-and-run.sh │ ├── same-tree │ │ └── compile-and-run.sh │ ├── sqrtx │ │ └── compile-and-run.sh │ ├── path-sum-ii │ │ └── compile-and-run.sh │ ├── reorder-list │ │ └── compile-and-run.sh │ ├── rotate-list │ │ └── compile-and-run.sh │ ├── symmetric-tree │ │ └── compile-and-run.sh │ ├── word-break │ │ └── compile-and-run.sh │ ├── deepest-leaves-sum │ │ └── compile-and-run.sh │ ├── find-peak-element │ │ ├── compile-and-run.sh │ │ └── main.cpp │ ├── search-a-2d-matrix │ │ └── compile-and-run.sh │ ├── shortest-bridge │ │ └── compile-and-run.sh │ ├── swap-nodes-in-pairs │ │ └── compile-and-run.sh │ ├── merge-k-sorted-lists │ │ └── compile-and-run.sh │ ├── merge-two-sorted-lists │ │ └── compile-and-run.sh │ ├── reverse-linked-list-ii │ │ └── compile-and-run.sh │ ├── search-insert-position │ │ └── compile-and-run.sh │ ├── sum-root-to-leaf-numbers │ │ └── compile-and-run.sh │ ├── binary-tree-inorder-traversal │ │ └── compile-and-run.sh │ ├── delete-node-in-a-linked-list │ │ ├── compile-and-run.sh │ │ └── main.cpp │ ├── find-all-anagrams-in-a-string │ │ └── compile-and-run.sh │ ├── average-of-levels-in-binary-tree │ │ └── compile-and-run.sh │ ├── binary-tree-level-order-traversal │ │ └── compile-and-run.sh │ ├── remove-duplicates-from-sorted-list │ │ └── compile-and-run.sh │ ├── remove-nth-node-from-end-of-list │ │ └── compile-and-run.sh │ ├── search-in-a-binary-search-tree │ │ └── compile-and-run.sh │ ├── search-in-rotated-sorted-array-ii │ │ └── compile-and-run.sh │ ├── find-minimum-in-rotated-sorted-array │ │ └── compile-and-run.sh │ ├── binary-tree-zigzag-level-order-traversal │ │ └── compile-and-run.sh │ ├── convert-sorted-list-to-binary-search-tree │ │ └── compile-and-run.sh │ ├── longest-substring-without-repeating-characters │ │ └── compile-and-run.sh │ └── maximum-number-of-vowels-in-a-substring-of-given-length │ │ └── compile-and-run.sh ├── cpp-template │ ├── compile-and-run.sh │ └── main.cpp └── python-template │ └── main.py ├── codeforces └── ii-usp-freshmen-contest │ ├── cpp-template │ ├── input-01.txt │ ├── compile-and-run.sh │ └── main.cpp │ ├── b-maratonime-plays-cirokime │ ├── input.txt │ └── main.cpp │ ├── g-maratonime-goes-rowing │ ├── input.txt │ └── main.cpp │ ├── k-maratonime-goes-to-the-karaoke │ └── input.txt │ └── i-maratonime-goes-to-a-japanese-restaurant │ └── input.txt ├── .gitignore └── README.md /uri-online-judge/1430/input.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uri-online-judge/2166/input.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uri-online-judge/2483/input.txt: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /codechef/cpp-template/input-01.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hacker-rank/cpp-template/input-01.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hacker-rank/max-array-sum/input-01.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hacker-rank/max-array-sum/input-02.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hacker-rank/max-array-sum/input-03.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spoj-brasil/cpp-template/input-01.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /topcoder/cpp-template/input-01.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uri-online-judge/1032/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 0 -------------------------------------------------------------------------------- /uri-online-judge/1708/input.txt: -------------------------------------------------------------------------------- 1 | 5 7 -------------------------------------------------------------------------------- /uri-online-judge/1943/input.txt: -------------------------------------------------------------------------------- 1 | 25 2 | -------------------------------------------------------------------------------- /uri-online-judge/2161/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /uri-online-judge/2164/input.txt: -------------------------------------------------------------------------------- 1 | 50 2 | -------------------------------------------------------------------------------- /uri-online-judge/2176/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /uri-online-judge/2313/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 2 -------------------------------------------------------------------------------- /uri-online-judge/2413/input-01.txt: -------------------------------------------------------------------------------- 1 | 2 -------------------------------------------------------------------------------- /uri-online-judge/2454/input.txt: -------------------------------------------------------------------------------- 1 | 1 0 -------------------------------------------------------------------------------- /uri-online-judge/c-template/input.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hacker-rank/counting-valleys/input-01.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uri-online-judge/1893/input.txt: -------------------------------------------------------------------------------- 1 | 0 2 2 | -------------------------------------------------------------------------------- /uri-online-judge/2159/input.txt: -------------------------------------------------------------------------------- 1 | 100 2 | -------------------------------------------------------------------------------- /uri-online-judge/2242/input.txt: -------------------------------------------------------------------------------- 1 | ahahe 2 | -------------------------------------------------------------------------------- /uri-online-judge/2374/input-01.txt: -------------------------------------------------------------------------------- 1 | 30 2 | 18 -------------------------------------------------------------------------------- /uri-online-judge/2374/input-02.txt: -------------------------------------------------------------------------------- 1 | 27 2 | 27 -------------------------------------------------------------------------------- /uri-online-judge/cpp-template/input-01.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /uri-online-judge/1026/input.txt: -------------------------------------------------------------------------------- 1 | 4 6 2 | 6 9 3 | -------------------------------------------------------------------------------- /uri-online-judge/1031/input.txt: -------------------------------------------------------------------------------- 1 | 17 2 | 0 3 | -------------------------------------------------------------------------------- /uri-online-judge/1132/input.txt: -------------------------------------------------------------------------------- 1 | 100 2 | 200 3 | -------------------------------------------------------------------------------- /uri-online-judge/1133/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 18 3 | -------------------------------------------------------------------------------- /uri-online-judge/1197/input.txt: -------------------------------------------------------------------------------- 1 | 0 0 2 | 5 12 3 | -------------------------------------------------------------------------------- /uri-online-judge/1251/input.txt: -------------------------------------------------------------------------------- 1 | AAABBC 2 | 122333 -------------------------------------------------------------------------------- /uri-online-judge/1435/input.txt: -------------------------------------------------------------------------------- 1 | 11 2 | 0 3 | -------------------------------------------------------------------------------- /uri-online-judge/1478/input.txt: -------------------------------------------------------------------------------- 1 | 100 2 | 0 3 | -------------------------------------------------------------------------------- /uri-online-judge/1858/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 1 1 3 | -------------------------------------------------------------------------------- /uri-online-judge/1961/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 2 | 1 3 3 | -------------------------------------------------------------------------------- /uri-online-judge/2059/input.txt: -------------------------------------------------------------------------------- 1 | 1 4 5 1 1 2 | -------------------------------------------------------------------------------- /uri-online-judge/2162/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 2 2 1 -------------------------------------------------------------------------------- /uri-online-judge/2235/input.txt: -------------------------------------------------------------------------------- 1 | 31 110 79 2 | -------------------------------------------------------------------------------- /uri-online-judge/2238/input.txt: -------------------------------------------------------------------------------- 1 | 3 4 60 105 2 | -------------------------------------------------------------------------------- /uri-online-judge/2374/input-03.txt: -------------------------------------------------------------------------------- 1 | 27 2 | 30 3 | -------------------------------------------------------------------------------- /hacker-rank/ctci-bubble-sort/input-01.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 1 2 3 -------------------------------------------------------------------------------- /hacker-rank/ctci-bubble-sort/input-02.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 2 1 -------------------------------------------------------------------------------- /hacker-rank/ctci-fibonacci-numbers/input-01.txt: -------------------------------------------------------------------------------- 1 | 30 -------------------------------------------------------------------------------- /hacker-rank/richie-rich/input-01.txt: -------------------------------------------------------------------------------- 1 | 4 1 2 | 3943 3 | -------------------------------------------------------------------------------- /hacker-rank/richie-rich/input-02.txt: -------------------------------------------------------------------------------- 1 | 6 3 2 | 092282 -------------------------------------------------------------------------------- /hacker-rank/richie-rich/input-03.txt: -------------------------------------------------------------------------------- 1 | 4 1 2 | 0011 3 | -------------------------------------------------------------------------------- /hacker-rank/richie-rich/input-04.txt: -------------------------------------------------------------------------------- 1 | 1 1 2 | 5 -------------------------------------------------------------------------------- /leetcode/problems/palindrome-number/input-01.txt: -------------------------------------------------------------------------------- 1 | 121 -------------------------------------------------------------------------------- /leetcode/problems/palindrome-number/input-02.txt: -------------------------------------------------------------------------------- 1 | -121 -------------------------------------------------------------------------------- /leetcode/problems/palindrome-number/input-03.txt: -------------------------------------------------------------------------------- 1 | 10 -------------------------------------------------------------------------------- /leetcode/problems/two-sum/input-01.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 2 3 | 3 3 -------------------------------------------------------------------------------- /uri-online-judge/1159/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 11 3 | 0 4 | -------------------------------------------------------------------------------- /uri-online-judge/1558/input.txt: -------------------------------------------------------------------------------- 1 | 41 2 | 7 3 | 2 4 | -------------------------------------------------------------------------------- /uri-online-judge/2006/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 4 1 1 2 1 3 | -------------------------------------------------------------------------------- /uri-online-judge/2060/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 2 5 4 20 10 3 | -------------------------------------------------------------------------------- /uri-online-judge/2160/input.txt: -------------------------------------------------------------------------------- 1 | Fulano de Tal 2 | -------------------------------------------------------------------------------- /uri-online-judge/2349/input-3.txt: -------------------------------------------------------------------------------- 1 | 2 1 1 2 | 1 3 | -------------------------------------------------------------------------------- /uri-online-judge/2660/input.txt: -------------------------------------------------------------------------------- 1 | 3 80 2 | 6 10 15 3 | -------------------------------------------------------------------------------- /uri-online-judge/2670/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 11 3 | 12 4 | -------------------------------------------------------------------------------- /hacker-rank/abbr/input-01.txt: -------------------------------------------------------------------------------- 1 | 1 2 | AfPZN 3 | APZNC 4 | -------------------------------------------------------------------------------- /hacker-rank/candies/input-01.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 1 3 | 2 4 | 2 5 | -------------------------------------------------------------------------------- /hacker-rank/ctci-making-anagrams/input-01.txt: -------------------------------------------------------------------------------- 1 | cdec 2 | abcc -------------------------------------------------------------------------------- /hacker-rank/greedy-florist/input-01.txt: -------------------------------------------------------------------------------- 1 | 3 3 2 | 2 5 6 3 | -------------------------------------------------------------------------------- /hacker-rank/greedy-florist/input-02.txt: -------------------------------------------------------------------------------- 1 | 3 2 2 | 2 5 6 3 | -------------------------------------------------------------------------------- /hacker-rank/minimum-swaps-2/input-01.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 4 3 1 2 3 | -------------------------------------------------------------------------------- /hacker-rank/repeated-string/input-01.txt: -------------------------------------------------------------------------------- 1 | aba 2 | 10 3 | -------------------------------------------------------------------------------- /hacker-rank/richie-rich/input-99-a.txt: -------------------------------------------------------------------------------- 1 | 1 1 2 | 919 3 | -------------------------------------------------------------------------------- /hacker-rank/sherlock-and-anagrams/input-03.txt: -------------------------------------------------------------------------------- 1 | 1 2 | cdcd -------------------------------------------------------------------------------- /hacker-rank/sherlock-and-valid-string/input-01.txt: -------------------------------------------------------------------------------- 1 | aabbcd -------------------------------------------------------------------------------- /uri-online-judge/1101/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 2 | 6 3 3 | 5 0 4 | -------------------------------------------------------------------------------- /uri-online-judge/1158/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 4 3 3 | 11 2 4 | -------------------------------------------------------------------------------- /uri-online-judge/1164/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 6 3 | 5 4 | 28 5 | -------------------------------------------------------------------------------- /uri-online-judge/1165/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 8 3 | 51 4 | 7 5 | -------------------------------------------------------------------------------- /uri-online-judge/1441/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 11 3 | 27 4 | 0 5 | -------------------------------------------------------------------------------- /uri-online-judge/1866/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 11 3 | 7 4 | 18 5 | -------------------------------------------------------------------------------- /uri-online-judge/1868/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 3 3 | 5 4 | 25 5 | 0 -------------------------------------------------------------------------------- /uri-online-judge/2233/input.txt: -------------------------------------------------------------------------------- 1 | ffffff 2 | 1 3 | 1 4 | -------------------------------------------------------------------------------- /uri-online-judge/2234/input.txt: -------------------------------------------------------------------------------- 1 | ffffff 2 | 1 3 | 1 4 | -------------------------------------------------------------------------------- /uri-online-judge/2348/input-2.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 100 100 100 3 | -------------------------------------------------------------------------------- /uri-online-judge/2349/input-2.txt: -------------------------------------------------------------------------------- 1 | 5 4 1 2 | 1 1 1 1 3 | -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/cpp-template/input-01.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /hacker-rank/greedy-florist/input-03.txt: -------------------------------------------------------------------------------- 1 | 5 3 2 | 1 3 5 7 9 3 | -------------------------------------------------------------------------------- /hacker-rank/minimum-swaps-2/input-02.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 2 3 4 1 5 3 | -------------------------------------------------------------------------------- /hacker-rank/minimum-swaps-2/input-03.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 1 3 5 2 4 6 7 -------------------------------------------------------------------------------- /hacker-rank/string-construction/input-01.txt: -------------------------------------------------------------------------------- 1 | 2 2 | abcd 3 | abab -------------------------------------------------------------------------------- /uri-online-judge/1110/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 19 3 | 10 4 | 6 5 | 0 6 | -------------------------------------------------------------------------------- /uri-online-judge/1113/input.txt: -------------------------------------------------------------------------------- 1 | 5 4 2 | 7 2 3 | 3 8 4 | 2 2 5 | -------------------------------------------------------------------------------- /uri-online-judge/1116/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 -2 3 | -8 0 4 | 0 8 5 | -------------------------------------------------------------------------------- /uri-online-judge/1198/input.txt: -------------------------------------------------------------------------------- 1 | 10 12 2 | 10 14 3 | 100 200 4 | -------------------------------------------------------------------------------- /uri-online-judge/1238/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | Tpo oCder 3 | aa bb 4 | -------------------------------------------------------------------------------- /uri-online-judge/1332/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | owe 3 | tOO 4 | theee 5 | -------------------------------------------------------------------------------- /uri-online-judge/1589/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 1 1 3 | 2 8 4 | 8 2 5 | -------------------------------------------------------------------------------- /uri-online-judge/1743/input.txt: -------------------------------------------------------------------------------- 1 | 1 0 0 1 0 2 | 1 0 1 1 0 3 | -------------------------------------------------------------------------------- /uri-online-judge/1962/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 10000 3 | 15 4 | 2015 5 | -------------------------------------------------------------------------------- /uri-online-judge/2149/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 4 3 | 8 4 | 14 5 | 11 6 | -------------------------------------------------------------------------------- /uri-online-judge/2167/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 100 199 199 198 0 3 | -------------------------------------------------------------------------------- /uri-online-judge/2232/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 3 | 2 4 | 5 5 | 31 6 | -------------------------------------------------------------------------------- /uri-online-judge/2348/input-1.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 60 70 70 80 80 3 | -------------------------------------------------------------------------------- /uri-online-judge/2484/input.txt: -------------------------------------------------------------------------------- 1 | ABRACADABRA 2 | HELPME 3 | DIS -------------------------------------------------------------------------------- /hacker-rank/compare-the-triplets/input.txt: -------------------------------------------------------------------------------- 1 | 17 28 30 2 | 99 16 8 3 | -------------------------------------------------------------------------------- /hacker-rank/repeated-string/input-02.txt: -------------------------------------------------------------------------------- 1 | a 2 | 1000000000000 3 | -------------------------------------------------------------------------------- /hacker-rank/sherlock-and-anagrams/input-01.txt: -------------------------------------------------------------------------------- 1 | 2 2 | abba 3 | abcd -------------------------------------------------------------------------------- /hacker-rank/sherlock-and-valid-string/input-02.txt: -------------------------------------------------------------------------------- 1 | aabbccddeefghi -------------------------------------------------------------------------------- /hacker-rank/sherlock-and-valid-string/input-03.txt: -------------------------------------------------------------------------------- 1 | abcdefghhgfedecba -------------------------------------------------------------------------------- /leetcode/problems/add-two-numbers/input-02.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | 1 4 | 0 -------------------------------------------------------------------------------- /leetcode/problems/two-sum/input-02.txt: -------------------------------------------------------------------------------- 1 | 9 2 | 4 3 | 2 7 11 15 4 | -------------------------------------------------------------------------------- /uri-online-judge/1030/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 5 2 3 | 6 3 4 | 1234 233 5 | -------------------------------------------------------------------------------- /uri-online-judge/1114/input.txt: -------------------------------------------------------------------------------- 1 | 2200 2 | 1020 3 | 2022 4 | 2002 5 | -------------------------------------------------------------------------------- /uri-online-judge/1117/input.txt: -------------------------------------------------------------------------------- 1 | -3.5 2 | 3.5 3 | 11.0 4 | 10.0 5 | -------------------------------------------------------------------------------- /uri-online-judge/1134/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 1 3 | 7 4 | 2 5 | 2 6 | 4 7 | -------------------------------------------------------------------------------- /uri-online-judge/1154/input.txt: -------------------------------------------------------------------------------- 1 | 34 2 | 56 3 | 44 4 | 23 5 | -2 6 | -------------------------------------------------------------------------------- /uri-online-judge/1180/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 1 2 3 4 -5 6 7 8 9 10 3 | -------------------------------------------------------------------------------- /uri-online-judge/1191/input-01.txt: -------------------------------------------------------------------------------- 1 | DBACEGF ABCDEFG 2 | BCAD CBAD 3 | -------------------------------------------------------------------------------- /uri-online-judge/1221/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 123321 3 | 123 4 | 103 5 | -------------------------------------------------------------------------------- /uri-online-judge/1557/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 0 7 | -------------------------------------------------------------------------------- /uri-online-judge/1827/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 11 3 | 13 4 | 20 5 | 21 6 | -------------------------------------------------------------------------------- /uri-online-judge/1871/input.txt: -------------------------------------------------------------------------------- 1 | 7 8 2 | 15 5 3 | 99 6 4 | 0 0 5 | -------------------------------------------------------------------------------- /uri-online-judge/2146/input.txt: -------------------------------------------------------------------------------- 1 | 1234 2 | 2000 3 | 1001 4 | 9999 5 | -------------------------------------------------------------------------------- /uri-online-judge/2348/input-3.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 16 37 50 35 12 39 24 3 | -------------------------------------------------------------------------------- /uri-online-judge/2349/input-1.txt: -------------------------------------------------------------------------------- 1 | 8 8 3 2 | 1 -1 1 1 1 -1 1 1 3 | -------------------------------------------------------------------------------- /hacker-rank/ctci-array-left-rotation/input-01.txt: -------------------------------------------------------------------------------- 1 | 5 4 2 | 1 2 3 4 5 3 | -------------------------------------------------------------------------------- /hacker-rank/jumping-on-the-clouds/input-01.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 0 0 1 0 0 1 0 3 | -------------------------------------------------------------------------------- /hacker-rank/sherlock-and-anagrams/input-02.txt: -------------------------------------------------------------------------------- 1 | 2 2 | ifailuhkqq 3 | kkkk -------------------------------------------------------------------------------- /leetcode/problems/add-two-numbers/input-01.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 2 4 3 3 | 3 4 | 5 6 4 -------------------------------------------------------------------------------- /spoj-brasil/troia13/input-01.txt: -------------------------------------------------------------------------------- 1 | 4 4 2 | 1 2 3 | 2 3 4 | 3 4 5 | 4 1 6 | -------------------------------------------------------------------------------- /uri-online-judge/1131/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 2 | 1 3 | 2 3 4 | 1 5 | 3 1 6 | 2 7 | -------------------------------------------------------------------------------- /uri-online-judge/1168/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 115380 3 | 2819311 4 | 23456 5 | -------------------------------------------------------------------------------- /uri-online-judge/1193/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 101 bin 3 | 101 dec 4 | 8f hex 5 | -------------------------------------------------------------------------------- /uri-online-judge/1199/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 7 3 | 44 4 | 0x80685 5 | -1 6 | -------------------------------------------------------------------------------- /uri-online-judge/1379/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 2 | 6 10 3 | 1 1000000000 4 | 0 0 5 | -------------------------------------------------------------------------------- /uri-online-judge/1436/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 6 9 9 9 8 7 7 3 | 6 7 7 8 9 9 9 4 | -------------------------------------------------------------------------------- /uri-online-judge/1457/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3! 3 | 10!!! 4 | 19!!!! 5 | 4!! 6 | -------------------------------------------------------------------------------- /uri-online-judge/1564/input.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 0 4 | 2 5 | 100 6 | 0 7 | -------------------------------------------------------------------------------- /uri-online-judge/1973/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 13 13 13 17 21 03 47 23 15 64 3 | -------------------------------------------------------------------------------- /uri-online-judge/2152/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 15 30 1 3 | 23 50 0 4 | 0 5 1 5 | -------------------------------------------------------------------------------- /uri-online-judge/sql-template/main.sql: -------------------------------------------------------------------------------- 1 | /* 2 | {name} 3 | {url} 4 | */ 5 | -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/b-maratonime-plays-cirokime/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | -------------------------------------------------------------------------------- /hacker-rank/mark-and-toys/input-01.txt: -------------------------------------------------------------------------------- 1 | 7 50 2 | 1 12 5 111 200 1000 10 3 | -------------------------------------------------------------------------------- /uri-online-judge/1077/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | A*2 3 | (A*2+c-d)/2 4 | (2*4/a^b)/(2*c) -------------------------------------------------------------------------------- /uri-online-judge/1115/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 2 | 3 -2 3 | -8 -1 4 | -7 1 5 | 0 2 6 | -------------------------------------------------------------------------------- /uri-online-judge/1192/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 4A5 3 | 3A3 4 | 4f2 5 | 2G4 6 | 7Z1 7 | -------------------------------------------------------------------------------- /uri-online-judge/1323/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 100 7 | 0 8 | -------------------------------------------------------------------------------- /uri-online-judge/1387/input.txt: -------------------------------------------------------------------------------- 1 | 2 | 2 2 3 | 2 3 4 | 5 5 5 | 1 1 6 | 0 0 7 | -------------------------------------------------------------------------------- /uri-online-judge/1429/input.txt: -------------------------------------------------------------------------------- 1 | 719 2 | 1 3 | 15 4 | 110 5 | 102 6 | 0 7 | -------------------------------------------------------------------------------- /uri-online-judge/1533/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 5 2 3 | 5 4 | 1 15 3 5 2 5 | 0 6 | -------------------------------------------------------------------------------- /uri-online-judge/1541/input.txt: -------------------------------------------------------------------------------- 1 | 8 10 20 2 | 1 10 100 3 | 10 3 100 4 | 0 5 | -------------------------------------------------------------------------------- /uri-online-judge/1582/input.txt: -------------------------------------------------------------------------------- 1 | 3 4 5 2 | 6 8 10 3 | 5 13 12 4 | 4 5 6 5 | -------------------------------------------------------------------------------- /uri-online-judge/2003/input.txt: -------------------------------------------------------------------------------- 1 | 7:10 2 | 5:00 3 | 7:15 4 | 8:50 5 | 20:33 6 | -------------------------------------------------------------------------------- /uri-online-judge/2334/input.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 10000000000000000000 4 | -1 5 | -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/g-maratonime-goes-rowing/input.txt: -------------------------------------------------------------------------------- 1 | AABABB 2 | -------------------------------------------------------------------------------- /hacker-rank/angry-children/input-03.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 2 3 | 1 4 | 2 5 | 1 6 | 2 7 | 1 8 | -------------------------------------------------------------------------------- /hacker-rank/balanced-brackets/input-01.txt: -------------------------------------------------------------------------------- 1 | 3 2 | {[()]} 3 | {[(])} 4 | {{[[(())]]}} -------------------------------------------------------------------------------- /hacker-rank/fraudulent-activity-notifications/input-02.txt: -------------------------------------------------------------------------------- 1 | 5 4 2 | 1 2 3 4 4 3 | -------------------------------------------------------------------------------- /hacker-rank/frequency-queries/input-02.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3 4 3 | 2 1003 4 | 1 16 5 | 3 1 -------------------------------------------------------------------------------- /hacker-rank/minimum-absolute-difference-in-an-array/input-01.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 -7 0 3 | -------------------------------------------------------------------------------- /hacker-rank/two-strings/input-01.txt: -------------------------------------------------------------------------------- 1 | 2 2 | hello 3 | world 4 | hi 5 | world 6 | -------------------------------------------------------------------------------- /leetcode/problems/add-two-numbers/input-03.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 9 9 9 9 9 9 9 3 | 4 4 | 9 9 9 9 -------------------------------------------------------------------------------- /uri-online-judge/1196/input.txt: -------------------------------------------------------------------------------- 1 | WERTYUIOP[SDFGHJKL]XCVBNM,. ;1234567890-=/\' 2 | -------------------------------------------------------------------------------- /uri-online-judge/1285/input.txt: -------------------------------------------------------------------------------- 1 | 87 104 2 | 989 1022 3 | 22 25 4 | 1234 1234 5 | -------------------------------------------------------------------------------- /uri-online-judge/1300/input.txt: -------------------------------------------------------------------------------- 1 | 90 2 | 65 3 | ​66 4 | 67 5 | 128 6 | 0 7 | ​180 8 | -------------------------------------------------------------------------------- /uri-online-judge/1329/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 0 0 1 0 1 3 | 6 4 | 0 0 0 0 0 1 5 | 0 6 | -------------------------------------------------------------------------------- /uri-online-judge/1534/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 10 7 | 11 8 | 0 9 | -------------------------------------------------------------------------------- /uri-online-judge/1550/input-01.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 9 3 | 100 301 4 | 808 909 5 | 133 233 -------------------------------------------------------------------------------- /uri-online-judge/1585/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 10 20 3 | 20 14 4 | 10 100 5 | 100 100 6 | -------------------------------------------------------------------------------- /uri-online-judge/2062/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | URA URO URI URU UROS IBO OBA OBAS OBES OBE -------------------------------------------------------------------------------- /uri-online-judge/2661/input.txt: -------------------------------------------------------------------------------- 1 | 6469693230 2 | 88290298627 3 | 252 4 | 8 5 | 1 6 | -------------------------------------------------------------------------------- /codechef/H1/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 7 3 2 3 | 4 1 5 4 | 6 8 9 5 | 9 8 5 6 | 2 4 1 7 | 3 7 6 8 | -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/k-maratonime-goes-to-the-karaoke/input.txt: -------------------------------------------------------------------------------- 1 | ABBGA 2 | -------------------------------------------------------------------------------- /hacker-rank/fraudulent-activity-notifications/input-01.txt: -------------------------------------------------------------------------------- 1 | 9 4 2 | 2 3 4 2 3 6 8 4 5 3 | -------------------------------------------------------------------------------- /hacker-rank/minimum-absolute-difference-in-an-array/input-03.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1 -3 71 68 17 3 | -------------------------------------------------------------------------------- /uri-online-judge/1034/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 6 100 3 | 1 5 10 15 25 50 4 | 2 103 5 | 1 5 6 | -------------------------------------------------------------------------------- /uri-online-judge/1061/input.txt: -------------------------------------------------------------------------------- 1 | Dia 5 2 | 08 : 12 : 23 3 | Dia 9 4 | 06 : 13 : 23 5 | -------------------------------------------------------------------------------- /uri-online-judge/1079/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 6.5 4.3 6.2 3 | 5.1 4.2 8.1 4 | 8.0 9.0 10.0 5 | -------------------------------------------------------------------------------- /uri-online-judge/1103/input.txt: -------------------------------------------------------------------------------- 1 | 1 5 3 5 2 | 23 59 0 34 3 | 21 33 21 10 4 | 0 0 0 0 5 | -------------------------------------------------------------------------------- /uri-online-judge/1162/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 3 | 1 3 2 4 | 4 5 | 4 3 2 1 6 | 2 7 | 2 1 8 | -------------------------------------------------------------------------------- /uri-online-judge/1171/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 8 3 | 10 4 | 8 5 | 260 6 | 4 7 | 10 8 | 10 9 | -------------------------------------------------------------------------------- /uri-online-judge/1309/input.txt: -------------------------------------------------------------------------------- 1 | 123456 2 | 0 3 | 49734321 4 | 9 5 | 20502030 6 | 70 7 | -------------------------------------------------------------------------------- /uri-online-judge/1471/input.txt: -------------------------------------------------------------------------------- 1 | 5 3 2 | 3 1 5 3 | 6 6 4 | 6 1 3 2 5 4 5 | 6 1 6 | 3 7 | -------------------------------------------------------------------------------- /uri-online-judge/1607/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | ab bd 3 | abc abc 4 | abcdefghiz aaaaaaaaaa 5 | -------------------------------------------------------------------------------- /uri-online-judge/1715/input.txt: -------------------------------------------------------------------------------- 1 | 5 3 2 | 0 0 0 3 | 1 0 5 4 | 0 0 0 5 | 0 1 2 6 | 1 1 0 -------------------------------------------------------------------------------- /uri-online-judge/1848/input.txt: -------------------------------------------------------------------------------- 1 | --* 2 | caw caw 3 | *-- 4 | caw caw 5 | caw caw 6 | -------------------------------------------------------------------------------- /uri-online-judge/1873/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | spock spock 3 | tesoura spock 4 | lagarto spock -------------------------------------------------------------------------------- /uri-online-judge/2172/input.txt: -------------------------------------------------------------------------------- 1 | 1 544768710 2 | 2 538533133 3 | 3 38884958 4 | 0 0 5 | -------------------------------------------------------------------------------- /uri-online-judge/2246/input.txt: -------------------------------------------------------------------------------- 1 | 3 6 2 | 2 2 2 2 0 2 3 | 2 2 2 0 2 2 4 | 2 2 2 2 0 2 5 | -------------------------------------------------------------------------------- /hacker-rank/luck-balance/input.txt: -------------------------------------------------------------------------------- 1 | 6 3 2 | 5 1 3 | 2 1 4 | 1 1 5 | 8 1 6 | 10 0 7 | 5 0 8 | -------------------------------------------------------------------------------- /leetcode/problems/word-frequency/words.txt: -------------------------------------------------------------------------------- 1 | the day is sunny the the 2 | the sunny is is 3 | -------------------------------------------------------------------------------- /uri-online-judge/1087/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 2 3 2 | 1 2 3 4 3 | 1 2 4 5 4 | 1 2 5 6 5 | 0 0 0 0 6 | -------------------------------------------------------------------------------- /uri-online-judge/1247/input.txt: -------------------------------------------------------------------------------- 1 | 5 1 12 2 | 12 10 7 3 | 12 9 10 4 | 10 5 5 5 | 9 12 15 6 | -------------------------------------------------------------------------------- /uri-online-judge/1397/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 5 3 3 | 8 2 4 | 5 6 5 | 2 6 | 5 5 7 | 0 0 8 | 0 9 | -------------------------------------------------------------------------------- /uri-online-judge/1555/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 5 3 3 | 2 30 4 | 2 100 5 | 30 20 6 | 15 5 7 | 30 2 8 | -------------------------------------------------------------------------------- /uri-online-judge/1609/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 3 | 1 2 3 4 | 3 5 | 1 2 1 6 | 5 7 | 100 1 1 0 0 8 | -------------------------------------------------------------------------------- /uri-online-judge/1763/input-01.txt: -------------------------------------------------------------------------------- 1 | uri-online-judge 2 | alemanha 3 | brasil 4 | austria 5 | -------------------------------------------------------------------------------- /uri-online-judge/1828/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | papel pedra 3 | lagarto tesoura 4 | Spock Spock 5 | -------------------------------------------------------------------------------- /uri-online-judge/1855/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 3 | v.... 4 | >...v 5 | ..*.. 6 | ..... 7 | ..^.< 8 | -------------------------------------------------------------------------------- /uri-online-judge/1865/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | Hulk 5000 3 | Tony 1000 4 | Thor 50 5 | Steve 500 6 | -------------------------------------------------------------------------------- /uri-online-judge/2237/input.txt: -------------------------------------------------------------------------------- 1 | 34 5 6 998 2 | 4 17 77 84 3 | 34 5 6 998 4 | 4 17 77 84 5 | -------------------------------------------------------------------------------- /uri-online-judge/2313/out.txt: -------------------------------------------------------------------------------- 1 | a: 3 2 | b: 4 3 | h: 5 4 | Valido-Escaleno 5 | Retangulo: S 6 | -------------------------------------------------------------------------------- /hacker-rank/candies/input-03.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 2 3 | 4 4 | 3 5 | 5 6 | 2 7 | 6 8 | 4 9 | 5 10 | -------------------------------------------------------------------------------- /uri-online-judge/1024/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | Texto #3 3 | abcABC1 4 | vxpdy1Y .ph 5 | vv.xwfxo.fd 6 | -------------------------------------------------------------------------------- /uri-online-judge/1039/input.txt: -------------------------------------------------------------------------------- 1 | 6 -8 2 3 0 0 2 | 7 3 4 2 4 5 3 | 3 0 0 4 0 0 4 | 5 4 7 1 8 7 5 | -------------------------------------------------------------------------------- /uri-online-judge/1099/input.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 4 5 3 | 13 10 4 | 6 4 5 | 3 3 6 | 3 5 7 | 3 4 8 | 3 8 9 | -------------------------------------------------------------------------------- /uri-online-judge/1107/input.txt: -------------------------------------------------------------------------------- 1 | 5 8 2 | 1 2 3 2 0 3 4 5 3 | 3 3 4 | 1 0 2 5 | 4 3 6 | 4 4 1 7 | 0 0 -------------------------------------------------------------------------------- /uri-online-judge/1136/input.txt: -------------------------------------------------------------------------------- 1 | 6 7 2 | 2 1 3 4 0 6 5 3 | 5 4 4 | 5 3 0 1 5 | 5 3 6 | 1 5 0 7 | 0 0 -------------------------------------------------------------------------------- /uri-online-judge/1163/input.txt: -------------------------------------------------------------------------------- 1 | 2.1 2 | 368 380 3 | 3 4 | 42.3 60 5 | 30 55 6 | 44 60.876842 7 | -------------------------------------------------------------------------------- /uri-online-judge/1211/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 12345 3 | 12354 4 | 3 5 | 535456 6 | 535488 7 | 835456 8 | -------------------------------------------------------------------------------- /uri-online-judge/1240/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 5678690 78690 3 | 5434554 543 4 | 1243 1243 5 | 54 654 6 | -------------------------------------------------------------------------------- /uri-online-judge/1318/input.txt: -------------------------------------------------------------------------------- 1 | 5 5 2 | 3 3 1 2 4 3 | 6 10 4 | 6 1 3 6 6 4 2 3 1 2 5 | 0 0 6 | -------------------------------------------------------------------------------- /uri-online-judge/1983/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 900775 9.4 3 | 999999 9.9 4 | 10022 9.7 5 | 441002 9.8 6 | -------------------------------------------------------------------------------- /uri-online-judge/2029/input.txt: -------------------------------------------------------------------------------- 1 | 1450.00 2 | 25.00 3 | 760.00 4 | 40.00 5 | 7500.00 6 | 15.00 7 | -------------------------------------------------------------------------------- /uri-online-judge/2061/input.txt: -------------------------------------------------------------------------------- 1 | 3 5 2 | fechou 3 | fechou 4 | clicou 5 | clicou 6 | clicou 7 | -------------------------------------------------------------------------------- /uri-online-judge/2147/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | galopeira 3 | galopeeeeeeeeeeeeeeeeeira 4 | galopeeira 5 | -------------------------------------------------------------------------------- /hacker-rank/a-very-big-sum/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1000000001 1000000002 1000000003 1000000004 1000000005 3 | -------------------------------------------------------------------------------- /hacker-rank/alternating-characters/input-01.txt: -------------------------------------------------------------------------------- 1 | 5 2 | AAAA 3 | BBBBB 4 | ABABABAB 5 | BABABA 6 | AAABBB -------------------------------------------------------------------------------- /hacker-rank/ctci-ransom-note/input-01.txt: -------------------------------------------------------------------------------- 1 | 6 4 2 | give me one grand today night 3 | give one grand today -------------------------------------------------------------------------------- /hacker-rank/ctci-ransom-note/input-02.txt: -------------------------------------------------------------------------------- 1 | 6 5 2 | two times three is not four 3 | two times two is four -------------------------------------------------------------------------------- /spoj-brasil/frete08/input-01.txt: -------------------------------------------------------------------------------- 1 | 4 6 2 | 0 1 10 3 | 0 2 5 4 | 0 3 10 5 | 1 2 3 6 | 1 3 4 7 | 2 3 2 8 | -------------------------------------------------------------------------------- /spoj-brasil/frete08/input-02.txt: -------------------------------------------------------------------------------- 1 | 4 6 2 | 0 1 1 3 | 0 2 1 4 | 0 3 1 5 | 1 2 3 6 | 1 3 4 7 | 2 3 2 8 | -------------------------------------------------------------------------------- /uri-online-judge/1063/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | a b c d e 3 | d b a c e 4 | 5 5 | c b d a e 6 | a e c b d 7 | 0 -------------------------------------------------------------------------------- /uri-online-judge/1212/input.txt: -------------------------------------------------------------------------------- 1 | 1 9 2 | 1 99 3 | 1 999 4 | 1 9999 5 | 1 99999 6 | 1 999999 7 | 0 0 8 | -------------------------------------------------------------------------------- /uri-online-judge/1546/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 4 3 | 1 4 | 1 5 | 3 6 | 4 7 | 3 8 | 3 9 | 3 10 | 2 11 | -------------------------------------------------------------------------------- /uri-online-judge/1985/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1001 500 3 | 1005 300 4 | 1003 23 5 | 1002 52 6 | 1004 44 7 | -------------------------------------------------------------------------------- /uri-online-judge/2140/input.txt: -------------------------------------------------------------------------------- 1 | 11 23 2 | 500 650 3 | 100 600 4 | 9948 9963 5 | 1 2 6 | 2 4 7 | 0 0 8 | -------------------------------------------------------------------------------- /uri-online-judge/1100/input.txt: -------------------------------------------------------------------------------- 1 | e2 e4 2 | a1 b2 3 | b2 c3 4 | a1 h8 5 | a1 h7 6 | h8 a1 7 | b1 c3 8 | f6 f6 -------------------------------------------------------------------------------- /uri-online-judge/1172/input.txt: -------------------------------------------------------------------------------- 1 | 0 2 | -5 3 | 63 4 | 0 5 | 0 6 | -5 7 | 63 8 | 0 9 | 5 10 | 0 11 | -------------------------------------------------------------------------------- /uri-online-judge/1216/input.txt: -------------------------------------------------------------------------------- 1 | Juca Pivara 2 | 410 3 | Pedro Medario 4 | 12 5 | Marta Mandua 6 | 60 7 | -------------------------------------------------------------------------------- /uri-online-judge/1612/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 -------------------------------------------------------------------------------- /uri-online-judge/2243/input.txt: -------------------------------------------------------------------------------- 1 | 30 2 | 5 6 5 8 9 10 5 8 9 5 7 9 9 9 6 3 10 7 8 8 4 7 2 8 9 9 10 8 4 7 3 | -------------------------------------------------------------------------------- /hacker-rank/candies/input-02.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 2 3 | 4 4 | 2 5 | 6 6 | 1 7 | 7 8 | 8 9 | 9 10 | 2 11 | 1 12 | -------------------------------------------------------------------------------- /hacker-rank/ctci-ransom-note/input-03.txt: -------------------------------------------------------------------------------- 1 | 7 4 2 | ive got a lovely bunch of coconuts 3 | ive got some coconuts -------------------------------------------------------------------------------- /hacker-rank/minimum-absolute-difference-in-an-array/input-02.txt: -------------------------------------------------------------------------------- 1 | 10 2 | -59 -36 -13 1 -53 -92 -2 -96 -54 75 3 | -------------------------------------------------------------------------------- /uri-online-judge/1022/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 / 2 + 3 / 4 3 | 1 / 2 - 3 / 4 4 | 2 / 3 * 6 / 6 5 | 1 / 2 / 3 / 4 6 | -------------------------------------------------------------------------------- /uri-online-judge/1118/input.txt: -------------------------------------------------------------------------------- 1 | -3.5 2 | 3.5 3 | 11.0 4 | 10.0 5 | 4 6 | 1 7 | 8.0 8 | 9.0 9 | 2 10 | -------------------------------------------------------------------------------- /uri-online-judge/1256/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 13 9 3 | 44 45 49 70 27 73 92 97 95 4 | 7 8 5 | 35 12 2 17 19 51 88 86 6 | -------------------------------------------------------------------------------- /uri-online-judge/1467/input.txt: -------------------------------------------------------------------------------- 1 | 0 0 0 2 | 1 1 1 3 | 1 0 0 4 | 0 1 1 5 | 0 1 0 6 | 1 0 1 7 | 0 0 1 8 | 1 1 0 9 | -------------------------------------------------------------------------------- /uri-online-judge/2028/input.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 12 | -------------------------------------------------------------------------------- /uri-online-judge/2243/desc.txt: -------------------------------------------------------------------------------- 1 | Isósceles 2 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2243 3 | -------------------------------------------------------------------------------- /uri-online-judge/2666/input.txt: -------------------------------------------------------------------------------- 1 | 6 10 2 | 0 10 10 10 10 10 3 | 1 4 7 4 | 5 1 2 5 | 3 5 3 6 | 2 5 2 7 | 6 5 2 8 | -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/i-maratonime-goes-to-a-japanese-restaurant/input.txt: -------------------------------------------------------------------------------- 1 | 10 45 2 | 10 2 3 4 5 6 7 8 9 1 -------------------------------------------------------------------------------- /hacker-rank/angry-children/input-01.txt: -------------------------------------------------------------------------------- 1 | 7 2 | 3 3 | 10 4 | 100 5 | 300 6 | 200 7 | 1000 8 | 20 9 | 30 10 | -------------------------------------------------------------------------------- /hacker-rank/dynamic-programming-classics-the-longest-common-subsequence/input-01.txt: -------------------------------------------------------------------------------- 1 | 5 6 2 | 1 2 3 4 1 3 | 3 4 1 2 1 3 -------------------------------------------------------------------------------- /spoj-brasil/troia13/input-03.txt: -------------------------------------------------------------------------------- 1 | 9 8 2 | 1 2 3 | 2 3 4 | 3 6 5 | 4 3 6 | 6 5 7 | 7 8 8 | 1 4 9 | 6 2 10 | -------------------------------------------------------------------------------- /uri-online-judge/1068/input.txt: -------------------------------------------------------------------------------- 1 | a+(b*c)-2-a 2 | (a+b*(2-c)-2+a)*2 3 | (a*b-(2+c) 4 | 2*(3-a)) 5 | )3+b*(2-c)( 6 | -------------------------------------------------------------------------------- /uri-online-judge/1217/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 9.58 3 | Mamao Maca Melao 4 | 2.65 5 | Melancia 6 | 9.54 7 | Pera Uva Goiaba 8 | -------------------------------------------------------------------------------- /uri-online-judge/1218/input.txt: -------------------------------------------------------------------------------- 1 | 23 2 | 23 F 28 M 23 F 40 M 36 F 23 M 23 F 24 M 23 M 3 | 28 4 | 22 M 23 F 28 M 32 F 5 | -------------------------------------------------------------------------------- /uri-online-judge/1249/input.txt: -------------------------------------------------------------------------------- 1 | z 2 | a 3 | x 4 | Hello world! 5 | This is a test message. 6 | abc123<>,xyz?*$ 7 | -------------------------------------------------------------------------------- /uri-online-judge/1581/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | portugues 4 | chines 5 | portugues 6 | 2 7 | espanhol 8 | espanhol 9 | -------------------------------------------------------------------------------- /uri-online-judge/1120/input.txt: -------------------------------------------------------------------------------- 1 | 5 5000000 2 | 3 123456 3 | 9 23454324543423 4 | 9 99999999991999999 5 | 7 777 6 | 0 0 7 | -------------------------------------------------------------------------------- /uri-online-judge/1267/input.txt: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 1 1 3 | 0 1 1 4 | 1 1 1 5 | 7 2 6 | 1 0 1 0 1 0 1 7 | 0 1 0 1 0 1 0 8 | 0 0 9 | -------------------------------------------------------------------------------- /uri-online-judge/1610/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 2 1 3 | 1 2 4 | 2 2 5 | 1 2 6 | 2 1 7 | 4 4 8 | 2 3 9 | 3 4 10 | 4 2 11 | 1 3 -------------------------------------------------------------------------------- /uri-online-judge/2163/input.txt: -------------------------------------------------------------------------------- 1 | 4 7 2 | 11 12 7 7 7 13 14 3 | 15 6 7 42 7 7 42 4 | 98 -5 7 7 7 42 7 5 | -1 42 3 9 7 7 7 6 | -------------------------------------------------------------------------------- /hacker-rank/angry-children/input-02.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 4 3 | 1 4 | 2 5 | 3 6 | 4 7 | 10 8 | 20 9 | 30 10 | 40 11 | 100 12 | 200 -------------------------------------------------------------------------------- /hacker-rank/frequency-queries/input-01.txt: -------------------------------------------------------------------------------- 1 | 8 2 | 1 5 3 | 1 6 4 | 3 2 5 | 1 10 6 | 1 10 7 | 1 6 8 | 2 5 9 | 3 2 10 | -------------------------------------------------------------------------------- /spoj-brasil/troia13/input-02.txt: -------------------------------------------------------------------------------- 1 | 8 10 2 | 1 2 3 | 2 3 4 | 3 6 5 | 6 5 6 | 5 4 7 | 4 3 8 | 6 7 9 | 7 8 10 | 8 1 11 | 1 5 -------------------------------------------------------------------------------- /uri-online-judge/1228/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 1 2 3 4 5 3 | 3 1 2 5 4 4 | 5 5 | 3 1 2 5 4 6 | 1 2 3 4 5 7 | 5 8 | 3 1 2 5 4 9 | 5 3 2 1 4 -------------------------------------------------------------------------------- /uri-online-judge/1259/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 4 3 | 32 4 | 34 5 | 543 6 | 3456 7 | 654 8 | 567 9 | 87 10 | 6789 11 | 98 12 | -------------------------------------------------------------------------------- /uri-online-judge/1393/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 4 5 | 5 6 | 6 7 | 7 8 | 8 9 | 9 10 | 10 11 | 20 12 | 30 13 | 40 14 | 0 -------------------------------------------------------------------------------- /uri-online-judge/1514/input.txt: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 1 0 3 | 0 1 0 4 | 0 0 0 5 | 3 3 6 | 1 1 0 7 | 0 1 0 8 | 0 0 1 9 | 0 0 10 | -------------------------------------------------------------------------------- /uri-online-judge/1551/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | ola, como voce esta hoje 3 | hoje fui na feira, e comprei banana, melao e abacates 4 | -------------------------------------------------------------------------------- /uri-online-judge/2174/input.txt: -------------------------------------------------------------------------------- 1 | 8 2 | Zubat 3 | Zubat 4 | Zubat 5 | Zubat 6 | Zubat 7 | Zubat 8 | Zubat 9 | Zubat 10 | -------------------------------------------------------------------------------- /uri-online-judge/2253/input.txt: -------------------------------------------------------------------------------- 1 | URI Online Judge 2 | AbcdEfgh99 3 | URIOnlineJudge12 4 | URI Online Judge 12 5 | Aass9 6 | Aassd9 -------------------------------------------------------------------------------- /hacker-rank/2d-array/input-01.txt: -------------------------------------------------------------------------------- 1 | 1 1 1 0 0 0 2 | 0 1 0 0 0 0 3 | 1 1 1 0 0 0 4 | 0 0 2 4 4 0 5 | 0 0 0 2 0 0 6 | 0 0 1 2 4 0 7 | -------------------------------------------------------------------------------- /uri-online-judge/1062/input-1.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 4 3 2 1 3 | 1 2 3 4 5 4 | 5 4 1 2 3 5 | 0 6 | 6 7 | 1 3 2 5 4 6 8 | 0 9 | 0 10 | -------------------------------------------------------------------------------- /uri-online-judge/1124/input.txt: -------------------------------------------------------------------------------- 1 | 11 99 21 3 2 | 30 28 82 73 3 | 24 23 35 50 4 | 32 39 30 98 5 | 7 8 22 10 6 | 70 85 32 7 7 | 0 0 0 0 -------------------------------------------------------------------------------- /uri-online-judge/1234/input.txt: -------------------------------------------------------------------------------- 1 | This is a dancing sentence 2 | This is a dancing sentence 3 | aaaaaaaaaaa 4 | z 5 | -------------------------------------------------------------------------------- /uri-online-judge/1542/input.txt: -------------------------------------------------------------------------------- 1 | 3 16 5 2 | 16 3 5 3 | 16 2 5 4 | 16 1 5 5 | 3 5 16 6 | 1 1 2 7 | 1 1 3 8 | 1 2 4 9 | 0 10 | -------------------------------------------------------------------------------- /uri-online-judge/1547/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 7 35 3 | 8 26 30 43 36 17 7 4 | 4 16 5 | 12 16 3 16 6 | 10 48 7 | 3 7 27 9 50 49 16 47 63 1 8 | -------------------------------------------------------------------------------- /uri-online-judge/1548/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3 3 | 100 80 90 4 | 4 5 | 100 120 30 50 6 | 4 7 | 100 90 30 25 8 | 4 9 | 1 2 3 4 10 | -------------------------------------------------------------------------------- /hacker-rank/dynamic-programming-classics-the-longest-common-subsequence/input-02.txt: -------------------------------------------------------------------------------- 1 | 9 10 2 | 3 9 8 3 9 7 9 7 0 3 | 3 3 9 9 9 1 7 2 0 6 -------------------------------------------------------------------------------- /hacker-rank/frequency-queries/input-03.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 1 3 3 | 2 3 4 | 3 2 5 | 1 4 6 | 1 5 7 | 1 5 8 | 1 4 9 | 3 2 10 | 2 4 11 | 3 2 -------------------------------------------------------------------------------- /uri-online-judge/1088/input.txt: -------------------------------------------------------------------------------- 1 | 5 1 5 3 4 2 2 | 5 5 1 3 4 2 3 | 5 1 2 3 4 5 4 | 6 3 5 2 1 4 6 5 | 5 5 4 3 2 1 6 | 6 6 5 4 3 2 1 7 | 0 8 | -------------------------------------------------------------------------------- /uri-online-judge/1094/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 10 C 3 | 6 R 4 | 15 S 5 | 5 C 6 | 14 R 7 | 9 C 8 | 6 R 9 | 8 S 10 | 5 C 11 | 14 R 12 | -------------------------------------------------------------------------------- /uri-online-judge/1495/input.txt: -------------------------------------------------------------------------------- 1 | 2 1 2 | 1 1 3 | 1 1 4 | 3 2 5 | 1 3 6 | 3 1 7 | 2 2 8 | 4 10 9 | 1 1 10 | 2 2 11 | 1 3 12 | 0 4 -------------------------------------------------------------------------------- /uri-online-judge/1553/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 2 | 1 4 2 1 3 3 | 5 2 4 | 1 1 2 3 2 5 | 8 3 6 | 1 1 3 5 4 6 3 4 7 | 8 3 8 | 1 1 1 1 1 1 1 1 9 | 0 0 -------------------------------------------------------------------------------- /uri-online-judge/1789/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 10 10 10 10 15 18 20 15 11 10 3 | 10 4 | 1 5 2 9 5 5 8 4 4 3 5 | 10 6 | 19 9 1 4 5 8 6 11 9 7 7 | -------------------------------------------------------------------------------- /uri-online-judge/2310/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | Renan 3 | 10 20 12 4 | 1 10 9 5 | Jonas 6 | 8 7 1 7 | 2 7 0 8 | Edson 9 | 3 3 3 10 | 1 2 3 -------------------------------------------------------------------------------- /uri-online-judge/1084/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 2 | 3759 3 | 6 3 4 | 123123 5 | 7 4 6 | 1000000 7 | 7 3 8 | 1001234 9 | 6 2 10 | 103759 11 | 0 0 -------------------------------------------------------------------------------- /uri-online-judge/1310/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 20 3 | 18 4 | 35 5 | 6 6 | 80 7 | 15 8 | 21 9 | 4 10 | 40 11 | 30 12 | 20 13 | 10 14 | 38 15 | -------------------------------------------------------------------------------- /uri-online-judge/2137/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 1233 3 | 0015 4 | 0100 5 | 7 6 | 0752 7 | 1110 8 | 0001 9 | 6322 10 | 8000 11 | 6321 12 | 0000 -------------------------------------------------------------------------------- /uri-online-judge/2165/input.txt: -------------------------------------------------------------------------------- 1 | RT @TheEllenShow: If only Bradley's arm was longer. Best photo ever. #oscars pic.twitter.com/C9U5NOtGap 2 | -------------------------------------------------------------------------------- /uri-online-judge/2221/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 5 3 | 12 23 15 4 | 42 12 20 5 | 2 6 | 52 1 11 7 | 1 52 1 8 | 3 9 | 95 12 22 10 | 5 51 21 11 | -------------------------------------------------------------------------------- /uri-online-judge/1081/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 20 10 3 | 8 3 4 | 4 3 5 | 3 4 6 | 5 8 7 | 5 7 8 | 1 7 9 | 9 3 10 | 12 19 11 | 13 17 12 | 6 19 13 | -------------------------------------------------------------------------------- /uri-online-judge/1179/input.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 3 3 | 4 4 | -4 5 | 2 6 | 3 7 | 8 8 | 2 9 | 5 10 | -7 11 | 54 12 | 76 13 | 789 14 | 23 15 | 98 16 | -------------------------------------------------------------------------------- /uri-online-judge/1237/input.txt: -------------------------------------------------------------------------------- 1 | abcdef 2 | cdofhij 3 | TWO 4 | FOUR 5 | abracadabra 6 | open 7 | Hey This java is hot 8 | Java is a new paradigm 9 | -------------------------------------------------------------------------------- /uri-online-judge/1245/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 30 D 3 | 41 E 4 | 41 D 5 | 30 E 6 | 6 7 | 38 E 8 | 38 E 9 | 40 D 10 | 38 D 11 | 40 D 12 | 37 E 13 | -------------------------------------------------------------------------------- /uri-online-judge/2126/input.txt: -------------------------------------------------------------------------------- 1 | 78954 2 | 7895478954789547895447895478954 3 | 464133 4 | 1331646546874694 5 | 12 6 | 1231321455123214565423112 7 | -------------------------------------------------------------------------------- /leetcode/cpp-template/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /uri-online-judge/1170/input.txt: -------------------------------------------------------------------------------- 1 | 12 2 | 1 3 | 1.0001 4 | 1.5 5 | 2 6 | 2.5 7 | 3.98 8 | 3.99 9 | 4 10 | 4.01 11 | 40.0 12 | 200.0 13 | 300.0 14 | -------------------------------------------------------------------------------- /uri-online-judge/1214/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 5 50 50 70 80 100 3 | 7 100 95 90 80 70 60 50 4 | 3 70 90 80 5 | 3 70 90 81 6 | 9 100 99 98 97 96 95 94 93 91 7 | -------------------------------------------------------------------------------- /uri-online-judge/1241/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 56234523485723854755454545478690 78690 3 | 5434554 543 4 | 1243 1243 5 | 54 64545454545454545454545454545454554 6 | -------------------------------------------------------------------------------- /uri-online-judge/1244/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | Top Coder comp Wedn at midnight 3 | one three five 4 | I love Cpp 5 | sj a sa df r e w f d s a v c x z sd fd 6 | -------------------------------------------------------------------------------- /uri-online-judge/2253/out.txt: -------------------------------------------------------------------------------- 1 | Senha inválida. 2 | Senha inválida. 3 | Senha inválida. 4 | Senha inválida. 5 | Senha inválida. 6 | Senha inválida. 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Executáveis 2 | *.out 3 | *.exe 4 | 5 | # Objetos 6 | *.o 7 | 8 | # Temporários 9 | *~ 10 | 11 | # VSCode files 12 | .vscode 13 | -------------------------------------------------------------------------------- /hacker-rank/candies/input-04.txt: -------------------------------------------------------------------------------- 1 | 16 2 | 1 3 | 3 4 | 5 5 | 7 6 | 8 7 | 10 8 | 12 9 | 11 10 | 10 11 | 9 12 | 8 13 | 7 14 | 6 15 | 5 16 | 4 17 | 3 18 | -------------------------------------------------------------------------------- /hacker-rank/missing-numbers/input-01.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 203 204 205 206 207 208 203 204 205 206 3 | 13 4 | 203 204 204 205 206 207 205 208 203 206 205 206 204 5 | -------------------------------------------------------------------------------- /leetcode/problems/path-sum/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/same-tree/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/sqrtx/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /uri-online-judge/1025/input.txt: -------------------------------------------------------------------------------- 1 | 4 1 2 | 8 3 | 5 4 | 4 5 | 6 6 | 5 7 | 6 3 8 | 1 9 | 1 10 | 2 11 | 1 12 | 3 13 | 3 14 | 7 15 | 2 16 | 3 17 | 0 0 18 | -------------------------------------------------------------------------------- /uri-online-judge/1255/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | Computers account for only 5% of the country's commercial electricity consumption. 3 | Input 4 | frequency letters 5 | -------------------------------------------------------------------------------- /leetcode/problems/path-sum-ii/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/reorder-list/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/rotate-list/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/symmetric-tree/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/word-break/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /spoj-brasil/redotica/input-01.txt: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 2 10 3 | 2 3 10 4 | 3 1 10 5 | 5 6 6 | 1 2 15 7 | 1 3 12 8 | 2 4 13 9 | 2 5 5 10 | 3 2 6 11 | 3 4 6 12 | 0 0 -------------------------------------------------------------------------------- /uri-online-judge/1248/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | ABCD 3 | AB 4 | C 5 | ABEDCS 6 | 7 | 8 | EDSMB 9 | MSD 10 | A 11 | 12 | 13 | 14 | IWANTSODER 15 | SOW 16 | RAT -------------------------------------------------------------------------------- /uri-online-judge/1515/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | PlanetaXYZ 2014 5 3 | PlanetaDosMacacos 2020 7 4 | JINQEWIOSDFaa 2043 20 5 | 2 6 | PlanetaA 2050 10 7 | PlanetaB 2055 16 8 | 0 -------------------------------------------------------------------------------- /uri-online-judge/1574/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | LEFT 4 | RIGHT 5 | SAME AS 2 6 | 5 7 | LEFT 8 | SAME AS 1 9 | SAME AS 2 10 | SAME AS 1 11 | SAME AS 4 12 | -------------------------------------------------------------------------------- /uri-online-judge/1618/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 3 6 6 6 6 5 3 5 5 4 3 | 1 1 7 1 7 7 1 7 4 2 4 | 1 4 7 4 7 6 1 6 5 5 5 | 6 2 9 2 9 6 6 6 1 7 6 | 4 3 9 3 9 5 4 5 10 7 7 | -------------------------------------------------------------------------------- /leetcode/problems/deepest-leaves-sum/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/find-peak-element/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/search-a-2d-matrix/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/shortest-bridge/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/swap-nodes-in-pairs/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /uri-online-judge/1104/input.txt: -------------------------------------------------------------------------------- 1 | 1 1 2 | 1000 3 | 1000 4 | 3 4 5 | 1 3 5 6 | 2 4 6 8 7 | 10 9 8 | 1 1 2 3 5 7 8 8 9 15 9 | 2 2 2 3 4 6 10 11 11 10 | 0 0 11 | -------------------------------------------------------------------------------- /uri-online-judge/1272/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | compete.online.design.event.rating 3 | ..u....r.i..o....n.l..i....n..e... 4 | . 5 | round..elimination.during..onsite..contest 6 | -------------------------------------------------------------------------------- /hacker-rank/abbr/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /leetcode/problems/merge-k-sorted-lists/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/merge-two-sorted-lists/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/reverse-linked-list-ii/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/search-insert-position/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/sum-root-to-leaf-numbers/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /uri-online-judge/1091/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 2 1 3 | 10 10 4 | -10 1 5 | 0 33 6 | 4 7 | -1000 -1000 8 | -1000 -1000 9 | 0 0 10 | -2000 -10000 11 | -999 -1001 12 | 0 13 | -------------------------------------------------------------------------------- /uri-online-judge/1262/input.txt: -------------------------------------------------------------------------------- 1 | RWWRRR 2 | 3 3 | RWWRRRR 4 | 3 5 | WWWWW 6 | 5 7 | RRRRRRRRRR 8 | 4 9 | RWRRWWRWRWRRRWWRRRRWRRWRRWRRRRRRRRRWRWRWRRRRWRRRRR 10 | 4 -------------------------------------------------------------------------------- /uri-online-judge/1273/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | BOB 3 | TOMMY 4 | JIM 5 | 4 6 | JOHN 7 | JAKE 8 | ALAN 9 | BLUE 10 | 4 11 | LONGEST 12 | A 13 | LONGER 14 | SHORT 15 | 0 16 | -------------------------------------------------------------------------------- /codechef/cpp-template/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/2d-array/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/candies/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/richie-rich/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/two-strings/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /leetcode/problems/binary-tree-inorder-traversal/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/delete-node-in-a-linked-list/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/find-all-anagrams-in-a-string/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /spoj-brasil/frete08/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /spoj-brasil/redotica/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /spoj-brasil/troia13/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /topcoder/cpp-template/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /uri-online-judge/1152/input.txt: -------------------------------------------------------------------------------- 1 | 7 11 2 | 0 1 7 3 | 0 3 5 4 | 1 2 8 5 | 1 3 9 6 | 1 4 7 7 | 2 4 5 8 | 3 4 15 9 | 3 5 6 10 | 4 5 8 11 | 4 6 9 12 | 5 6 11 13 | 0 0 14 | -------------------------------------------------------------------------------- /uri-online-judge/1160/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 100 150 1.0 0 3 | 90000 120000 5.5 3.5 4 | 56700 72000 5.2 3.0 5 | 123 2000 3.0 2.0 6 | 100000 110000 1.5 0.5 7 | 62422 484317 3.1 1.0 8 | -------------------------------------------------------------------------------- /uri-online-judge/1191/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++11 -O2 -lm && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /uri-online-judge/1550/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++11 -O2 -lm && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /uri-online-judge/1763/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++11 -O2 -lm && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /uri-online-judge/1774/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++11 -O2 -lm && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /uri-online-judge/1774/input-01.txt: -------------------------------------------------------------------------------- 1 | 7 12 2 | 1 3 6 3 | 1 4 9 4 | 2 3 17 5 | 2 5 32 6 | 2 7 27 7 | 3 4 11 8 | 3 5 4 9 | 4 5 3 10 | 4 6 19 11 | 5 6 13 12 | 5 7 15 13 | 6 7 5 -------------------------------------------------------------------------------- /uri-online-judge/2374/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++11 -O2 -lm && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /uri-online-judge/2413/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++11 -O2 -lm && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /hacker-rank/angry-children/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/counting-valleys/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/cpp-template/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/ctci-bubble-sort/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/ctci-ransom-note/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/greedy-florist/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/hexagonal-grid/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/mark-and-toys/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/max-array-sum/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/minimum-swaps-2/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/missing-numbers/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/repeated-string/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /leetcode/problems/average-of-levels-in-binary-tree/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/binary-tree-level-order-traversal/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/remove-duplicates-from-sorted-list/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/remove-nth-node-from-end-of-list/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/search-in-a-binary-search-tree/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/search-in-rotated-sorted-array-ii/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /spoj-brasil/cpp-template/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /uri-online-judge/1140/input.txt: -------------------------------------------------------------------------------- 1 | Flowers Flourish from France 2 | Sam Simmonds speaks softly 3 | Peter pIckEd pePPers 4 | truly tautograms triumph 5 | this is NOT a tautogram 6 | * 7 | -------------------------------------------------------------------------------- /uri-online-judge/2406/input.txt: -------------------------------------------------------------------------------- 1 | 12 2 | () 3 | [] 4 | {} 5 | (] 6 | }{ 7 | ([{}]) 8 | {}()[] 9 | ()] 10 | {[] 11 | ( 12 | (([{}{}()[]])(){}){} 13 | (((((((((({([])}]))))))))) -------------------------------------------------------------------------------- /uri-online-judge/cpp-template/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++11 -O2 -lm && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /hacker-rank/balanced-brackets/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/ctci-making-anagrams/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/frequency-queries/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/hexagonal-grid/input-01.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 6 3 | 010000 4 | 000010 5 | 2 6 | 00 7 | 00 8 | 2 9 | 00 10 | 10 11 | 2 12 | 00 13 | 01 14 | 2 15 | 00 16 | 11 17 | 2 18 | 10 19 | 00 -------------------------------------------------------------------------------- /hacker-rank/jumping-on-the-clouds/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/sherlock-and-anagrams/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/string-construction/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /leetcode/problems/find-minimum-in-rotated-sorted-array/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /uri-online-judge/1235/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | I ENIL SIHTHSIREBBIG S 3 | LEVELKAYAK 4 | H YPPAHSYADILO 5 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 6 | VOD OWT SNEH HCNERF EGDIRTRAP A DNA SE 7 | MANGOS 8 | -------------------------------------------------------------------------------- /uri-online-judge/1252/input.txt: -------------------------------------------------------------------------------- 1 | 15 3 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 12 | 11 13 | 12 14 | 13 15 | 14 16 | 15 17 | 3 3 18 | 9 19 | 12 20 | 10 21 | 0 0 -------------------------------------------------------------------------------- /uri-online-judge/1253/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | VQREQFGT 3 | 2 4 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 5 | 10 6 | TOPCODER 7 | 0 8 | ZWBGLZ 9 | 25 10 | DBNPCBQ 11 | 1 12 | LIPPSASVPH 13 | 4 14 | -------------------------------------------------------------------------------- /hacker-rank/alternating-characters/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/ctci-array-left-rotation/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/ctci-fibonacci-numbers/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/sherlock-and-valid-string/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /leetcode/problems/binary-tree-zigzag-level-order-traversal/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/convert-sorted-list-to-binary-search-tree/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/longest-substring-without-repeating-characters/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/two-sum/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /uri-online-judge/1128/input.txt: -------------------------------------------------------------------------------- 1 | 4 5 2 | 1 2 1 3 | 1 3 2 4 | 2 4 1 5 | 3 4 1 6 | 4 1 2 7 | 3 2 8 | 1 2 2 9 | 1 3 2 10 | 3 2 11 | 1 2 2 12 | 1 3 1 13 | 4 2 14 | 1 2 2 15 | 3 4 2 16 | 0 0 -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/cpp-template/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /hacker-rank/fraudulent-activity-notifications/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /uri-online-judge/1105/input.txt: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 1 1 3 | 1 2 1 4 | 2 3 2 5 | 3 1 3 6 | 3 3 7 | 1 1 1 8 | 1 2 1 9 | 2 3 2 10 | 3 1 4 11 | 3 3 12 | 1 1 1 13 | 1 2 2 14 | 2 3 2 15 | 3 1 2 16 | 0 0 17 | -------------------------------------------------------------------------------- /uri-online-judge/1914/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | Quico PAR Chiquinha IMPAR 3 | 9 7 4 | Dami PAR Marcus IMPAR 5 | 12 3 6 | Dayran PAR Conrado IMPAR 7 | 3 1000000000 8 | Popis PAR Chaves IMPAR 9 | 2 7 10 | -------------------------------------------------------------------------------- /hacker-rank/minimum-absolute-difference-in-an-array/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /leetcode/problems/add-two-numbers/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /leetcode/problems/maximum-number-of-vowels-in-a-substring-of-given-length/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && ./a.out 6 | -------------------------------------------------------------------------------- /leetcode/problems/palindrome-number/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | clang++ main.cpp -W -Wall -std=c++17 -O2 -fsanitize=address && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | -------------------------------------------------------------------------------- /uri-online-judge/1129/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 0 255 255 255 255 3 | 255 255 255 255 0 4 | 255 255 127 255 255 5 | 4 6 | 200 200 200 0 200 7 | 200 1 200 200 1 8 | 1 2 3 4 5 9 | 255 5 200 130 205 10 | 0 11 | -------------------------------------------------------------------------------- /uri-online-judge/1263/input.txt: -------------------------------------------------------------------------------- 1 | He has four fanatic fantastic fans 2 | There may be no alliteration in a sequence 3 | Round the rugged rock the ragged rascal ran 4 | area artic Soul Silly subway ant artic none 5 | -------------------------------------------------------------------------------- /uri-online-judge/1367/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | A 120 incorrect 3 | A 130 incorrect 4 | A 200 incorrect 5 | 5 6 | A 100 correct 7 | B 110 incorrect 8 | B 111 correct 9 | C 200 correct 10 | D 300 incorrect 11 | 0 -------------------------------------------------------------------------------- /uri-online-judge/2602/main.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Select Básico 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2602 4 | */ 5 | 6 | select 7 | name 8 | from customers 9 | where state = 'RS'; 10 | -------------------------------------------------------------------------------- /uri-online-judge/c-template/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | {name} 3 | {url} 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main(void) { 10 | 11 | 12 | return EXIT_SUCCESS; 13 | } 14 | -------------------------------------------------------------------------------- /uri-online-judge/1277/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 1 3 | Justin 4 | PAAPP 5 | 2 6 | Justin Chris 7 | PAAPP PPPPA 8 | 1 9 | Sunny 10 | PPPAM 11 | 4 12 | Mansi Arjun Nikhil Taneja 13 | PPPPMPPAPP AAMAAPP PPPPAAP PPPAAAMPP -------------------------------------------------------------------------------- /uri-online-judge/2139/input.txt: -------------------------------------------------------------------------------- 1 | 12 31 2 | 12 26 3 | 12 25 4 | 12 24 5 | 12 23 6 | 12 1 7 | 11 1 8 | 10 1 9 | 9 1 10 | 8 1 11 | 7 1 12 | 6 1 13 | 5 1 14 | 4 1 15 | 3 1 16 | 2 1 17 | 2 29 18 | 2 24 19 | 1 1 20 | -------------------------------------------------------------------------------- /hacker-rank/dynamic-programming-classics-the-longest-common-subsequence/compile-and-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -x 4 | 5 | g++ main.cpp -W -Wall -std=c++14 -O3 && for f in input*.txt; do cat "$f" | ./a.out; done; 6 | 7 | -------------------------------------------------------------------------------- /leetcode/python-template/main.py: -------------------------------------------------------------------------------- 1 | # {name} 2 | # {url} 3 | 4 | import array 5 | import bisect 6 | import collections 7 | import sortedcontainers 8 | 9 | class Solution: 10 | def solve(self): 11 | pass 12 | -------------------------------------------------------------------------------- /uri-online-judge/1161/input.txt: -------------------------------------------------------------------------------- 1 | 0 0 2 | 0 1 3 | 0 2 4 | 0 3 5 | 0 4 6 | 0 5 7 | 0 6 8 | 0 7 9 | 0 8 10 | 0 9 11 | 0 10 12 | 0 11 13 | 0 12 14 | 0 13 15 | 0 14 16 | 0 15 17 | 0 16 18 | 0 17 19 | 0 18 20 | 0 19 21 | 0 20 22 | -------------------------------------------------------------------------------- /uri-online-judge/1148/input.txt: -------------------------------------------------------------------------------- 1 | 4 5 2 | 1 2 5 3 | 2 1 10 4 | 3 4 8 5 | 4 3 7 6 | 2 3 6 7 | 5 8 | 1 2 9 | 1 3 10 | 1 4 11 | 4 3 12 | 4 1 13 | 3 3 14 | 1 2 10 15 | 2 3 1 16 | 3 2 1 17 | 3 18 | 1 3 19 | 3 1 20 | 3 2 21 | 0 0 22 | -------------------------------------------------------------------------------- /uri-online-judge/2031/input.txt: -------------------------------------------------------------------------------- 1 | 9 2 | aereo 3 | aereo 4 | aereo 5 | pedra 6 | aereo 7 | papel 8 | pedra 9 | aereo 10 | pedra 11 | pedra 12 | pedra 13 | papel 14 | papel 15 | aereo 16 | papel 17 | pedra 18 | papel 19 | papel 20 | -------------------------------------------------------------------------------- /uri-online-judge/1027/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | 0 1 3 | 1 0 4 | 1 -1 5 | 2 -2 6 | 3 1 7 | 3 -1 8 | 3 -2 9 | 4 1 10 | 4 -1 11 | 5 -1 12 | 10 13 | 0 2 14 | 2 0 15 | 1 -1 16 | 2 -2 17 | 3 1 18 | 3 -1 19 | 3 -2 20 | 4 1 21 | 4 -1 22 | 5 –1 23 | -------------------------------------------------------------------------------- /codechef/cpp-template/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | {name} 3 | {url} 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | return EXIT_SUCCESS; 14 | } 15 | -------------------------------------------------------------------------------- /leetcode/cpp-template/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | {name} 3 | {url} 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | return EXIT_SUCCESS; 14 | } 15 | -------------------------------------------------------------------------------- /leetcode/problems/word-frequency/main.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 192. Word Frequency 4 | # https://leetcode.com/problems/word-frequency/ 5 | 6 | cat words.txt | xargs | sed 's/ /\n/g' | sort | uniq -c | sort -n -r | awk '{ print $2 " " $1 }' 7 | -------------------------------------------------------------------------------- /uri-online-judge/1023/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 3 22 3 | 2 11 4 | 3 39 5 | 5 6 | 1 25 7 | 2 20 8 | 3 31 9 | 2 40 10 | 6 70 11 | 5 12 | 8 80 13 | 9 80 14 | 3 120 15 | 4 30 16 | 4 60 17 | 5 18 | 8 80 19 | 9 90 20 | 8 80 21 | 4 30 22 | 4 60 23 | 0 24 | -------------------------------------------------------------------------------- /uri-online-judge/1082/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 3 1 3 | a c 4 | 10 10 5 | a b 6 | a c 7 | a g 8 | b c 9 | c g 10 | e d 11 | d f 12 | h i 13 | i j 14 | j h 15 | 6 4 16 | a b 17 | b c 18 | c a 19 | e f 20 | 5 4 21 | d a 22 | c a 23 | b d 24 | e c 25 | -------------------------------------------------------------------------------- /uri-online-judge/2023/input.txt: -------------------------------------------------------------------------------- 1 | Joaquim Jose da Silva Xavier 2 | Pedro de Alcantara Joao Carlos Leopoldo Salvador Bibiano Francisco Xavier Miguel 3 | Pedro de Alcantara Francisco Antonio Joao Carlos Xavier de Paula Miguel Cipriano 4 | Pedro Raymundo -------------------------------------------------------------------------------- /hacker-rank/cpp-template/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | {name} 3 | {url} 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | return EXIT_SUCCESS; 14 | } 15 | -------------------------------------------------------------------------------- /spoj-brasil/cpp-template/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | {name} 3 | {url} 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | return EXIT_SUCCESS; 14 | } 15 | -------------------------------------------------------------------------------- /uri-online-judge/1410/input.txt: -------------------------------------------------------------------------------- 1 | 2 3 2 | 500 700 3 | 700 500 500 4 | 2 2 5 | 200 400 6 | 200 1000 7 | 3 4 8 | 530 510 490 9 | 480 470 50 310 10 | 2 3 11 | 50 50 12 | 80 40 30 13 | 2 5 14 | 50 50 15 | 50 50 50 50 60 16 | 1 2 17 | 50 18 | 60 50 19 | 0 0 -------------------------------------------------------------------------------- /uri-online-judge/cpp-template/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | {name} 3 | {url} 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | return EXIT_SUCCESS; 14 | } 15 | -------------------------------------------------------------------------------- /uri-online-judge/1076/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 0 3 | 16 15 4 | 0 4 5 | 2 3 6 | 6 2 7 | 8 9 8 | 10 9 9 | 8 12 10 | 14 15 11 | 14 10 12 | 6 5 13 | 10 11 14 | 11 7 15 | 4 8 16 | 0 1 17 | 1 2 18 | 12 13 19 | 1 20 | 9 6 21 | 1 2 22 | 1 4 23 | 4 7 24 | 7 8 25 | 4 1 26 | 4 3 27 | -------------------------------------------------------------------------------- /uri-online-judge/2314/input-1.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | int main(void){if(1){printf("in\n");}else{printf("out\n");}while(1){printf("in\n");break;}printf("out\n");int i;for(i=0;i<10;i++){printf("Hello World\n");}return 0;} 5 | -------------------------------------------------------------------------------- /topcoder/cpp-template/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Problem Name: {name} 3 | Used In: {usedIn} 4 | Used As: {useAd} 5 | Categories: {categories} 6 | 7 | {URL} 8 | */ 9 | 10 | using namespace std; 11 | 12 | class CLASS_NAME { 13 | public: 14 | 15 | }; 16 | -------------------------------------------------------------------------------- /uri-online-judge/1924/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Vitória e a Indecisão 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1924 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | printf("Ciencia da Computacao\n"); 10 | 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /uri-online-judge/1239/input.txt: -------------------------------------------------------------------------------- 1 | You _should_ see the new walrus at the zoo! 2 | Move it from *Accounts Payable* to *Receiving*. 3 | I saw _Chelydra serpentina_ in *Centennial Park*. 4 | _ _ __ _ yabba dabba _ * dooooo * **** 5 | _now_I_know_*my*_ABC_next_time_*sing*it_with_me 6 | -------------------------------------------------------------------------------- /uri-online-judge/1566/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 3 | 65 31 37 37 72 76 61 35 57 37 4 | 12 5 | 45 186 185 55 51 51 22 78 64 26 49 21 6 | 10 7 | 20 93 203 67 64 225 112 81 58 180 8 | 8 9 | 169 189 220 228 68 32 214 180 10 | 6 11 | 133 55 67 166 112 41 12 | 4 13 | 39 38 120 55 14 | -------------------------------------------------------------------------------- /uri-online-judge/1286/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 3 | 15 5 4 | 23 4 5 | 21 2 6 | 16 4 7 | 19 5 8 | 18 2 9 | 2 10 | 15 11 | 47 12 12 | 39 4 13 | 5 14 | 23 15 | 43 9 16 | 4 1 17 | 17 2 18 | 13 5 19 | 54 17 20 | 6 21 | 7 22 | 14 4 23 | 21 2 24 | 26 7 25 | 18 4 26 | 30 13 27 | 10 2 28 | 0 29 | -------------------------------------------------------------------------------- /uri-online-judge/1250/input.txt: -------------------------------------------------------------------------------- 1 | 4 2 | 9 3 | 1 3 2 3 3 1 2 2 1 4 | JJSSSJSSJ 5 | 49 6 | 1 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 3 3 3 4 4 4 4 4 4 4 5 5 5 5 5 5 5 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 | SSSSSSSSSSSSSSJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ 8 | 4 9 | 1 2 2 1 10 | SJJS 11 | 1 12 | 1 13 | J 14 | -------------------------------------------------------------------------------- /uri-online-judge/2334/main.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Patinhos 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2334 4 | ''' 5 | 6 | while True: 7 | n = int(raw_input()) 8 | 9 | if n == -1: 10 | break 11 | else: 12 | r = max(0, n - 1) 13 | print(r) 14 | -------------------------------------------------------------------------------- /uri-online-judge/1003/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Soma Simples 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1003 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b; 10 | 11 | scanf("%d %d", &a, &b); 12 | printf("SOMA = %d\n", a + b); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /uri-online-judge/1957/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Converter para Hexadecimal 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1957 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n; 10 | 11 | scanf("%d", &n); 12 | 13 | printf("%X\n", n); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /uri-online-judge/1004/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Produto Simples 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1004 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b; 10 | 11 | scanf("%d %d", &a, &b); 12 | printf("SOMA = %d\n", a + b); 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /uri-online-judge/1001/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Extremamente Básico 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1001 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b; 10 | 11 | scanf("%d %d", &a, &b); 12 | 13 | printf("X = %d\n", a + b); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /uri-online-judge/1059/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Números Pares 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1059 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i; 10 | 11 | for (i = 2; i < 101; i += 2) { 12 | printf("%d\n", i); 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /uri-online-judge/1281/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 4 3 | mamao 2.19 4 | cebola 3.10 5 | tomate 2.801 6 | uva 2.73 7 | 3 8 | mamao 2 9 | tomate 1 10 | uva 3 11 | 5 12 | morango 6.70 13 | repolho 1.12 14 | brocolis 1.71 15 | tomate 2.80 16 | cebola 2.81 17 | 5 18 | brocolis 2 19 | tomate 1 20 | cebola 1 21 | morango 1 22 | mamao 2 23 | -------------------------------------------------------------------------------- /uri-online-judge/2234/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Cachorros-Quentes 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2234 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b; 10 | 11 | scanf("%d %d", &a, &b); 12 | 13 | printf("%.2f\n", 1.0 * a / b); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/cpp-template/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | II USP Freshmen Contest (http://codeforces.com/gym/100985) 3 | {{name}} ({{url}}) 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | return EXIT_SUCCESS; 14 | } 15 | -------------------------------------------------------------------------------- /uri-online-judge/1016/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Distância 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1016 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double distancia; 10 | 11 | scanf("%lf", &distancia); 12 | 13 | printf("%.0f minutos\n", distancia * 2); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /uri-online-judge/1002/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Área do Círculo 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1002 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double r; 10 | double pi = 3.14159; 11 | 12 | scanf("%lf", &r); 13 | printf("A=%.4lf\n", r * r * pi); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /uri-online-judge/1930/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Tomadas 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1930 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b, c, d; 10 | 11 | scanf("%d %d %d %d", &a, &b, &c, &d); 12 | 13 | printf("%d\n", a + b + c + d - 3); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /uri-online-judge/2314/input-2.txt: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | int i;int fib(int x){i++;if(x==0){return 0;}else{if(x==1){return 1;}}else{return(fib(x-1)+fib(x-2));}}int main(void){int n,x;scanf("%d",&n);i=0;while(n--){i=0;scanf("%d",&x);printf("fib(%d) = %d calls = %d\n", x, i-1,fib(x));}return(0);} 5 | -------------------------------------------------------------------------------- /uri-online-judge/1257/input.txt: -------------------------------------------------------------------------------- 1 | 5 2 | 2 3 | CBA 4 | DDD 5 | 1 6 | Z 7 | 6 8 | A 9 | B 10 | C 11 | D 12 | E 13 | F 14 | 6 15 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 16 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 17 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 18 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 19 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 20 | ABCDEFGHIJKLMNOPQRSTUVWXYZ 21 | 1 22 | ZZZZZZZZZZ 23 | -------------------------------------------------------------------------------- /uri-online-judge/1011/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Esfera 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1011 4 | */ 5 | 6 | #include 7 | 8 | #define PI 3.14159 9 | 10 | int main (void) { 11 | double r; 12 | 13 | scanf("%lf", &r); 14 | 15 | printf("VOLUME = %.3f\n", 4.0 / 3.0 * PI * r * r * r); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /uri-online-judge/1197/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Volta à Faculdade de Física 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1197 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int v, t; 10 | 11 | while (scanf("%d %d", &v, &t) != EOF) { 12 | printf("%d\n", v * t * 2); 13 | } 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /uri-online-judge/1805/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Soma Natural 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1805 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | unsigned long long int A, B; 10 | 11 | scanf("%llu %llu", &A, &B); 12 | 13 | printf("%d\n", (A + B) * (B - A + 1) / 2); 14 | 15 | return 0; 16 | } 17 | -------------------------------------------------------------------------------- /uri-online-judge/1026/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Carrega ou não Carrega? 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1026 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | unsigned int a, b; 10 | 11 | while (scanf("%u %u", &a, &b) != EOF) { 12 | // xor 13 | printf("%u\n", a ^ b); 14 | } 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /uri-online-judge/1933/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Tri-du 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1933 4 | */ 5 | 6 | #include 7 | 8 | #define MAX(a, b) ((a) > (b) ? (a) : (b)) 9 | 10 | int main (void) { 11 | int a, b; 12 | 13 | scanf("%d %d", &a, &b); 14 | 15 | printf("%d\n", MAX(a, b)); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /uri-online-judge/1007/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Diferença 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1007 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b, c, d; 10 | 11 | scanf("%d %d %d %d", &a, &b, &c, &d); 12 | 13 | int e = a * b - c * d; 14 | 15 | printf("DIFERENCA = %d\n", e); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /uri-online-judge/1155/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequência S 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1155 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double s, 10 | t = 0; 11 | 12 | for (s = 1; s <= 100.0; s++) { 13 | t += 1 / s; 14 | } 15 | 16 | printf("%.2f\n", t); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1014/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Consumo 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1014 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int distancia; 10 | double combustivel; 11 | 12 | scanf("%d %lf", &distancia, &combustivel); 13 | 14 | printf("%.3f km/l\n", distancia / combustivel); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /uri-online-judge/1078/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Tabuada 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1078 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n, 10 | i; 11 | 12 | scanf("%d", &n); 13 | 14 | for (i = 1; i < 11; i++) { 15 | printf("%d x %d = %d\n", i, n, i * n); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1013/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | O Maior 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1013 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b, c; 10 | 11 | scanf("%d %d %d", &a, &b, &c); 12 | 13 | int m = a > b ? a : b; 14 | m = m > c ? m : c; 15 | 16 | printf("%d eh o maior\n", m); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1095/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequencia IJ 1 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1095 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i = 1, 10 | j = 60; 11 | 12 | while (j > -5) { 13 | printf("I=%d J=%d\n", i, j); 14 | 15 | i += 3; 16 | j -= 5; 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /uri-online-judge/2374/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Pneu 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2374 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N, M; 14 | 15 | cin >> N >> M; 16 | 17 | cout << N - M << endl; 18 | 19 | return EXIT_SUCCESS; 20 | } 21 | -------------------------------------------------------------------------------- /uri-online-judge/1005/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Média 1 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1005 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double a, b; 10 | 11 | scanf("%lf %lf", &a, &b); 12 | 13 | double f = (a * 3.5 + b * 7.5) / 11.0; 14 | f = f >= 10.0 ? 10.0 : f; 15 | 16 | printf("MEDIA = %.5f\n", f); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1067/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Números Ímpares 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1067 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int quantidade, 10 | i; 11 | 12 | scanf("%d", &quantidade); 13 | 14 | for (i = 1; i <= quantidade; i += 2) { 15 | printf("%d\n", i); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1143/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Quadrado e ao Cubo 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1143 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n, 10 | i; 11 | 12 | scanf("%d", &n); 13 | 14 | for (i = 1; i <= n; i++) { 15 | printf("%d %d %d\n", i, i * i, i * i * i); 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1958/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Notação Científica 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1958 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double n; 10 | 11 | scanf("%lf", &n); 12 | 13 | // "+" prefixa sinal 14 | // E -> notação científica (letra maiúscula) 15 | printf("%+.4E\n", n); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /uri-online-judge/1959/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Polígonos Regulares Simples 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1959 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double lados, 10 | comprimento; 11 | 12 | scanf("%lf %lf", &lados, &comprimento); 13 | 14 | printf("%.0f\n", lados * comprimento); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /uri-online-judge/2146/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Senha 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2146 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N; 14 | 15 | while (cin >> N) { 16 | cout << (N - 1) << '\n'; 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /uri-online-judge/2413/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Busca na Internet 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2413 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int T; 14 | 15 | cin >> T; 16 | 17 | cout << T * 4 << endl; 18 | 19 | return EXIT_SUCCESS; 20 | } 21 | -------------------------------------------------------------------------------- /uri-online-judge/1305/input.txt: -------------------------------------------------------------------------------- 1 | 0000001.9 2 | 0.9100 3 | 000001.90 4 | 0.9100 5 | 00001.91 6 | 0.9000 7 | .123 8 | 0.0009 9 | 0.21901 10 | 0.2190 11 | .02190001 12 | 0.0219 13 | 030.123 14 | 0.1240 15 | 090.12 16 | 0.1240 17 | 999.18 18 | 0.1799 19 | 999.18 20 | 0.0019 21 | 999.999 22 | 0.9999 23 | 999.9 24 | 0.9991 25 | 999.99 26 | 0.9991 27 | 999.999 28 | 0.9991 29 | 999.9990 30 | 0.9991 31 | -------------------------------------------------------------------------------- /uri-online-judge/1387/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Og 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1387 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int homens, 10 | mulheres; 11 | 12 | while (scanf("%d %d", &homens, &mulheres), homens != 0 || mulheres != 0) { 13 | printf("%d\n", homens + mulheres); 14 | } 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /uri-online-judge/1921/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Guilherme e Suas Pipas 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1921 4 | */ 5 | 6 | #include 7 | 8 | // diagonais = (lados * (lados - 3)) / 2; 9 | 10 | int main (void) { 11 | double lados; 12 | 13 | scanf("%lf", &lados); 14 | 15 | printf("%.0f\n", (lados * (lados - 3)) / 2); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /uri-online-judge/2484/out.txt: -------------------------------------------------------------------------------- 1 | A B R A C A D A B R A 2 | A B R A C A D A B R 3 | A B R A C A D A B 4 | A B R A C A D A 5 | A B R A C A D 6 | A B R A C A 7 | A B R A C 8 | A B R A 9 | A B R 10 | A B 11 | A 12 | 13 | H E L P M E 14 | H E L P M 15 | H E L P 16 | H E L 17 | H E 18 | H 19 | 20 | D I S 21 | D I 22 | D 23 | 24 | -------------------------------------------------------------------------------- /uri-online-judge/1006/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Média 2 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1006 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double a, b, c; 10 | 11 | scanf("%lf %lf %lf", &a, &b, &c); 12 | 13 | double f = a * 0.2 + b * 0.3 + c * 0.5; 14 | f = f >= 10.0 ? 10.0 : f; 15 | 16 | printf("MEDIA = %.1f\n", f); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1017/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Gasto de Combustível 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1017 4 | */ 5 | 6 | #include 7 | 8 | #define CONSUMO 12 9 | 10 | int main (void) { 11 | double velocidade, tempo; 12 | 13 | scanf("%lf %lf", &velocidade, &tempo); 14 | 15 | printf("%.3f\n", tempo * velocidade / CONSUMO); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /uri-online-judge/1073/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Quadrado de Pares 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1073 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n, 10 | i; 11 | 12 | scanf("%d", &n); 13 | 14 | n++; 15 | 16 | for (i = 2; i < n; i += 2) { 17 | printf("%d^2 = %d\n", i, i * i); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/2243/gen.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main (void) { 6 | int N, 7 | i; 8 | 9 | N = 5e4; 10 | 11 | printf("%d\n", N); 12 | 13 | srand(time(NULL)); 14 | 15 | for (i = 0; i < N; i++) { 16 | printf("%d ", rand() % N + 1); 17 | } 18 | 19 | printf("\n"); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/1075/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Resto 2 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1075 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n, 10 | i; 11 | 12 | scanf("%d", &n); 13 | 14 | if (n > 2) { 15 | for (i = 2; i < 10000; i += n) { 16 | printf("%d\n", i); 17 | } 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1096/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequencia IJ 2 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1096 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i, 10 | j; 11 | 12 | for (i = 1; i < 10; i += 2) { 13 | for (j = 7; j > 4; j--) { 14 | printf("I=%d J=%d\n", i, j); 15 | } 16 | } 17 | 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /uri-online-judge/1963/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | O Filme 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1963 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double valorAnterior, 10 | valorAtual; 11 | 12 | scanf("%lf %lf", &valorAnterior, &valorAtual); 13 | 14 | printf("%.2f%%\n", (valorAtual / valorAnterior - 1.0) * 100.0); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /uri-online-judge/1038/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Lanche 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1038 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double valores[] = { 4, 4.5, 5, 2, 1.5 }; 10 | int codigo, quantidade; 11 | 12 | scanf("%d %d", &codigo, &quantidade); 13 | 14 | printf("Total: R$ %.2f\n", valores[codigo - 1] * quantidade); 15 | 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /uri-online-judge/1589/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Bob Conduite 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1589 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int casos, 10 | a, b; 11 | 12 | scanf("%d", &casos); 13 | 14 | while (casos-- > 0) { 15 | scanf("%d %d", &a, &b); 16 | 17 | printf("%d\n", a + b); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1097/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequencia IJ 3 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1097 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i, 10 | j; 11 | 12 | for (i = 1; i < 10; i += 2) { 13 | for (j = 7; j > 4; j--) { 14 | printf("I=%d J=%d\n", i, j + i - 1); 15 | } 16 | } 17 | 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /uri-online-judge/1145/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequência Lógica 2 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1145 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int x, 10 | y, 11 | i; 12 | 13 | scanf("%d %d", &x, &y); 14 | 15 | for (i = 1; i <= y; i++) { 16 | printf("%d%c", i, i % x == 0 ? '\n' : ' '); 17 | } 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /uri-online-judge/1146/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequências Crescentes 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1146 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i, 10 | n; 11 | 12 | while(scanf("%d", &n), n) { 13 | for (i = 1; i <= n; i++) { 14 | printf("%d%c", i, i == n ? '\n' : ' '); 15 | } 16 | } 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1177/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Preenchimento de Vetor II 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1177 4 | */ 5 | 6 | #include 7 | 8 | #define SIZE 1000 9 | 10 | int main (void) { 11 | int i, 12 | n; 13 | 14 | scanf("%d", &n); 15 | 16 | for (i = 0; i < SIZE; i++) { 17 | printf("N[%d] = %d\n", i, i % n); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1009/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Salário com Bônus 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1009 4 | */ 5 | 6 | #include 7 | 8 | #define NAME_SIZE 64 9 | 10 | int main (void) { 11 | char nome[NAME_SIZE]; 12 | double salary, sells; 13 | 14 | scanf("%s %lf %lf", nome, &salary, &sells); 15 | 16 | printf("TOTAL = R$ %.2f\n", salary + sells * 0.15); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1015/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Distância Entre Dois Pontos 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1015 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main (void) { 10 | double x1, y1; 11 | double x2, y2; 12 | 13 | scanf("%lf %lf %lf %lf", &x1, &y1, &x2, &y2); 14 | 15 | printf("%.4f\n", sqrt(pow(x2 - x1, 2) + pow(y2 - y1, 2))); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /uri-online-judge/1008/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Salário 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1008 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int number, hours; 10 | double salaryPerHour; 11 | 12 | scanf("%d %d %lf", &number, &hours, &salaryPerHour); 13 | 14 | printf("NUMBER = %d\n", number); 15 | printf("SALARY = U$ %.2f\n", hours * salaryPerHour); 16 | 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /uri-online-judge/1114/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Senha Fixa 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1114 4 | */ 5 | 6 | #include 7 | 8 | #define SENHA_VALIDA 2002 9 | 10 | int main (void) { 11 | int senha; 12 | 13 | while (scanf("%d\n", &senha), senha != SENHA_VALIDA) { 14 | printf("Senha Invalida\n"); 15 | } 16 | 17 | printf("Acesso Permitido\n"); 18 | 19 | return 0; 20 | } 21 | -------------------------------------------------------------------------------- /uri-online-judge/1044/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Múltiplos 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1044 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b; 10 | 11 | scanf("%d %d", &a, &b); 12 | 13 | if (a % b == 0 || b % a == 0) { 14 | printf("Sao Multiplos\n"); 15 | } 16 | else { 17 | printf("Nao sao Multiplos\n"); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1260/input.txt: -------------------------------------------------------------------------------- 1 | 2 2 | 3 | Red Alder 4 | Ash 5 | Aspen 6 | Basswood 7 | Ash 8 | Beech 9 | Yellow Birch 10 | Ash 11 | Cherry 12 | Cottonwood 13 | Ash 14 | Cypress 15 | Red Elm 16 | Gum 17 | Hackberry 18 | White Oak 19 | Hickory 20 | Pecan 21 | Hard Maple 22 | White Oak 23 | Soft Maple 24 | Red Oak 25 | Red Oak 26 | White Oak 27 | Poplan 28 | Sassafras 29 | Sycamore 30 | Black Walnut 31 | Willow 32 | 33 | Red Alder 34 | Ash -------------------------------------------------------------------------------- /uri-online-judge/1065/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Pares entre Cinco Números 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1065 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i, q = 0; 10 | int numero; 11 | 12 | for (i = 0; i < 5; i++) { 13 | scanf("%d", &numero); 14 | 15 | if (numero % 2 == 0) q++; 16 | } 17 | 18 | printf("%d valores pares\n", q); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1258/input.txt: -------------------------------------------------------------------------------- 1 | 9 2 | Maria Jose 3 | branco P 4 | Mangojata Mancuda 5 | vermelho P 6 | Cezar Torres Mo 7 | branco P 8 | Baka Lhau 9 | vermelho P 10 | JuJu Mentina 11 | branco M 12 | Amaro Dinha 13 | vermelho P 14 | Adabi Finho 15 | branco G 16 | Severina Rigudinha 17 | branco G 18 | Carlos Chade Losna 19 | vermelho P 20 | 3 21 | Maria Joao 22 | branco P 23 | Marcio Guess 24 | vermelho P 25 | Maria Jose 26 | branco P 27 | 0 28 | -------------------------------------------------------------------------------- /uri-online-judge/1060/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Números Positivos 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1060 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i, q = 0; 10 | double numero; 11 | 12 | 13 | for (i = 0; i < 6; i++) { 14 | scanf("%lf", &numero); 15 | 16 | if (numero > 0.0) q++; 17 | } 18 | 19 | printf("%d valores positivos\n", q); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/1169/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Trigo no Tabuleiro 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1169 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main (void) { 10 | int casos, 11 | n; 12 | scanf("%d", &casos); 13 | 14 | while (casos-- > 0) { 15 | scanf("%d", &n); 16 | 17 | printf("%.0f kg\n", floor(pow(2, n) / 12000)); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1178/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Preenchimento de Vetor III 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1178 4 | */ 5 | 6 | #include 7 | 8 | #define SIZE 100 9 | 10 | int main (void) { 11 | double n; 12 | int i; 13 | 14 | scanf("%lf", &n); 15 | 16 | for (i = 0; i < SIZE; i++) { 17 | printf("N[%d] = %.4f\n", i, n); 18 | n /= 2.0; 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/2165/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Tuitando 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2165 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | string line; 15 | 16 | getline(cin, line); 17 | 18 | if (line.length() > 140) cout << "MUTE\n"; 19 | else cout << "TWEET\n"; 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/1070/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Seis Números Ímpares 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1070 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int numero, 10 | i; 11 | 12 | scanf("%d", &numero); 13 | 14 | numero = numero % 2 == 0 ? numero + 1 : numero; 15 | 16 | for (i = 0; i < 6; numero += 2, i++) { 17 | printf("%d\n", numero); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1154/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Idades 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1154 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int idade, 10 | quantidade = 0, 11 | soma = 0; 12 | 13 | while (scanf("%d", &idade), idade > -1) { 14 | soma += idade; 15 | quantidade++; 16 | } 17 | 18 | printf("%.2f\n", (double)soma / quantidade); 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/2160/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Nome no Formulário 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2160 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | string line; 15 | 16 | getline(cin, line); 17 | 18 | if (line.length() > 80) cout << "NO\n"; 19 | else cout << "YES\n"; 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/1172/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Substituição em Vetor I 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1172 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int x[10], 10 | i; 11 | 12 | for (i = 0; i < 10; i++) { 13 | scanf("%d", &x[i]); 14 | 15 | if (x[i] < 1) { 16 | x[i] = 1; 17 | } 18 | 19 | printf("X[%d] = %d\n", i, x[i]); 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /uri-online-judge/1173/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Preenchimento de Vetor I 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1173 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n[10], 10 | i; 11 | 12 | scanf("%d", &n[0]); 13 | 14 | printf("N[%d] = %d\n", 0, n[0]); 15 | for (i = 1; i < 10; i++) { 16 | n[i] = n[i - 1] * 2; 17 | printf("N[%d] = %d\n", i, n[i]); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1759/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Ho Ho Ho 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1759 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n; 10 | 11 | scanf("%d", &n); 12 | 13 | while (n-- > 0) { 14 | printf("Ho"); 15 | 16 | if (n == 0) { 17 | printf("!\n"); 18 | } 19 | else { 20 | printf(" "); 21 | } 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /uri-online-judge/1864/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Nossos Dias Nunca Voltarão 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1864 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | char frase[35] = "LIFE IS NOT A PROBLEM TO BE SOLVED"; 10 | int quantidadeDeCaracteres; 11 | 12 | scanf("%d", &quantidadeDeCaracteres); 13 | 14 | frase[quantidadeDeCaracteres] = '\0'; 15 | 16 | printf("%s\n", frase); 17 | 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /uri-online-judge/1142/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | PUM 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1142 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n, 10 | p = 1, 11 | i; 12 | 13 | scanf("%d", &n); 14 | 15 | while (n-- > 0) { 16 | for (i = 0; i < 3; i++) { 17 | printf("%d ", p++); 18 | } 19 | 20 | p++; 21 | printf("PUM\n"); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /uri-online-judge/1079/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Médias Ponderadas 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1079 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n; 10 | double a, 11 | b, 12 | c; 13 | 14 | scanf("%d", &n); 15 | 16 | while (n-- > 0) { 17 | scanf("%lf %lf %lf", &a, &b, &c); 18 | printf("%.1f\n", a * 0.2 + b * 0.3 + c * 0.5); 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/1113/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Crescente e Decrescente 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1113 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int x, 10 | y; 11 | 12 | while (scanf("%d %d\n", &x, &y), x != y) { 13 | if (x < y) { 14 | printf("Crescente\n"); 15 | } 16 | else { 17 | printf("Decrescente\n"); 18 | } 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/1020/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Idade em Dias 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1020 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int dias; 10 | int quantidade; 11 | 12 | scanf("%d", &dias); 13 | 14 | printf("%d ano(s)\n", dias / 365); 15 | dias = dias % 365; 16 | 17 | printf("%d mes(es)\n", dias / 30); 18 | dias = dias % 30; 19 | 20 | printf("%d dia(s)\n", dias); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /uri-online-judge/1150/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Ultrapassando Z 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1150 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int x, 10 | z, 11 | soma = 0, 12 | i; 13 | 14 | scanf("%d", &x); 15 | 16 | while (scanf("%d", &z), z <= x); 17 | 18 | 19 | for (i = 0; soma <= z; i++) { 20 | soma += x++; 21 | } 22 | 23 | printf("%d\n", i); 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /uri-online-judge/1170/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Blobs 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1170 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main (void) { 10 | int casos; 11 | double comidaDisponivel; 12 | 13 | scanf("%d", &casos); 14 | 15 | while (casos-- > 0) { 16 | scanf("%lf", &comidaDisponivel); 17 | 18 | printf("%.0f dias\n", ceil(log2(comidaDisponivel))); 19 | } 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/1174/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Seleçao em Vetor I 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1174 4 | */ 5 | 6 | #include 7 | 8 | #define SIZE 100 9 | 10 | int main (void) { 11 | double a[SIZE]; 12 | int i; 13 | 14 | for (i = 0; i < SIZE; i++) { 15 | scanf("%lf", &a[i]); 16 | 17 | if (a[i] <= 10.0) { 18 | printf("A[%d] = %.1f\n", i, a[i]); 19 | } 20 | } 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /uri-online-judge/1564/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Vai Ter Copa? 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1564 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int reclamacoes; 10 | 11 | while (scanf("%d\n", &reclamacoes) != EOF) { 12 | if (reclamacoes == 0) { 13 | printf("vai ter copa!\n"); 14 | } 15 | else { 16 | printf("vai ter duas!\n"); 17 | } 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/2483/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Feliz Nataaal! 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2483 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | int N; 15 | 16 | cin >> N; 17 | 18 | cout << "Feliz nat"; 19 | 20 | while (N-- > 0) cout << 'a'; 21 | 22 | cout << "l!" << endl; 23 | 24 | return EXIT_SUCCESS; 25 | } 26 | -------------------------------------------------------------------------------- /uri-online-judge/1030/main-recur.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main (void) { 4 | int nc, i; 5 | int n, k; 6 | 7 | scanf("%d", &nc); 8 | 9 | for (i = 0; i < nc; i++) { 10 | scanf("%d %d", &n, &k); 11 | 12 | printf("Case %d: %d\n", i + 1, calc(n, k)); 13 | fflush(stdout); 14 | } 15 | 16 | return 0; 17 | } 18 | 19 | int calc(int n, int k) 20 | { 21 | if (n == 1) 22 | return 1; 23 | else 24 | return ((calc(n - 1, k) + k - 1) % n) + 1; 25 | } 26 | -------------------------------------------------------------------------------- /uri-online-judge/1708/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Volta 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1708 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | using namespace std; 12 | 13 | int main(void) { 14 | ios::sync_with_stdio(false); 15 | 16 | int X, Y; 17 | 18 | cin >> X >> Y; 19 | 20 | cout << fixed << setprecision(0) << ceil(1.0 * X / (Y - X)) + 1.0 << endl; 21 | 22 | return EXIT_SUCCESS; 23 | } 24 | -------------------------------------------------------------------------------- /uri-online-judge/2454/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Flíper 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2454 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | int P, R; 15 | 16 | cin >> P >> R; 17 | 18 | if (P == 0) cout << "C"; 19 | else if (R == 0) cout << "B"; 20 | else cout << "A"; 21 | 22 | cout << endl; 23 | 24 | return EXIT_SUCCESS; 25 | } 26 | -------------------------------------------------------------------------------- /uri-online-judge/1046/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Tempo de Jogo 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1046 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int comeco, fim, duracao; 10 | 11 | scanf("%d %d", &comeco, &fim); 12 | 13 | if (comeco < fim) { 14 | duracao = fim - comeco; 15 | } 16 | else { 17 | duracao = 24 - comeco + fim; 18 | } 19 | 20 | printf("O JOGO DUROU %d HORA(S)\n", duracao); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /uri-online-judge/1156/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequência S II 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1156 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main (void) { 10 | double t = 0; 11 | 12 | int numerador = 1, 13 | denominador_exp = 0; 14 | 15 | while (numerador <= 39) { 16 | t += numerador / pow(2, denominador_exp++); 17 | 18 | numerador += 2; 19 | } 20 | 21 | printf("%.2f\n", t); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /uri-online-judge/1176/input.txt: -------------------------------------------------------------------------------- 1 | 61 2 | 0 3 | 1 4 | 2 5 | 3 6 | 4 7 | 5 8 | 6 9 | 7 10 | 8 11 | 9 12 | 10 13 | 11 14 | 12 15 | 13 16 | 14 17 | 15 18 | 16 19 | 17 20 | 18 21 | 19 22 | 20 23 | 21 24 | 22 25 | 23 26 | 24 27 | 25 28 | 26 29 | 27 30 | 28 31 | 29 32 | 30 33 | 31 34 | 32 35 | 33 36 | 34 37 | 35 38 | 36 39 | 37 40 | 38 41 | 39 42 | 40 43 | 41 44 | 42 45 | 43 46 | 44 47 | 45 48 | 46 49 | 47 50 | 48 51 | 49 52 | 50 53 | 51 54 | 52 55 | 53 56 | 54 57 | 55 58 | 56 59 | 57 60 | 58 61 | 59 62 | 60 63 | -------------------------------------------------------------------------------- /uri-online-judge/1010/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Cálculo Simples 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1010 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int codigo, quantidade; 10 | int i; 11 | double valor; 12 | double total = 0; 13 | 14 | 15 | for (i = 0; i < 2; i++) { 16 | scanf("%d %d %lf", &codigo, &quantidade, &valor); 17 | total += quantidade * valor; 18 | } 19 | 20 | printf("VALOR A PAGAR: R$ %.2f\n", total); 21 | 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /uri-online-judge/1612/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Formiguinha 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1612 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | 10 | using namespace std; 11 | 12 | int main(void) { 13 | ios::sync_with_stdio(false); 14 | 15 | int T; 16 | 17 | cin >> T; 18 | 19 | while(T-- > 0) { 20 | int N; 21 | 22 | cin >> N; 23 | 24 | cout << (N - 1) / 2 + 1 << '\n'; 25 | } 26 | 27 | return EXIT_SUCCESS; 28 | } 29 | -------------------------------------------------------------------------------- /uri-online-judge/1149/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Somando Inteiros Consecutivos 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1149 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int inicio, 10 | quantidade, 11 | soma = 0; 12 | 13 | scanf("%d", &inicio); 14 | 15 | while (scanf("%d", &quantidade), quantidade < 1); 16 | 17 | while (quantidade-- > 0) { 18 | soma += inicio++; 19 | } 20 | 21 | printf("%d\n", soma); 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /uri-online-judge/1031/gen.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Crise de Energia 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1031 4 | */ 5 | 6 | #include 7 | 8 | struct node { 9 | int value; 10 | node *next; 11 | node *prev; 12 | }; 13 | 14 | node* criar_lista(int n); 15 | 16 | using namespace std; 17 | 18 | int main(void) { 19 | ios::sync_with_stdio(false); 20 | 21 | for (int i = 13; i <= 100; i++) { 22 | cout << i << '\n'; 23 | } 24 | cout << 0 << endl; 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /uri-online-judge/1169/input.txt: -------------------------------------------------------------------------------- 1 | 64 2 | 1 3 | 2 4 | 3 5 | 4 6 | 5 7 | 6 8 | 7 9 | 8 10 | 9 11 | 10 12 | 11 13 | 12 14 | 13 15 | 14 16 | 15 17 | 16 18 | 17 19 | 18 20 | 19 21 | 20 22 | 21 23 | 22 24 | 23 25 | 24 26 | 25 27 | 26 28 | 27 29 | 28 30 | 29 31 | 30 32 | 31 33 | 32 34 | 33 35 | 34 36 | 35 37 | 36 38 | 37 39 | 38 40 | 39 41 | 40 42 | 41 43 | 42 44 | 43 45 | 44 46 | 45 47 | 46 48 | 47 49 | 48 50 | 49 51 | 50 52 | 51 53 | 52 54 | 53 55 | 54 56 | 55 57 | 56 58 | 57 59 | 58 60 | 59 61 | 60 62 | 61 63 | 62 64 | 63 65 | 64 66 | -------------------------------------------------------------------------------- /uri-online-judge/1541/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Construindo Casas 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1541 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #define SIZE 128 10 | 11 | int main (void) { 12 | int largura, 13 | comprimento, 14 | porcentagem; 15 | 16 | while (scanf("%d %d %d\n", &largura, &comprimento, &porcentagem) == 3) { 17 | printf("%.0f\n", floor(sqrt((largura * comprimento) / (porcentagem / 100.0)))); 18 | } 19 | 20 | return 0; 21 | } 22 | -------------------------------------------------------------------------------- /uri-online-judge/1866/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Conta 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1866 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int casos, 10 | quantidade; 11 | 12 | scanf("%d", &casos); 13 | 14 | while (casos-- > 0) { 15 | scanf("%d", &quantidade); 16 | 17 | if (quantidade % 2 != 0) { 18 | printf("1\n"); 19 | } 20 | else { 21 | printf("0\n"); 22 | } 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /uri-online-judge/1035/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Teste de Seleção 1 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1035 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b, c, d; 10 | 11 | scanf("%d %d %d %d", &a, &b, &c, &d); 12 | 13 | if (b > c 14 | && d > a 15 | && (c + d) > (a + b) 16 | && c > 0 17 | && d > 0 18 | && (a % 2) == 0) { 19 | printf("Valores aceitos\n"); 20 | } 21 | else { 22 | printf("Valores nao aceitos\n"); 23 | } 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /uri-online-judge/1157/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Divisores I 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1157 4 | */ 5 | 6 | #include 7 | 8 | void imprimirDivisores(int n); 9 | 10 | int main (void) { 11 | int n; 12 | 13 | scanf("%d", &n); 14 | 15 | imprimirDivisores(n); 16 | 17 | return 0; 18 | } 19 | 20 | void imprimirDivisores(int n) { 21 | int i; 22 | 23 | for (i = 1; i <= n; i++) { 24 | if (n % i == 0) { 25 | printf("%d\n", i); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /uri-online-judge/1153/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Fatorial Simples 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1153 4 | */ 5 | 6 | #include 7 | 8 | long unsigned int fatorial(int n); 9 | 10 | int main (void) { 11 | int nth; 12 | 13 | scanf("%d", &nth); 14 | 15 | printf("%lu\n", fatorial(nth)); 16 | 17 | return 0; 18 | } 19 | 20 | long unsigned int fatorial(int n) { 21 | if (n == 0) { 22 | return 1; 23 | } 24 | else { 25 | return n * fatorial(n - 1); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /uri-online-judge/1794/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Lavanderia 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1794 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N, 14 | LA, LB, 15 | SA, SB; 16 | 17 | cin >> N; 18 | cin >> LA >> LB; 19 | cin >> SA >> SB; 20 | 21 | if (N >= LA && N <= LB && N >= SA && N <= SB) cout << "possivel\n"; 22 | else cout << "impossivel\n"; 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /hacker-rank/a-very-big-sum/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | A Very Big Sum 3 | https://www.hackerrank.com/challenges/a-very-big-sum/problem 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N; 14 | unsigned long long int total = 0, value; 15 | 16 | cin >> N; 17 | 18 | while (N-- > 0) { 19 | cin >> value; 20 | 21 | total += value; 22 | } 23 | 24 | cout << total << endl; 25 | 26 | return EXIT_SUCCESS; 27 | } 28 | -------------------------------------------------------------------------------- /uri-online-judge/1585/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Fazendo Pandorgas 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1585 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int casos, 10 | area; 11 | double x, y; 12 | 13 | scanf("%d\n", &casos); 14 | 15 | while (casos-- > 0) { 16 | scanf("%lf %lf\n", &x, &y); 17 | 18 | x /= 2; 19 | y /= 2; 20 | 21 | area = 2 * x * y; 22 | 23 | printf("%d cm2\n", area); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /uri-online-judge/1012/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Área 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1012 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | const double pi = 3.14159; 10 | 11 | double a, b, c; 12 | 13 | scanf("%lf %lf %lf", &a, &b, &c); 14 | 15 | printf("TRIANGULO: %.3f\n", a * c / 2); 16 | printf("CIRCULO: %.3f\n", c * c * pi); 17 | printf("TRAPEZIO: %.3f\n", c * (a + b) / 2); 18 | printf("QUADRADO: %.3f\n", b * b); 19 | printf("RETANGULO: %.3f\n", a * b); 20 | 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /uri-online-judge/1116/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Dividindo X por Y 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1116 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n, 10 | x, 11 | y; 12 | 13 | scanf("%d\n", &n); 14 | 15 | while (n-- > 0) { 16 | scanf("%d %d\n", &x, &y); 17 | 18 | if (y == 0) { 19 | printf("divisao impossivel\n"); 20 | } 21 | else { 22 | printf("%.1f\n", (double)x / y); 23 | } 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /uri-online-judge/1144/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequência Lógica 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1144 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n, 10 | i, 11 | quadrado, 12 | cubo; 13 | 14 | scanf("%d", &n); 15 | 16 | for (i = 1; i <= n; i++) { 17 | quadrado = i * i; 18 | cubo = quadrado * i; 19 | 20 | printf("%d %d %d\n", i, quadrado, cubo); 21 | printf("%d %d %d\n", i, quadrado + 1, cubo + 1); 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /uri-online-judge/1052/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Mês 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1052 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | const char *meses[12] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; 10 | 11 | int mes; 12 | 13 | scanf("%d", &mes); 14 | 15 | if (mes < 13) { 16 | printf("%s\n", meses[mes - 1]); 17 | } 18 | else { 19 | printf("Unknown\n"); 20 | } 21 | 22 | 23 | return 0; 24 | } 25 | -------------------------------------------------------------------------------- /uri-online-judge/1300/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Horas e Minutos 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1300 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | bool eh_possivel(int A); 11 | 12 | int main(void) { 13 | ios::sync_with_stdio(false); 14 | 15 | int A; 16 | 17 | while (cin >> A) { 18 | if (eh_possivel(A)) cout << "Y\n"; 19 | else cout << "N\n"; 20 | } 21 | 22 | return 0; 23 | } 24 | 25 | bool eh_possivel(int A) { 26 | int r = A % 6; 27 | 28 | return (r == 0) ; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/1019/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Conversão de Tempo 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1019 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int segundos; 10 | int medidas[] = { 3600, 60, 1, 0 }; 11 | int i = 0; 12 | 13 | scanf("%d", &segundos); 14 | 15 | while (medidas[i] != 0) { 16 | if (i != 0) printf(":"); 17 | 18 | printf("%d", segundos / medidas[i]); 19 | segundos = segundos % medidas[i]; 20 | 21 | i++; 22 | } 23 | 24 | printf("\n"); 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /uri-online-judge/1247/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Guarda Costeira 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1247 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main (void) { 10 | int D, VF, VG; 11 | 12 | while (scanf("%d %d %d\n", &D, &VF, &VG) != EOF) { 13 | double tF = 12.0 / VF; 14 | double tG = sqrt(pow(D, 2) + pow(12, 2)) / VG; 15 | 16 | if (tG <= tF) { 17 | printf("S\n"); 18 | } 19 | else { 20 | printf("N\n"); 21 | } 22 | } 23 | 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /uri-online-judge/1796/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Economia Brasileira 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1796 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | int Q, 12 | A = 0; 13 | 14 | cin >> Q; 15 | 16 | for (int i = 0; i < Q; i++) { 17 | int R; 18 | 19 | cin >> R; 20 | 21 | if (R == 0) A++; 22 | } 23 | 24 | if (A > Q / 2) { 25 | cout << "Y\n"; 26 | } 27 | else { 28 | cout << "N\n"; 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /uri-online-judge/1159/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Soma de Pares Consecutivos 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1159 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int x, 10 | i, 11 | soma; 12 | 13 | while (scanf("%d", &x), x != 0) { 14 | if (x % 2 != 0) { 15 | x++; 16 | } 17 | 18 | soma = 0; 19 | 20 | for (i = 0; i < 5; i++) { 21 | soma += x; 22 | x += 2; 23 | } 24 | 25 | printf("%d\n", soma); 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /leetcode/problems/find-peak-element/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 162. Find Peak Element 3 | https://leetcode.com/problems/find-peak-element 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | class Solution { 11 | public: 12 | int findPeakElement(vector& nums) { 13 | for (size_t i = 0; i < nums.size() - 1; i++) { 14 | if (nums[i] > nums[i + 1]) return i; 15 | } 16 | 17 | return nums.size() - 1; 18 | } 19 | }; 20 | 21 | int main(void) { 22 | ios::sync_with_stdio(false); 23 | 24 | return EXIT_SUCCESS; 25 | } 26 | -------------------------------------------------------------------------------- /uri-online-judge/1195/input.txt: -------------------------------------------------------------------------------- 1 | 6 2 | 10 3 | 8 2 3 4 5 6 7 100 9 10 4 | 16 5 | 200 10 4 2 34 56 76 87 98 123 234 456 500 323 1 212 6 | 4 7 | 100 232 1 45 8 | 5 9 | 12 32 1 3 4 10 | 10 11 | 100 8 10 12 54 1 2 145 500 452 12 | 100 13 | 100 81 82 83 84 85 86 87 88 89 90 11 12 13 14 15 16 17 18 19 20 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 201 202 203 204 205 206 207 208 209 210 14 | -------------------------------------------------------------------------------- /uri-online-judge/1379/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Problema com Mediana e Média 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1379 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int A, B; 14 | 15 | while (cin >> A >> B, A != 0 || B != 0) { 16 | if (A > B) { 17 | int c = A; 18 | A = B; 19 | B = c; 20 | } 21 | 22 | int C = 3 * A - A - B; 23 | 24 | cout << C << endl; 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /uri-online-judge/2172/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Evento 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2172 4 | */ 5 | 6 | #include 7 | 8 | typedef unsigned long long int uint64; 9 | 10 | uint64 calcular(uint64 x, uint64 y); 11 | 12 | using namespace std; 13 | 14 | int main(void) { 15 | ios::sync_with_stdio(false); 16 | 17 | uint64 X, M; 18 | 19 | while (cin >> X >> M, X != 0 || M != 0) { 20 | cout << calcular(X, M) << endl; 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | uint64 calcular(uint64 x, uint64 y) { 27 | return x * y; 28 | } 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Online Judges - Solutions 2 | 3 | | Judge | Profile | 4 | | :--------: | :---------------------------------------------- | 5 | | Beecrowd | https://www.beecrowd.com.br/judge/profile/74386 | 6 | | Topcoder | https://www.topcoder.com/members/olegon.main | 7 | | Codeforces | http://codeforces.com/profile/_olegon | 8 | | HackerRank | https://www.hackerrank.com/olegon | 9 | | CodeChef | https://www.codechef.com/users/olegon | 10 | | LeetCode | https://leetcode.com/olegon | 11 | -------------------------------------------------------------------------------- /uri-online-judge/1064/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Positivos e Média 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1064 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i, 10 | q = 0; 11 | 12 | double numero, 13 | soma = 0.0; 14 | 15 | 16 | for (i = 0; i < 6; i++) { 17 | scanf("%lf", &numero); 18 | 19 | if (numero > 0.0) { 20 | soma += numero; 21 | q++; 22 | } 23 | } 24 | 25 | printf("%d valores positivos\n", q); 26 | printf("%.1f\n", soma / q); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/2345/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Assigning Teams 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2345 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | using namespace std; 11 | 12 | int main(void) { 13 | ios::sync_with_stdio(false); 14 | 15 | vector v; 16 | 17 | for (int i = 0; i < 4; i++) { 18 | int s; 19 | 20 | cin >> s; 21 | 22 | v.push_back(s); 23 | } 24 | 25 | sort(v.begin(), v.end()); 26 | 27 | cout << abs((v[0] + v[3]) - (v[1] + v[2])) << endl; 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /uri-online-judge/1028/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Figurinhas 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1028 4 | */ 5 | 6 | #include 7 | 8 | int euclidianMDC(int a, int b); 9 | 10 | int main (void) { 11 | int n, i; 12 | int f1, f2; 13 | 14 | scanf("%d", &n); 15 | 16 | for (i = 0; i < n; i++) { 17 | scanf("%d %d", &f1, &f2); 18 | 19 | printf("%d\n", euclidianMDC(f1, f2)); 20 | } 21 | 22 | return 0; 23 | } 24 | 25 | int euclidianMDC(int a, int b) { 26 | if (b == 0) { 27 | return a; 28 | } 29 | else { 30 | return euclidianMDC(b, a % b); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /uri-online-judge/1467/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Zerinho ou Um 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1467 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int a, b, c; 10 | 11 | while (scanf("%d %d %d\n", &a, &b, &c) != EOF) { 12 | if (a == b && b == c) { 13 | printf("*\n"); 14 | } 15 | else if (a == b) { 16 | printf("C\n"); 17 | } 18 | else if (b == c) { 19 | printf("A\n"); 20 | } 21 | else { 22 | printf("B\n"); 23 | } 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /uri-online-judge/1837/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Prefácio 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1837 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main (void) { 10 | int a, 11 | b, 12 | quociente, 13 | resto; 14 | 15 | scanf("%d %d", &a, &b); 16 | 17 | if (b > 0) { 18 | quociente = (int)floor((double)a / b); 19 | } 20 | else { 21 | quociente = (int)ceil((double)a / b); 22 | } 23 | 24 | resto = a - quociente * b; 25 | 26 | printf("%d %d\n", quociente, resto); 27 | 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /uri-online-judge/1865/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Mjölnir 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1865 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #define STRING_SIZE 256 10 | 11 | int main (void) { 12 | int casos; 13 | char nome[STRING_SIZE]; 14 | 15 | scanf("%d\n", &casos); 16 | 17 | while (casos-- > 0) { 18 | scanf("%s %*d\n", nome); 19 | 20 | if (strcmp(nome, "Thor") == 0) { 21 | printf("Y\n"); 22 | } 23 | else { 24 | printf("N\n"); 25 | } 26 | } 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/2029/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Reservatório de Mel 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2029 4 | */ 5 | 6 | #include 7 | 8 | #define PI 3.14 9 | 10 | 11 | 12 | int main (void) { 13 | double volume, 14 | diametro, 15 | raio, 16 | area; 17 | 18 | while (scanf("%lf\n%lf\n", &volume, &diametro) != EOF) { 19 | raio = diametro / 2; 20 | area = raio * raio * PI; 21 | 22 | printf("ALTURA = %.2f\n", volume / area); 23 | printf("AREA = %.2f\n", area); 24 | } 25 | 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /uri-online-judge/2147/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Galopeira 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2147 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | using namespace std; 11 | 12 | int main(void) { 13 | ios::sync_with_stdio(false); 14 | 15 | int C; 16 | 17 | cin >> C; 18 | cin.ignore(1); 19 | 20 | while(C-- > 0) { 21 | string line; 22 | 23 | getline(cin, line); 24 | 25 | double t = line.length() * 0.01; 26 | 27 | cout << fixed << setprecision(2) << t << endl; 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /uri-online-judge/2164/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Fibonacci Rápido 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2164 4 | */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | using namespace std; 11 | 12 | double fib(int n); 13 | 14 | int main(void) { 15 | ios::sync_with_stdio(false); 16 | 17 | int N; 18 | 19 | cin >> N; 20 | cout << fixed << setprecision(1) << fib(N) << '\n'; 21 | 22 | return 0; 23 | } 24 | 25 | double fib(int n) { 26 | double sqrtOf5 = sqrt(5); 27 | 28 | return (pow((1 + sqrtOf5) / 2, n) - pow((1 - sqrtOf5) / 2, n)) / sqrtOf5; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/2174/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Coleção de Pomekon 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2174 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N; 14 | set pomekons; 15 | 16 | cin >> N >> ws; 17 | 18 | while (N-- > 0) { 19 | string line; 20 | 21 | getline(cin, line); 22 | 23 | pomekons.insert(line); 24 | } 25 | 26 | cout << "Falta(m) " << (151 - pomekons.size()) << " pomekon(s)." << endl; 27 | 28 | return EXIT_SUCCESS; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/1098/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequencia IJ 4 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1098 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main (void) { 10 | float i, 11 | j; 12 | 13 | for (i = 0.0; i < 2.2; i += 0.2) { 14 | for (j = 1.0; j < 4.0; j++) { 15 | if (i == 0.0 || i == 1.0 || i > 1.9) { 16 | printf("I=%.0f J=%.0f\n", i, j + i); 17 | } 18 | else { 19 | printf("I=%.1f J=%.1f\n", i, j + i); 20 | } 21 | } 22 | } 23 | 24 | 25 | return 0; 26 | } 27 | -------------------------------------------------------------------------------- /uri-online-judge/1393/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Lajotas Hexagonais 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1393 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | typedef unsigned long long int uint64; 12 | 13 | int main(void) { 14 | ios::sync_with_stdio(false); 15 | 16 | uint64 fb[40 + 1]; 17 | 18 | fb[1] = 1; 19 | fb[2] = 2; 20 | 21 | for (int i = 3; i <= 40; i++) { 22 | fb[i] = fb[i - 1] + fb[i - 2]; 23 | } 24 | 25 | int N; 26 | 27 | while (cin >> N, N != 0) cout << fb[N] << '\n'; 28 | 29 | return EXIT_SUCCESS; 30 | } -------------------------------------------------------------------------------- /uri-online-judge/1175/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Troca em Vetor I 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1175 4 | */ 5 | 6 | #include 7 | 8 | #define SIZE 20 9 | 10 | int main (void) { 11 | int n[SIZE], 12 | i, 13 | aux; 14 | 15 | for (i = 0; i < SIZE; i++) { 16 | scanf("%d", &n[i]); 17 | } 18 | 19 | for (i = 0; i < SIZE / 2; i++) { 20 | aux = n[i]; 21 | n[i] = n[SIZE - 1 - i]; 22 | n[SIZE - 1 - i] = aux; 23 | } 24 | 25 | for (i = 0; i < SIZE; i++) { 26 | printf("N[%d] = %d\n", i, n[i]); 27 | } 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /hacker-rank/ctci-fibonacci-numbers/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Recursion: Fibonacci Numbers 3 | https://www.hackerrank.com/challenges/ctci-fibonacci-numbers/problem 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | typedef unsigned long long int uint64; 11 | 12 | int main(void) { 13 | ios::sync_with_stdio(false); 14 | 15 | int N; 16 | 17 | cin >> N; 18 | 19 | vector dp(N + 1); 20 | dp[0] = 0; 21 | dp[1] = 1; 22 | 23 | for (int i = 2; i <= N; i++) { 24 | dp[i] = dp[i - 1] + dp[i - 2]; 25 | } 26 | 27 | cout << dp[N] << endl; 28 | 29 | return EXIT_SUCCESS; 30 | } 31 | -------------------------------------------------------------------------------- /uri-online-judge/1158/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Soma de Ímpares Consecutivos III 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1158 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int n, 10 | x, y, 11 | soma; 12 | 13 | scanf("%d", &n); 14 | 15 | while (n-- > 0) { 16 | scanf("%d %d\n", &x, &y); 17 | 18 | soma = 0; 19 | 20 | if (x % 2 == 0) { 21 | x++; 22 | } 23 | 24 | while (y-- > 0) { 25 | soma += x; 26 | x += 2; 27 | } 28 | 29 | printf("%d\n", soma); 30 | } 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /uri-online-judge/1609/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Contando Carneirinhos 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1609 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | int T, N; 15 | 16 | cin >> T; 17 | 18 | while (T-- > 0) { 19 | set s; 20 | 21 | cin >> N; 22 | 23 | while (N-- > 0) { 24 | int n; 25 | 26 | cin >> n; 27 | 28 | s.insert(n); 29 | } 30 | 31 | cout << s.size() << '\n'; 32 | } 33 | 34 | return 0; 35 | } 36 | -------------------------------------------------------------------------------- /uri-online-judge/1171/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Frequência de Números 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1171 4 | */ 5 | 6 | #include 7 | 8 | #define SIZE 2001 9 | 10 | // GCC preenche com 0 11 | int numeros[SIZE]; 12 | 13 | int main (void) { 14 | int casos, 15 | i; 16 | 17 | scanf("%d\n", &casos); 18 | 19 | while (casos-- > 0) { 20 | scanf("%d", &i); 21 | numeros[i]++; 22 | } 23 | 24 | for (i = 1; i < SIZE; i++) { 25 | if (numeros[i] > 0) { 26 | printf("%d aparece %d vez(es)\n", i, numeros[i]); 27 | } 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /uri-online-judge/1072/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Intervalo 2 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1072 4 | */ 5 | 6 | #include 7 | 8 | #define MENOR 10 9 | #define MANOR 20 10 | 11 | int main (void) { 12 | int n, 13 | x, 14 | in = 0, 15 | out = 0; 16 | 17 | scanf("%d", &n); 18 | 19 | while (n-- > 0) { 20 | scanf("%d", &x); 21 | 22 | if (x < MENOR || x > MANOR) { 23 | out++; 24 | } 25 | else { 26 | in++; 27 | } 28 | } 29 | 30 | printf("%d in\n", in); 31 | printf("%d out\n", out); 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /uri-online-judge/1383/input.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 1 3 2 5 7 9 4 6 8 3 | 4 9 8 2 6 1 3 7 5 4 | 7 5 6 3 8 4 2 1 9 5 | 6 4 3 1 5 8 7 9 2 6 | 5 2 1 7 9 3 8 4 6 7 | 9 8 7 4 2 6 5 3 1 8 | 2 1 4 9 3 5 6 8 7 9 | 3 6 5 8 1 7 9 2 4 10 | 8 7 9 6 4 2 1 5 3 11 | 12 | 1 3 2 5 7 9 4 6 8 13 | 4 9 8 2 6 1 3 7 5 14 | 7 5 6 3 8 4 2 1 9 15 | 6 4 3 1 5 8 7 9 2 16 | 5 2 1 7 9 3 8 4 6 17 | 9 8 7 4 2 6 5 3 1 18 | 2 1 4 9 3 5 6 8 7 19 | 3 6 5 8 1 7 9 2 4 20 | 8 7 9 6 4 2 1 3 5 21 | 22 | 1 3 2 5 7 9 4 6 8 23 | 4 9 8 2 6 1 3 7 5 24 | 7 5 6 3 8 4 2 1 9 25 | 6 4 3 1 5 8 7 9 2 26 | 5 2 1 7 9 3 8 4 6 27 | 9 8 7 4 2 5 6 3 1 28 | 2 1 4 9 3 6 5 8 7 29 | 3 6 5 8 1 7 9 2 4 30 | 8 7 9 6 4 2 1 5 3 31 | -------------------------------------------------------------------------------- /uri-online-judge/1984/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | O Enigma do Pronalândia 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1984 4 | */ 5 | 6 | #include 7 | 8 | void imprimirInverso(const char *str); 9 | 10 | #define STRING_SIZE 32 11 | 12 | int main (void) { 13 | char numero[STRING_SIZE]; 14 | 15 | scanf("%s", numero); 16 | 17 | imprimirInverso(numero); 18 | printf("\n"); 19 | 20 | return 0; 21 | } 22 | 23 | void imprimirInverso(const char *str) { 24 | if (str[0] == '\0') { 25 | return; 26 | } 27 | else { 28 | imprimirInverso(str + 1); 29 | printf("%c", str[0]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /uri-online-judge/2006/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Identificando o Chá 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2006 4 | */ 5 | 6 | #include 7 | 8 | #define QUANTIDADE_DE_CHAS 5 9 | 10 | int main (void) { 11 | int chaDeExemplo, 12 | cha, 13 | quantidadeQueSeRepete = 0, 14 | i; 15 | 16 | scanf("%d", &chaDeExemplo); 17 | 18 | for (i = 0; i < QUANTIDADE_DE_CHAS; i++) { 19 | scanf("%d", &cha); 20 | 21 | if (cha == chaDeExemplo) { 22 | quantidadeQueSeRepete++; 23 | } 24 | } 25 | 26 | printf("%d\n", quantidadeQueSeRepete); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/1089/input.txt: -------------------------------------------------------------------------------- 1 | 10 2 | -4990 8195 8163 5116 2367 1668 94 -468 -3934 -4363 3 | 2 4 | -10000 -9999 5 | 2 6 | 9999 10000 7 | 2 8 | -10000 10000 9 | 5 10 | -10000 -4821 227 -1900 5679 11 | 12 | 10 13 | -3797 -1317 -557 3680 4597 6205 7977 8044 9656 -7986 14 | 16 15 | -9978 -9720 -5122 -4790 -2024 -460 -128 974 3363 4394 6101 6497 7307 7352 8261 9333 16 | 13 17 | -8392 -7819 -6179 -5228 -3599 -1041 159 1025 1350 6064 7410 8657 9351 18 | 17 19 | 9277 6290 3133 2256 2064 1926 1752 1513 949 806 -469 -1100 -2302 -4194 -6212 -6266 -8204 20 | 18 21 | 9926 8996 8468 8462 7964 7901 7536 6990 6850 6233 4106 3205 1796 1594 812 -989 -2174 -4488 22 | 0 23 | -------------------------------------------------------------------------------- /uri-online-judge/2670/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | int main(void) { 6 | int X, Y, Z, 7 | A, B, C, 8 | S; 9 | 10 | cin >> X >> Y >> Z; 11 | // scanf("%d %d %d", &X, &Y, &Z); 12 | 13 | A = 0 * X + 2 * Y + 4 * Z; 14 | B = 2 * X + 0 * Y + 2 * Z; 15 | C = 4 * X + 2 * Y + 0 * Z; 16 | S = min(min(A, B), C); 17 | // No C++, a função min já vem definida em 18 | // #define MIN(X, Y) ((X) < (Y) ? (X) : (Y)) 19 | 20 | cout << S << endl; 21 | // printf("%d\n", S); 22 | 23 | return EXIT_SUCCESS; 24 | // return 0; 25 | // Ok, ai já é demais... 26 | } 27 | -------------------------------------------------------------------------------- /uri-online-judge/1018/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Cédulas 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1018 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int valor; 10 | int notas[] = { 100, 50, 20, 10, 5, 2, 1, 0}; 11 | int notaIndex = 0; 12 | 13 | int quantidadeNotas; 14 | 15 | scanf("%d", &valor); 16 | 17 | printf("%d\n", valor); 18 | 19 | while (notas[notaIndex] != 0) { 20 | quantidadeNotas = valor / notas[notaIndex]; 21 | printf("%d nota(s) de R$ %d,00\n", quantidadeNotas, notas[notaIndex]); 22 | valor = valor % notas[notaIndex]; 23 | 24 | notaIndex++; 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /uri-online-judge/1858/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | A Resposta de Theon 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1858 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int quantidadeDePessoas, 10 | i, 11 | pessoa, 12 | pessoaAtual = 50, 13 | indiceAtual; 14 | 15 | scanf("%d", &quantidadeDePessoas); 16 | 17 | for (i = 1; i <= quantidadeDePessoas; i++) { 18 | scanf("%d", &pessoa); 19 | 20 | if (pessoa < pessoaAtual) { 21 | pessoaAtual = pessoa; 22 | indiceAtual = i; 23 | } 24 | } 25 | 26 | printf("%d\n", indiceAtual); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/1117/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Validação de Nota 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1117 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double nota, 10 | soma = 0.0; 11 | 12 | int quantidadeDeNotasValidas = 0; 13 | 14 | while (quantidadeDeNotasValidas < 2) { 15 | scanf("%lf\n", ¬a); 16 | 17 | if (nota < 0 || nota > 10) { 18 | printf("nota invalida\n"); 19 | } 20 | else { 21 | soma += nota; 22 | quantidadeDeNotasValidas++; 23 | } 24 | } 25 | 26 | printf("media = %.2f\n", soma / 2); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/1132/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Múltiplos de 13 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1132 4 | */ 5 | 6 | #include 7 | 8 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) 9 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) 10 | 11 | int main (void) { 12 | int a, 13 | b, 14 | min, 15 | max, 16 | i, 17 | soma = 0; 18 | 19 | scanf("%d %d", &a, &b); 20 | 21 | min = MIN(a, b); 22 | max = MAX(a, b) + 1; 23 | 24 | for (i = min; i < max; i++) { 25 | if (i % 13 != 0) { 26 | soma += i; 27 | } 28 | } 29 | 30 | printf("%d\n", soma); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /uri-online-judge/1199/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Conversão Simples de Base 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1199 4 | */ 5 | 6 | #include 7 | 8 | #define STR_SIZE 64 9 | 10 | int main (void) { 11 | char numero[STR_SIZE]; 12 | int valor; 13 | 14 | while (scanf("%s\n", numero), numero[0] != '-') { 15 | if (numero[0] == '0' && numero[1] == 'x') { 16 | sscanf(numero, "%x", &valor); 17 | printf("%d\n", valor); 18 | } 19 | else { 20 | sscanf(numero, "%d", &valor); 21 | printf("0x%X\n", valor); 22 | } 23 | 24 | 25 | } 26 | 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/b-maratonime-plays-cirokime/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | II USP Freshmen Contest (http://codeforces.com/gym/100985) 3 | B. MaratonIME plays Cîrokime (http://codeforces.com/gym/100985/problem/B) 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | size_t ulog(size_t n); 11 | 12 | int main(void) { 13 | ios::sync_with_stdio(false); 14 | 15 | size_t N; 16 | 17 | cin >> N; 18 | 19 | cout << ulog(N) << endl; 20 | 21 | return EXIT_SUCCESS; 22 | } 23 | 24 | 25 | size_t ulog(size_t n) { 26 | size_t q = 1; 27 | 28 | while (n > 1) { 29 | q++; 30 | n /= 2; 31 | } 32 | 33 | return q; 34 | } -------------------------------------------------------------------------------- /uri-online-judge/1151/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Fibonacci Fácil 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1151 4 | */ 5 | 6 | #include 7 | 8 | int nthFib(int n); 9 | 10 | int main (void) { 11 | int nth; 12 | 13 | scanf("%d", &nth); 14 | 15 | nthFib(nth); 16 | 17 | return 0; 18 | } 19 | 20 | int nthFib(int n) { 21 | long unsigned int values[50] = { 0, 1 }; 22 | int i; 23 | 24 | for (i = 2; i < n; i++) { 25 | values[i] = values[i - 1] + values[i - 2]; 26 | } 27 | 28 | for (i = 0; i < n; i++) { 29 | printf("%lu%c", values[i], i + 1 == n ? '\n' : ' '); 30 | } 31 | 32 | return values[n - 1]; 33 | } 34 | -------------------------------------------------------------------------------- /uri-online-judge/1241/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Encaixa ou Não II 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1241 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #define STRING_SIZE 1024 10 | 11 | int main (void) { 12 | int casos; 13 | 14 | char a[STRING_SIZE], 15 | b[STRING_SIZE]; 16 | 17 | scanf("%d\n", &casos); 18 | 19 | while (casos-- > 0) { 20 | scanf("%s %s\n", a, b); 21 | 22 | if (strcmp(a + strlen(a) - strlen(b), b) == 0) { 23 | printf("encaixa\n"); 24 | } 25 | else { 26 | printf("nao encaixa\n"); 27 | } 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /uri-online-judge/2161/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Raiz Quadrada de 10 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2161 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | double sqrt10(int n); 12 | double div1by6(int n); 13 | 14 | int main(void) { 15 | ios::sync_with_stdio(false); 16 | 17 | int N; 18 | 19 | cin >> N; 20 | 21 | cout << fixed << setprecision(10) << sqrt10(N) << endl; 22 | 23 | return 0; 24 | } 25 | 26 | double sqrt10(int n) { 27 | return 3.0 + div1by6(n); 28 | } 29 | 30 | double div1by6(int n) { 31 | if (n == 0) return 0.0; 32 | else return 1.0 / (6 + div1by6(n - 1)); 33 | } 34 | -------------------------------------------------------------------------------- /uri-online-judge/2176/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Paridade 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2176 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | string bits; 15 | 16 | getline(cin, bits); 17 | 18 | bool par = true; 19 | 20 | for (auto it = bits.begin(); it != bits.end(); ++it) { 21 | if (*it == '1') par = !par; 22 | } 23 | 24 | cout << bits; 25 | 26 | if (par) { 27 | cout << '0'; 28 | } 29 | else { 30 | cout << '1'; 31 | } 32 | 33 | cout << endl; 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /uri-online-judge/1037/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Intervalo 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1037 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double v; 10 | 11 | scanf("%lf", &v); 12 | 13 | if (v < 0) { 14 | printf("Fora de intervalo\n"); 15 | } 16 | else if (v <= 25) { 17 | printf("Intervalo [0,25]\n"); 18 | } 19 | else if (v <= 50) { 20 | printf("Intervalo (25,50]\n"); 21 | } 22 | else if (v <= 75) { 23 | printf("Intervalo (50,75]\n"); 24 | } 25 | else if (v <= 100) { 26 | printf("Intervalo (75,100]\n"); 27 | } 28 | else { 29 | printf("Fora de intervalo\n"); 30 | } 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /uri-online-judge/1133/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Resto da Divisão 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1133 4 | */ 5 | 6 | #include 7 | 8 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) 9 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) 10 | 11 | int main (void) { 12 | int a, 13 | b, 14 | min, 15 | max, 16 | resto, 17 | i; 18 | 19 | scanf("%d %d", &a, &b); 20 | 21 | min = MIN(a, b) + 1; 22 | max = MAX(a, b); 23 | 24 | for (i = min; i < max; i++) { 25 | resto = i % 5; 26 | if (resto == 2 || resto == 3) { 27 | printf("%d\n", i); 28 | } 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /uri-online-judge/1216/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Getline One 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1216 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | double distancia, 10 | distanciaTotal = 0; 11 | 12 | int caractere, 13 | quantidade = 0; 14 | 15 | while (caractere = getc(stdin), caractere != EOF) { 16 | while (caractere != '\n') { 17 | caractere = getc(stdin); 18 | } 19 | 20 | scanf("%lf\n", &distancia); 21 | 22 | distanciaTotal += distancia; 23 | quantidade++; 24 | } 25 | 26 | printf("%.1f\n", distanciaTotal / quantidade); 27 | 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /hacker-rank/compare-the-triplets/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Compare the Triplets 3 | https://www.hackerrank.com/challenges/compare-the-triplets/problem 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | vector A(3), B(3); 14 | int a = 0, 15 | b = 0; 16 | 17 | for (size_t i = 0; i < 3; i++) cin >> A[i]; 18 | 19 | for (size_t i = 0; i < 3; i++) cin >> B[i]; 20 | 21 | for (size_t i = 0; i < 3; i++) { 22 | if (A[i] > B[i]) a++; 23 | else if (B[i] > A[i]) b++; 24 | } 25 | 26 | cout << a << " " << b << endl; 27 | 28 | return EXIT_SUCCESS; 29 | } 30 | -------------------------------------------------------------------------------- /codeforces/ii-usp-freshmen-contest/g-maratonime-goes-rowing/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | II USP Freshmen Contest (http://codeforces.com/gym/100985) 3 | G. MaratonIME goes rowing (http://codeforces.com/gym/100985/problem/G) 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | string S; 14 | 15 | getline(cin, S); 16 | 17 | int p = 0; 18 | for (auto c : S) { 19 | if (c == 'A') p++; 20 | else p--; 21 | 22 | if (p < 0) break; 23 | } 24 | 25 | if (p == 0) cout << "Sim" << endl; 26 | else cout << "Nao" << endl; 27 | 28 | return EXIT_SUCCESS; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/1323/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Feynman 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1323 4 | */ 5 | 6 | #include 7 | 8 | #define SIZE 100 9 | 10 | void preencherCache(int *cache, int size); 11 | 12 | int main (void) { 13 | int quadrados, 14 | cache[SIZE + 1]; 15 | 16 | preencherCache(cache, SIZE); 17 | 18 | while (scanf("%d", &quadrados), quadrados > 0) { 19 | printf("%d\n", cache[quadrados]); 20 | } 21 | 22 | return 0; 23 | } 24 | 25 | void preencherCache(int *cache, int size) { 26 | int i; 27 | 28 | cache[1] = 1; 29 | for (i = 2; i <= size; i++) { 30 | cache[i] = i * i + cache[i - 1]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /uri-online-judge/2003/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Domingo de Manhã 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2003 4 | */ 5 | 6 | #include 7 | 8 | void imprimirAtrasoMaximo(int hora, int minuto); 9 | 10 | int main (void) { 11 | int hora, 12 | minuto; 13 | 14 | while (scanf("%d:%d\n", &hora, &minuto) != EOF) { 15 | imprimirAtrasoMaximo(hora, minuto); 16 | } 17 | 18 | return 0; 19 | } 20 | 21 | void imprimirAtrasoMaximo(int hora, int minuto) { 22 | hora += 1; 23 | 24 | if (hora >= 8) { 25 | printf("Atraso maximo: %d\n", (hora - 8) * 60 + minuto); 26 | } 27 | else { 28 | printf("Atraso maximo: 0\n"); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /hacker-rank/angry-children/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Max Min 3 | https://www.hackerrank.com/challenges/angry-children/problem 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N, K; 14 | int response = INT_MAX; 15 | 16 | cin >> N >> K; 17 | 18 | vector numbers(N); 19 | 20 | for (int i = 0; i < N; i++) cin >> numbers[i]; 21 | 22 | sort(numbers.begin(), numbers.end()); 23 | 24 | for (int i = 0; i + K - 1 < N; i++) { 25 | response = min(response, numbers[i + K - 1] - numbers[i]); 26 | } 27 | 28 | cout << response << endl; 29 | 30 | return EXIT_SUCCESS; 31 | } 32 | -------------------------------------------------------------------------------- /uri-online-judge/1080/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Maior e Posição 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1080 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int i, 10 | n, 11 | maiorNumero, 12 | indiceDoMaiorNumero; 13 | 14 | for (i = 1; i < 101; i++) { 15 | scanf("%d", &n); 16 | 17 | if (i == 1) { 18 | maiorNumero = n; 19 | indiceDoMaiorNumero = i; 20 | } 21 | else if (n > maiorNumero) { 22 | maiorNumero = n; 23 | indiceDoMaiorNumero = i; 24 | } 25 | } 26 | 27 | printf("%d\n%d\n", maiorNumero, indiceDoMaiorNumero); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /uri-online-judge/1893/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Fases da Lua 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1893 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | int A, B; 15 | 16 | cin >> A >> B; 17 | 18 | if (B < 3) { 19 | cout << "nova"; 20 | } 21 | else if (B < 97) { 22 | if (A < B) { 23 | cout << "crescente"; 24 | } 25 | else { 26 | cout << "minguante"; 27 | } 28 | } 29 | else { 30 | cout << "cheia"; 31 | } 32 | 33 | cout << endl; 34 | 35 | return EXIT_SUCCESS; 36 | } 37 | -------------------------------------------------------------------------------- /uri-online-judge/1198/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | O Bravo Guerreiro Hashmat 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1198 4 | */ 5 | 6 | #include 7 | 8 | unsigned long long int diferenca(unsigned long long int a, unsigned long long int b); 9 | 10 | int main (void) { 11 | // Min 64 bits 12 | unsigned long long int a, b; 13 | 14 | while (scanf("%llu %llu\n", &a, &b) != EOF) { 15 | printf("%llu\n", diferenca(a, b)); 16 | } 17 | 18 | return 0; 19 | } 20 | 21 | unsigned long long int diferenca(unsigned long long int a, unsigned long long int b) { 22 | if (a > b) { 23 | return a - b; 24 | } 25 | else { 26 | return b - a; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /uri-online-judge/1071/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Soma de Impares Consecutivos I 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1071 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int inicio, 10 | fim, 11 | inc, 12 | i, 13 | soma = 0; 14 | 15 | scanf("%d %d", &inicio, &fim); 16 | 17 | if (inicio == fim) { 18 | printf("0\n"); 19 | } 20 | else { 21 | inc = fim > inicio ? 1 : -1; 22 | 23 | for (i = inicio + inc; i != fim; i += inc) { 24 | if (i % 2 != 0) { 25 | soma += i; 26 | } 27 | } 28 | 29 | printf("%d\n", soma); 30 | } 31 | 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /leetcode/problems/delete-node-in-a-linked-list/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 237. Delete Node in a Linked List 3 | https://leetcode.com/problems/delete-node-in-a-linked-list 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | struct ListNode { 11 | int val; 12 | ListNode *next; 13 | ListNode(int x) : val(x), next(NULL) {} 14 | }; 15 | 16 | class Solution { 17 | public: 18 | void deleteNode(ListNode* node) { 19 | // cout << node->val << " -> " << node->next->val << endl; 20 | node->val = node->next->val; 21 | node->next = node->next->next; 22 | } 23 | }; 24 | 25 | int main(void) { 26 | ios::sync_with_stdio(false); 27 | 28 | return EXIT_SUCCESS; 29 | } 30 | -------------------------------------------------------------------------------- /uri-online-judge/1305/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Arredondamento por Valor de Corte 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1305 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | double number, cutoff; 15 | 16 | while (cin >> number >> cutoff) { 17 | double dNumber = number - int(number); 18 | double dCutoff = cutoff - int(cutoff); 19 | 20 | if (dNumber > dCutoff) { 21 | cout << int(number) + 1 << '\n'; 22 | } 23 | else { 24 | cout << int(number) << '\n'; 25 | } 26 | } 27 | 28 | return EXIT_SUCCESS; 29 | } -------------------------------------------------------------------------------- /uri-online-judge/1115/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Quadrante 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1115 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int x, y; 10 | 11 | while (scanf("%d %d\n", &x, &y), x != 0 && y != 0) { 12 | if (x < 0) { 13 | if (y < 0) { 14 | printf("terceiro\n"); 15 | } 16 | else { 17 | printf("segundo\n"); 18 | } 19 | } 20 | else { 21 | if (y < 0) { 22 | printf("quarto\n"); 23 | } 24 | else { 25 | printf("primeiro\n"); 26 | } 27 | } 28 | } 29 | 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /uri-online-judge/1618/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Colisão 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1618 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N; 14 | 15 | cin >> N; 16 | 17 | while (N-- > 0) { 18 | int AX, AY, 19 | BX, BY, 20 | CX, CY, 21 | DX, DY, 22 | RX, RY; 23 | 24 | cin >> AX >> AY >> BX >> BY >> CX >> CY >> DX >> DY >> RX >> RY; 25 | 26 | if (RX >= AX && RX <= BX 27 | && RY >= AY && RY <= DY) cout << 1; 28 | else cout << 0; 29 | 30 | cout << '\n'; 31 | } 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /uri-online-judge/1929/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Triângulo 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1929 4 | */ 5 | 6 | #include 7 | 8 | int formaTriangulo(int a, int b, int c); 9 | 10 | int main (void) { 11 | int a, b, c, d; 12 | 13 | scanf("%d %d %d %d", &a, &b, &c, &d); 14 | 15 | if (formaTriangulo(a, b, c) 16 | || formaTriangulo(a, b, d) 17 | || formaTriangulo(a, c, d) 18 | || formaTriangulo(b, c, d)) { 19 | printf("S\n"); 20 | } 21 | else { 22 | printf("N\n"); 23 | } 24 | 25 | return 0; 26 | } 27 | 28 | int formaTriangulo(int a, int b, int c) { 29 | return a + b > c 30 | && b + c > a 31 | && a + c > b; 32 | } 33 | -------------------------------------------------------------------------------- /uri-online-judge/1032/gerarPrimos.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int isPrimo(int n); 5 | 6 | int main (void) { 7 | printf("["); 8 | 9 | int primosCount = 0; 10 | size_t i = 0; 11 | while (primosCount < 3510) { 12 | while (!isPrimo(++i)); 13 | 14 | printf(" %d,", i); 15 | primosCount++; 16 | } 17 | 18 | printf(" ]\n"); 19 | 20 | return 0; 21 | } 22 | 23 | int isPrimo(int n) { 24 | int i; 25 | 26 | if (n < 2) return 0; 27 | if (n == 2) return 1; 28 | if (n % 2 == 0) return 0; 29 | 30 | size_t limit = sqrt(n); 31 | 32 | for (i = 3; i <= limit; i += 2) { 33 | if (n % i == 0) return 0; 34 | } 35 | 36 | return 1; 37 | } -------------------------------------------------------------------------------- /uri-online-judge/1329/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Cara ou Coroa 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1329 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int jogadas, 10 | jogo, 11 | mary, 12 | john; 13 | 14 | while (scanf("%d", &jogadas), jogadas != 0) { 15 | mary = john = 0; 16 | 17 | while (jogadas-- > 0) { 18 | scanf("%d", &jogo); 19 | 20 | if (jogo == 0) { 21 | mary++; 22 | } 23 | else { 24 | john++; 25 | } 26 | } 27 | 28 | printf("Mary won %d times and John won %d times\n", mary, john); 29 | } 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /uri-online-judge/1457/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Oráculo de Alexandria 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1457 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | typedef unsigned long long int uint64; 11 | 12 | uint64 k_fat(int N, int K); 13 | 14 | int main(void) { 15 | int T; 16 | 17 | scanf("%d\n", &T); 18 | 19 | while (T-- > 0) { 20 | int N, K = 0; 21 | char C; 22 | 23 | scanf("%d", &N); 24 | 25 | while (scanf("%c", &C), C == '!') K++; 26 | 27 | printf("%llu\n", k_fat(N, K)); 28 | } 29 | 30 | return 0; 31 | } 32 | 33 | uint64 k_fat(int N, int K) { 34 | if (N < 2) return 1; 35 | else return N * k_fat(N - K, K); 36 | } 37 | -------------------------------------------------------------------------------- /uri-online-judge/1715/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Handebol 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1715 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | using namespace std; 10 | 11 | int main(void) { 12 | ios::sync_with_stdio(false); 13 | 14 | int N, 15 | M, 16 | r = 0; 17 | 18 | cin >> N >> M; 19 | 20 | while (N-- > 0) { 21 | bool golEmTodas = true; 22 | 23 | for (int i = 0; i < M; i++) { 24 | int gols; 25 | 26 | cin >> gols; 27 | 28 | golEmTodas = golEmTodas && gols > 0; 29 | } 30 | 31 | if (golEmTodas) r++; 32 | } 33 | 34 | cout << r << endl; 35 | 36 | return EXIT_SUCCESS; 37 | } 38 | -------------------------------------------------------------------------------- /uri-online-judge/2349/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Farm Robot 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2349 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N, C, S; 14 | int count = 0; 15 | 16 | cin >> N >> C >> S; 17 | 18 | int pos = 1; 19 | 20 | if (pos == S) count++; 21 | 22 | for (int i = 0; i < C; i++) { 23 | int command; 24 | 25 | cin >> command; 26 | 27 | pos += command; 28 | 29 | if (pos > N) pos = 1; 30 | else if (pos < 1) pos = N; 31 | 32 | if (pos == S) count++; 33 | } 34 | 35 | cout << count << endl; 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /hacker-rank/counting-valleys/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Counting Valleys 3 | https://www.hackerrank.com/challenges/counting-valleys 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | int n; 13 | cin >> n >> ws; 14 | 15 | string map; 16 | cin >> map; 17 | 18 | int level = 0, 19 | count = 0; 20 | 21 | for (auto c : map) { 22 | if (c == 'U') { 23 | if (level == -1) { 24 | count++; 25 | } 26 | 27 | level++; 28 | } 29 | else { 30 | level--; 31 | } 32 | } 33 | 34 | cout << count << endl; 35 | 36 | return EXIT_SUCCESS; 37 | } 38 | -------------------------------------------------------------------------------- /uri-online-judge/1029/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Fibonacci, Quantas Chamadas? 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1029 4 | */ 5 | 6 | #include 7 | 8 | int fib(int n); 9 | 10 | int calls = 0; 11 | 12 | int main (void) { 13 | int n, i; 14 | int x, result; 15 | 16 | scanf("%d", &n); 17 | 18 | for (i = 0; i < n; i++) { 19 | scanf("%d", &x); 20 | calls = 0; 21 | result = fib(x); 22 | printf("fib(%d) = %d calls = %d\n", x, calls - 1, result); 23 | } 24 | 25 | return 0; 26 | } 27 | 28 | int fib(int n) { 29 | calls++; 30 | if (n == 0) { 31 | return 0; 32 | } 33 | else if (n == 1) { 34 | return 1; 35 | } 36 | else { 37 | return fib(n - 1) + fib(n - 2); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /uri-online-judge/1101/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Sequência de Números e Soma 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1101 4 | */ 5 | 6 | #include 7 | 8 | #define MIN(a,b) ((a) < (b) ? (a) : (b)) 9 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) 10 | 11 | int main (void) { 12 | int m, 13 | n; 14 | 15 | int min, 16 | max, 17 | soma; 18 | 19 | while (scanf("%d %d\n", &m, &n), m > 0 && n > 0) { 20 | min = MIN(m, n); 21 | max = MAX(m, n) + 1; 22 | 23 | soma = 0; 24 | while (min < max) { 25 | printf("%d ", min); 26 | soma += min++; 27 | } 28 | printf("Sum=%d\n", soma); 29 | } 30 | 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /uri-online-judge/1441/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Sequências de Granizo 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1441 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int go(int n); 11 | 12 | int main(void) { 13 | ios::sync_with_stdio(false); 14 | 15 | int N; 16 | 17 | while (cin >> N, N != 0) { 18 | int resultado = go(N); 19 | 20 | cout << resultado << '\n'; 21 | } 22 | 23 | return 0; 24 | } 25 | 26 | int go(int n) { 27 | int maximum = n; 28 | 29 | while (n != 1) { 30 | if (n % 2 == 0) { 31 | n = n / 2; 32 | } 33 | else { 34 | n = 3 * n + 1; 35 | maximum = max(n, maximum); 36 | } 37 | } 38 | 39 | return maximum; 40 | } 41 | -------------------------------------------------------------------------------- /uri-online-judge/2661/main.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Despojados 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2661 4 | ''' 5 | 6 | def obterPrimosDistintosDaFatoracao(n): 7 | from math import sqrt 8 | 9 | primos = set() 10 | limit = int(sqrt(n)) 11 | 12 | while n % 2 == 0: 13 | n = n / 2 14 | primos.add(2) 15 | 16 | for i in range(3, limit + 1, 2): 17 | while n % i == 0: 18 | n = n / i 19 | primos.add(i) 20 | 21 | if n == 1: 22 | break 23 | 24 | if n > 1: 25 | primos.add(n) 26 | 27 | return primos 28 | 29 | 30 | N = int(input()) 31 | 32 | primos = obterPrimosDistintosDaFatoracao(N) 33 | print(2 ** len(primos) - len(primos) - 1) -------------------------------------------------------------------------------- /uri-online-judge/2061/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | As Abas de Péricles 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/2061 4 | */ 5 | 6 | #include 7 | 8 | #define STRING_SIZE 16 9 | 10 | int main (void) { 11 | int abas, 12 | acoes; 13 | 14 | char acao[STRING_SIZE]; 15 | 16 | scanf("%d %d\n", &abas, &acoes); 17 | 18 | while (acoes-- > 0) { 19 | scanf("%s\n", acao); 20 | 21 | // fechou 22 | if (acao[0] == 'f') { 23 | // Fecha 1; Abre 2 24 | abas++; 25 | } 26 | // clicou 27 | else { 28 | // Fecha 1; Abre 0 29 | abas--; 30 | } 31 | } 32 | 33 | printf("%d\n", abas); 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /hacker-rank/mark-and-toys/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Mark and Toys 3 | https://www.hackerrank.com/challenges/mark-and-toys 4 | */ 5 | 6 | #include 7 | 8 | using namespace std; 9 | 10 | int main(void) { 11 | ios::sync_with_stdio(false); 12 | 13 | int N, K; 14 | 15 | cin >> N >> K; 16 | 17 | vector PRICES(N); 18 | 19 | for (int i = 0; i < N; i++) { 20 | cin >> PRICES[i]; 21 | }; 22 | 23 | sort(PRICES.begin(), PRICES.end()); 24 | 25 | int toysCount = 0; 26 | 27 | for (int i = 0; i < N; i++) { 28 | if (PRICES[i] > K) break; 29 | 30 | K -= PRICES[i]; 31 | toysCount++; 32 | }; 33 | 34 | cout << toysCount << endl; 35 | 36 | return EXIT_SUCCESS; 37 | } 38 | -------------------------------------------------------------------------------- /uri-online-judge/1164/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | Número Perfeito 3 | https://www.urionlinejudge.com.br/judge/pt/problems/view/1164 4 | */ 5 | 6 | #include 7 | 8 | int main (void) { 9 | int casos, 10 | n, 11 | i, 12 | soma; 13 | 14 | scanf("%d", &casos); 15 | 16 | while (casos-- > 0) { 17 | scanf("%d", &n); 18 | 19 | soma = 0; 20 | 21 | for (i = 1; i < n; i++) { 22 | if (n % i == 0) { 23 | soma += i; 24 | } 25 | } 26 | 27 | if (n == soma) { 28 | printf("%d eh perfeito\n", n); 29 | } 30 | else { 31 | printf("%d nao eh perfeito\n", n); 32 | } 33 | } 34 | 35 | return 0; 36 | } 37 | --------------------------------------------------------------------------------