diff --git a/.autocp b/.autocp index 15f909f..4c19402 100644 --- a/.autocp +++ b/.autocp @@ -1 +1 @@ -{"version":1,"problems":{"CSES - CSES Problem Set":{"Weird Algorithm":{"name":"Weird Algorithm","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1068/","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n","output":"3 10 5 16 8 4 2 1\n"}],"memoryLimit":512,"timeLimit":1000},"Missing Number":{"name":"Missing Number","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1083","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n2 3 1 5\n","output":"4\n"}],"memoryLimit":512,"timeLimit":1000},"Repetitions":{"name":"Repetitions","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1069","sampleTestcases":[{"name":"Sample Testcase #1","input":"ATTCGGGA\n","output":"3\n"}],"memoryLimit":512,"timeLimit":1000},"Increasing Array":{"name":"Increasing Array","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1094","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n3 2 5 1 7\n","output":"5\n"}],"memoryLimit":512,"timeLimit":1000},"Permutations":{"name":"Permutations","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1070","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n","output":"4 2 5 3 1\n"},{"name":"Sample Testcase #2","input":"3\n","output":"NO SOLUTION\n"}],"memoryLimit":512,"timeLimit":1000},"Number Spiral":{"name":"Number Spiral","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1071","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n2 3\n1 1\n4 2\n","output":"8\n1\n15\n"}],"memoryLimit":512,"timeLimit":1000},"Two Knights":{"name":"Two Knights","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1072","sampleTestcases":[{"name":"Sample Testcase #1","input":"8\n","output":"0\n6\n28\n96\n252\n550\n1056\n1848\n"}],"memoryLimit":512,"timeLimit":1000},"Two Sets":{"name":"Two Sets","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1092","sampleTestcases":[{"name":"Sample Testcase #1","input":"7\n","output":"YES\n4\n1 2 4 7\n3\n3 5 6\n"},{"name":"Sample Testcase #2","input":"6\n","output":"NO\n"}],"memoryLimit":512,"timeLimit":1000},"Bit Strings":{"name":"Bit Strings","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1617","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n","output":"8\n"}],"memoryLimit":512,"timeLimit":1000},"Trailing Zeros":{"name":"Trailing Zeros","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1618","sampleTestcases":[{"name":"Sample Testcase #1","input":"20\n","output":"4\n"}],"memoryLimit":512,"timeLimit":1000},"Coin Piles":{"name":"Coin Piles","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1754","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n2 1\n2 2\n3 3\n","output":"YES\nNO\nYES\n"}],"memoryLimit":512,"timeLimit":1000},"Palindrome Reorder":{"name":"Palindrome Reorder","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1755","sampleTestcases":[{"name":"Sample Testcase #1","input":"AAAACACBA\n","output":"AACABACAA\n"}],"memoryLimit":512,"timeLimit":1000},"Gray Code":{"name":"Gray Code","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/2205","sampleTestcases":[{"name":"Sample Testcase #1","input":"2\n","output":"00\n01\n11\n10\n"}],"memoryLimit":512,"timeLimit":1000},"Tower of Hanoi":{"name":"Tower of Hanoi","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/2165","sampleTestcases":[{"name":"Sample Testcase #1","input":"2\n","output":"3\n1 2\n1 3\n2 3\n"}],"memoryLimit":512,"timeLimit":1000},"Creating Strings":{"name":"Creating Strings","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1622","sampleTestcases":[{"name":"Sample Testcase #1","input":"aabac\n","output":"20\naaabc\naaacb\naabac\naabca\naacab\naacba\nabaac\nabaca\nabcaa\nacaab\nacaba\nacbaa\nbaaac\nbaaca\nbacaa\nbcaaa\ncaaab\ncaaba\ncabaa\ncbaaa\n"}],"memoryLimit":512,"timeLimit":1000},"Apple Division":{"name":"Apple Division","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1623","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n3 2 7 4 1\n","output":"1\n"}],"memoryLimit":512,"timeLimit":1000},"Chessboard and Queens":{"name":"Chessboard and Queens","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1624","sampleTestcases":[{"name":"Sample Testcase #1","input":"........\n........\n..*.....\n........\n........\n.....**.\n...*....\n........\n","output":"65\n"}],"memoryLimit":512,"timeLimit":1000},"Digit Queries":{"name":"Digit Queries","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/2431","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n7\n19\n12\n","output":"7\n4\n1\n"}],"memoryLimit":512,"timeLimit":1000},"Grid Paths":{"name":"Grid Paths","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1625","sampleTestcases":[{"name":"Sample Testcase #1","input":"??????R??????U??????????????????????????LD????D?\n","output":"201\n"}],"memoryLimit":512,"timeLimit":1000},"Distinct Numbers":{"name":"Distinct Numbers","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1621","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n2 3 2 2 3\n","output":"2\n"}],"memoryLimit":512,"timeLimit":1000},"Apartments":{"name":"Apartments","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1084","sampleTestcases":[{"name":"Sample Testcase #1","input":"4 3 5\n60 45 80 60\n30 60 75\n","output":"2\n"}],"memoryLimit":512,"timeLimit":1000},"Ferris Wheel":{"name":"Ferris Wheel","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1090","sampleTestcases":[{"name":"Sample Testcase #1","input":"4 10\n7 2 3 9\n","output":"3\n"}],"memoryLimit":512,"timeLimit":1000}}},"solutionFiles":{"CSES - CSES Problem Set/Weird_Algorithm.cpp":{"pathString":"CSES - CSES Problem Set/Weird_Algorithm.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Weird Algorithm"},"testcases":[{"name":"Sample Testcase #1","input":"3\n","output":"3 10 5 16 8 4 2 1\n"}]},"CSES - CSES Problem Set/Missing_Number.cpp":{"pathString":"CSES - CSES Problem Set/Missing_Number.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Missing Number"},"testcases":[{"name":"Sample Testcase #1","input":"5\n2 3 1 5\n","output":"4\n"}]},"CSES - CSES Problem Set/Repetitions.cpp":{"pathString":"CSES - CSES Problem Set/Repetitions.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Repetitions"},"testcases":[{"name":"Sample Testcase #1","input":"ATTCGGGA\n","output":"3\n"}]},"CSES - CSES Problem Set/Increasing_Array.cpp":{"pathString":"CSES - CSES Problem Set/Increasing_Array.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Increasing Array"},"testcases":[{"name":"Sample Testcase #1","input":"5\n3 2 5 1 7\n","output":"5\n"}]},"CSES - CSES Problem Set/Permutations.cpp":{"pathString":"CSES - CSES Problem Set/Permutations.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Permutations"},"testcases":[{"name":"Sample Testcase #1","input":"5\n","output":"4 2 5 3 1\n"},{"name":"Sample Testcase #2","input":"3\n","output":"NO SOLUTION\n"}]},"CSES - CSES Problem Set/Number_Spiral.cpp":{"pathString":"CSES - CSES Problem Set/Number_Spiral.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Number Spiral"},"testcases":[{"name":"Sample Testcase #1","input":"3\n2 3\n1 1\n4 2\n","output":"8\n1\n15\n"}]},"CSES - CSES Problem Set/Two_Knights.cpp":{"pathString":"CSES - CSES Problem Set/Two_Knights.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Two Knights"},"testcases":[{"name":"Sample Testcase #1","input":"8\n","output":"0\n6\n28\n96\n252\n550\n1056\n1848\n"}]},"CSES - CSES Problem Set/Two_Sets.cpp":{"pathString":"CSES - CSES Problem Set/Two_Sets.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Two Sets"},"testcases":[{"name":"Sample Testcase #1","input":"7\n","output":"YES\n4\n1 2 4 7\n3\n3 5 6\n"},{"name":"Sample Testcase #2","input":"6\n","output":"NO\n"}]},"CSES - CSES Problem Set/Bit_Strings.cpp":{"pathString":"CSES - CSES Problem Set/Bit_Strings.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Bit Strings"},"testcases":[{"name":"Sample Testcase #1","input":"3\n","output":"8\n"}]},"CSES - CSES Problem Set/Trailing_Zeros.cpp":{"pathString":"CSES - CSES Problem Set/Trailing_Zeros.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Trailing Zeros"},"testcases":[{"name":"Sample Testcase #1","input":"20\n","output":"4\n"}]},"CSES - CSES Problem Set/Coin_Piles.cpp":{"pathString":"CSES - CSES Problem Set/Coin_Piles.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Coin Piles"},"testcases":[{"name":"Sample Testcase #1","input":"3\n2 1\n2 2\n3 3\n","output":"YES\nNO\nYES\n"}]},"CSES - CSES Problem Set/Palindrome_Reorder.cpp":{"pathString":"CSES - CSES Problem Set/Palindrome_Reorder.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Palindrome Reorder"},"testcases":[{"name":"Sample Testcase #1","input":"AAAACACBA\n","output":"AACABACAA\n"}]},"CSES - CSES Problem Set/Gray_Code.cpp":{"pathString":"CSES - CSES Problem Set/Gray_Code.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Gray Code"},"testcases":[{"name":"Sample Testcase #1","input":"2\n","output":"00\n01\n11\n10\n"}]},"CSES - CSES Problem Set/Tower_of_Hanoi.cpp":{"pathString":"CSES - CSES Problem Set/Tower_of_Hanoi.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Tower of Hanoi"},"testcases":[{"name":"Sample Testcase #1","input":"2\n","output":"3\n1 2\n1 3\n2 3\n"}]},"CSES - CSES Problem Set/Creating_Strings.cpp":{"pathString":"CSES - CSES Problem Set/Creating_Strings.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Creating Strings"},"testcases":[{"name":"Sample Testcase #1","input":"aabac\n","output":"20\naaabc\naaacb\naabac\naabca\naacab\naacba\nabaac\nabaca\nabcaa\nacaab\nacaba\nacbaa\nbaaac\nbaaca\nbacaa\nbcaaa\ncaaab\ncaaba\ncabaa\ncbaaa\n"}]},"CSES - CSES Problem Set/Apple_Division.cpp":{"pathString":"CSES - CSES Problem Set/Apple_Division.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Apple Division"},"testcases":[{"name":"Sample Testcase #1","input":"5\n3 2 7 4 1\n","output":"1\n"}]},"CSES - CSES Problem Set/Chessboard_and_Queens.cpp":{"pathString":"CSES - CSES Problem Set/Chessboard_and_Queens.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Chessboard and Queens"},"testcases":[{"name":"Sample Testcase #1","input":"........\n........\n..*.....\n........\n........\n.....**.\n...*....\n........\n","output":"65\n"}]},"CSES - CSES Problem Set/Digit_Queries.cpp":{"pathString":"CSES - CSES Problem Set/Digit_Queries.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Digit Queries"},"testcases":[{"name":"Sample Testcase #1","input":"3\n7\n19\n12\n","output":"7\n4\n1\n"}]},"CSES - CSES Problem Set/Grid_Paths.cpp":{"pathString":"CSES - CSES Problem Set/Grid_Paths.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Grid Paths"},"testcases":[{"name":"Sample Testcase #1","input":"??????R??????U??????????????????????????LD????D?\n","output":"201\n"}]},"CSES - CSES Problem Set/Distinct_Numbers.cpp":{"pathString":"CSES - CSES Problem Set/Distinct_Numbers.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Distinct Numbers"},"testcases":[{"name":"Sample Testcase #1","input":"5\n2 3 2 2 3\n","output":"2\n"}]},"CSES - CSES Problem Set/Apartments.cpp":{"pathString":"CSES - CSES Problem Set/Apartments.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Apartments"},"testcases":[{"name":"Sample Testcase #1","input":"4 3 5\n60 45 80 60\n30 60 75\n","output":"2\n"}]},"CSES - CSES Problem Set/Ferris_Wheel.cpp":{"pathString":"CSES - CSES Problem Set/Ferris_Wheel.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Ferris Wheel"},"testcases":[{"name":"Sample Testcase #1","input":"4 10\n7 2 3 9\n","output":"3\n"}]}}} \ No newline at end of file +{"version":1,"problems":{"CSES - CSES Problem Set":{"Weird Algorithm":{"name":"Weird Algorithm","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1068/","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n","output":"3 10 5 16 8 4 2 1\n"}],"memoryLimit":512,"timeLimit":1000},"Missing Number":{"name":"Missing Number","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1083","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n2 3 1 5\n","output":"4\n"}],"memoryLimit":512,"timeLimit":1000},"Repetitions":{"name":"Repetitions","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1069","sampleTestcases":[{"name":"Sample Testcase #1","input":"ATTCGGGA\n","output":"3\n"}],"memoryLimit":512,"timeLimit":1000},"Increasing Array":{"name":"Increasing Array","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1094","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n3 2 5 1 7\n","output":"5\n"}],"memoryLimit":512,"timeLimit":1000},"Permutations":{"name":"Permutations","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1070","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n","output":"4 2 5 3 1\n"},{"name":"Sample Testcase #2","input":"3\n","output":"NO SOLUTION\n"}],"memoryLimit":512,"timeLimit":1000},"Number Spiral":{"name":"Number Spiral","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1071","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n2 3\n1 1\n4 2\n","output":"8\n1\n15\n"}],"memoryLimit":512,"timeLimit":1000},"Two Knights":{"name":"Two Knights","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1072","sampleTestcases":[{"name":"Sample Testcase #1","input":"8\n","output":"0\n6\n28\n96\n252\n550\n1056\n1848\n"}],"memoryLimit":512,"timeLimit":1000},"Two Sets":{"name":"Two Sets","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1092","sampleTestcases":[{"name":"Sample Testcase #1","input":"7\n","output":"YES\n4\n1 2 4 7\n3\n3 5 6\n"},{"name":"Sample Testcase #2","input":"6\n","output":"NO\n"}],"memoryLimit":512,"timeLimit":1000},"Bit Strings":{"name":"Bit Strings","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1617","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n","output":"8\n"}],"memoryLimit":512,"timeLimit":1000},"Trailing Zeros":{"name":"Trailing Zeros","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1618","sampleTestcases":[{"name":"Sample Testcase #1","input":"20\n","output":"4\n"}],"memoryLimit":512,"timeLimit":1000},"Coin Piles":{"name":"Coin Piles","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1754","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n2 1\n2 2\n3 3\n","output":"YES\nNO\nYES\n"}],"memoryLimit":512,"timeLimit":1000},"Palindrome Reorder":{"name":"Palindrome Reorder","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1755","sampleTestcases":[{"name":"Sample Testcase #1","input":"AAAACACBA\n","output":"AACABACAA\n"}],"memoryLimit":512,"timeLimit":1000},"Gray Code":{"name":"Gray Code","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/2205","sampleTestcases":[{"name":"Sample Testcase #1","input":"2\n","output":"00\n01\n11\n10\n"}],"memoryLimit":512,"timeLimit":1000},"Tower of Hanoi":{"name":"Tower of Hanoi","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/2165","sampleTestcases":[{"name":"Sample Testcase #1","input":"2\n","output":"3\n1 2\n1 3\n2 3\n"}],"memoryLimit":512,"timeLimit":1000},"Creating Strings":{"name":"Creating Strings","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1622","sampleTestcases":[{"name":"Sample Testcase #1","input":"aabac\n","output":"20\naaabc\naaacb\naabac\naabca\naacab\naacba\nabaac\nabaca\nabcaa\nacaab\nacaba\nacbaa\nbaaac\nbaaca\nbacaa\nbcaaa\ncaaab\ncaaba\ncabaa\ncbaaa\n"}],"memoryLimit":512,"timeLimit":1000},"Apple Division":{"name":"Apple Division","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1623","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n3 2 7 4 1\n","output":"1\n"}],"memoryLimit":512,"timeLimit":1000},"Chessboard and Queens":{"name":"Chessboard and Queens","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1624","sampleTestcases":[{"name":"Sample Testcase #1","input":"........\n........\n..*.....\n........\n........\n.....**.\n...*....\n........\n","output":"65\n"}],"memoryLimit":512,"timeLimit":1000},"Digit Queries":{"name":"Digit Queries","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/2431","sampleTestcases":[{"name":"Sample Testcase #1","input":"3\n7\n19\n12\n","output":"7\n4\n1\n"}],"memoryLimit":512,"timeLimit":1000},"Grid Paths":{"name":"Grid Paths","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1625","sampleTestcases":[{"name":"Sample Testcase #1","input":"??????R??????U??????????????????????????LD????D?\n","output":"201\n"}],"memoryLimit":512,"timeLimit":1000},"Distinct Numbers":{"name":"Distinct Numbers","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1621","sampleTestcases":[{"name":"Sample Testcase #1","input":"5\n2 3 2 2 3\n","output":"2\n"}],"memoryLimit":512,"timeLimit":1000},"Apartments":{"name":"Apartments","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1084","sampleTestcases":[{"name":"Sample Testcase #1","input":"4 3 5\n60 45 80 60\n30 60 75\n","output":"2\n"}],"memoryLimit":512,"timeLimit":1000},"Ferris Wheel":{"name":"Ferris Wheel","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1090","sampleTestcases":[{"name":"Sample Testcase #1","input":"4 10\n7 2 3 9\n","output":"3\n"}],"memoryLimit":512,"timeLimit":1000},"Concert Tickets":{"name":"Concert Tickets","groupName":"CSES - CSES Problem Set","url":"https://cses.fi/problemset/task/1091","sampleTestcases":[{"name":"Sample Testcase #1","input":"5 3\n5 3 7 8 5\n4 8 3\n","output":"3\n8\n-1\n"}],"memoryLimit":512,"timeLimit":1000}}},"solutionFiles":{"CSES - CSES Problem Set/Weird_Algorithm.cpp":{"pathString":"CSES - CSES Problem Set/Weird_Algorithm.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Weird Algorithm"},"testcases":[{"name":"Sample Testcase #1","input":"3\n","output":"3 10 5 16 8 4 2 1\n"}]},"CSES - CSES Problem Set/Missing_Number.cpp":{"pathString":"CSES - CSES Problem Set/Missing_Number.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Missing Number"},"testcases":[{"name":"Sample Testcase #1","input":"5\n2 3 1 5\n","output":"4\n"}]},"CSES - CSES Problem Set/Repetitions.cpp":{"pathString":"CSES - CSES Problem Set/Repetitions.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Repetitions"},"testcases":[{"name":"Sample Testcase #1","input":"ATTCGGGA\n","output":"3\n"}]},"CSES - CSES Problem Set/Increasing_Array.cpp":{"pathString":"CSES - CSES Problem Set/Increasing_Array.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Increasing Array"},"testcases":[{"name":"Sample Testcase #1","input":"5\n3 2 5 1 7\n","output":"5\n"}]},"CSES - CSES Problem Set/Permutations.cpp":{"pathString":"CSES - CSES Problem Set/Permutations.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Permutations"},"testcases":[{"name":"Sample Testcase #1","input":"5\n","output":"4 2 5 3 1\n"},{"name":"Sample Testcase #2","input":"3\n","output":"NO SOLUTION\n"}]},"CSES - CSES Problem Set/Number_Spiral.cpp":{"pathString":"CSES - CSES Problem Set/Number_Spiral.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Number Spiral"},"testcases":[{"name":"Sample Testcase #1","input":"3\n2 3\n1 1\n4 2\n","output":"8\n1\n15\n"}]},"CSES - CSES Problem Set/Two_Knights.cpp":{"pathString":"CSES - CSES Problem Set/Two_Knights.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Two Knights"},"testcases":[{"name":"Sample Testcase #1","input":"8\n","output":"0\n6\n28\n96\n252\n550\n1056\n1848\n"}]},"CSES - CSES Problem Set/Two_Sets.cpp":{"pathString":"CSES - CSES Problem Set/Two_Sets.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Two Sets"},"testcases":[{"name":"Sample Testcase #1","input":"7\n","output":"YES\n4\n1 2 4 7\n3\n3 5 6\n"},{"name":"Sample Testcase #2","input":"6\n","output":"NO\n"}]},"CSES - CSES Problem Set/Bit_Strings.cpp":{"pathString":"CSES - CSES Problem Set/Bit_Strings.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Bit Strings"},"testcases":[{"name":"Sample Testcase #1","input":"3\n","output":"8\n"}]},"CSES - CSES Problem Set/Trailing_Zeros.cpp":{"pathString":"CSES - CSES Problem Set/Trailing_Zeros.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Trailing Zeros"},"testcases":[{"name":"Sample Testcase #1","input":"20\n","output":"4\n"}]},"CSES - CSES Problem Set/Coin_Piles.cpp":{"pathString":"CSES - CSES Problem Set/Coin_Piles.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Coin Piles"},"testcases":[{"name":"Sample Testcase #1","input":"3\n2 1\n2 2\n3 3\n","output":"YES\nNO\nYES\n"}]},"CSES - CSES Problem Set/Palindrome_Reorder.cpp":{"pathString":"CSES - CSES Problem Set/Palindrome_Reorder.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Palindrome Reorder"},"testcases":[{"name":"Sample Testcase #1","input":"AAAACACBA\n","output":"AACABACAA\n"}]},"CSES - CSES Problem Set/Gray_Code.cpp":{"pathString":"CSES - CSES Problem Set/Gray_Code.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Gray Code"},"testcases":[{"name":"Sample Testcase #1","input":"2\n","output":"00\n01\n11\n10\n"}]},"CSES - CSES Problem Set/Tower_of_Hanoi.cpp":{"pathString":"CSES - CSES Problem Set/Tower_of_Hanoi.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Tower of Hanoi"},"testcases":[{"name":"Sample Testcase #1","input":"2\n","output":"3\n1 2\n1 3\n2 3\n"}]},"CSES - CSES Problem Set/Creating_Strings.cpp":{"pathString":"CSES - CSES Problem Set/Creating_Strings.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Creating Strings"},"testcases":[{"name":"Sample Testcase #1","input":"aabac\n","output":"20\naaabc\naaacb\naabac\naabca\naacab\naacba\nabaac\nabaca\nabcaa\nacaab\nacaba\nacbaa\nbaaac\nbaaca\nbacaa\nbcaaa\ncaaab\ncaaba\ncabaa\ncbaaa\n"}]},"CSES - CSES Problem Set/Apple_Division.cpp":{"pathString":"CSES - CSES Problem Set/Apple_Division.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Apple Division"},"testcases":[{"name":"Sample Testcase #1","input":"5\n3 2 7 4 1\n","output":"1\n"}]},"CSES - CSES Problem Set/Chessboard_and_Queens.cpp":{"pathString":"CSES - CSES Problem Set/Chessboard_and_Queens.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Chessboard and Queens"},"testcases":[{"name":"Sample Testcase #1","input":"........\n........\n..*.....\n........\n........\n.....**.\n...*....\n........\n","output":"65\n"}]},"CSES - CSES Problem Set/Digit_Queries.cpp":{"pathString":"CSES - CSES Problem Set/Digit_Queries.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Digit Queries"},"testcases":[{"name":"Sample Testcase #1","input":"3\n7\n19\n12\n","output":"7\n4\n1\n"}]},"CSES - CSES Problem Set/Grid_Paths.cpp":{"pathString":"CSES - CSES Problem Set/Grid_Paths.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Grid Paths"},"testcases":[{"name":"Sample Testcase #1","input":"??????R??????U??????????????????????????LD????D?\n","output":"201\n"}]},"CSES - CSES Problem Set/Distinct_Numbers.cpp":{"pathString":"CSES - CSES Problem Set/Distinct_Numbers.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Distinct Numbers"},"testcases":[{"name":"Sample Testcase #1","input":"5\n2 3 2 2 3\n","output":"2\n"}]},"CSES - CSES Problem Set/Apartments.cpp":{"pathString":"CSES - CSES Problem Set/Apartments.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Apartments"},"testcases":[{"name":"Sample Testcase #1","input":"4 3 5\n60 45 80 60\n30 60 75\n","output":"2\n"}]},"CSES - CSES Problem Set/Ferris_Wheel.cpp":{"pathString":"CSES - CSES Problem Set/Ferris_Wheel.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Ferris Wheel"},"testcases":[{"name":"Sample Testcase #1","input":"4 10\n7 2 3 9\n","output":"3\n"}]},"CSES - CSES Problem Set/Concert_Tickets.cpp":{"pathString":"CSES - CSES Problem Set/Concert_Tickets.cpp","linkedProblemId":{"first":"CSES - CSES Problem Set","second":"Concert Tickets"},"testcases":[{"name":"Sample Testcase #1","input":"5 3\n5 3 7 8 5\n4 8 3\n","output":"3\n8\n-1\n"}]}}} \ No newline at end of file diff --git a/CSES - CSES Problem Set/Concert_Tickets.cpp b/CSES - CSES Problem Set/Concert_Tickets.cpp new file mode 100644 index 0000000..c436643 --- /dev/null +++ b/CSES - CSES Problem Set/Concert_Tickets.cpp @@ -0,0 +1,23 @@ +// Concert Tickets + +#include + +using namespace std; +using ll = long long; + +int main() { + int n, m; cin >> n >> m; + multiset price; + for (int i{}; i < n; i++) {ll a; cin >> a; price.insert(a);} + for (int i{}; i < m; i++) { + ll v; cin >> v; + auto it = price.upper_bound(v); + if (it == price.begin()) { + cout << -1 << endl; + } else { + cout << *(--it) << endl; + price.erase(it); + } + } + return 0; +}