Prompt:
#include<assert.h>
#include<bits/stdc++.h>
// You are given a non-empty vector of positive integers. Return the greatest integer that is greater than
// zero, and has a frequency greater than or equal to the value of the integer itself.
// The frequency of an integer is the number of times it appears in the vector.
// If no such a value exist, return -1.
// Examples:
// >>> search((std::vector<long>({(long)4, (long)1, (long)2, (long)2, (long)3, (long)1})))
// (2)
// >>> search((std::vector<long>({(long)1, (long)2, (long)2, (long)3, (long)3, (long)3, (long)4, (long)4, (long)4})))
// (3)
// >>> search((std::vector<long>({(long)5, (long)5, (long)4, (long)4, (long)4})))
// (-1)
long search(std::vector<long> lst) {

}
int main() {
    auto candidate = search;
    assert(candidate((std::vector<long>({(long)5, (long)5, (long)5, (long)5, (long)1}))) == (1));
    assert(candidate((std::vector<long>({(long)4, (long)1, (long)4, (long)1, (long)4, (long)4}))) == (4));
    assert(candidate((std::vector<long>({(long)3, (long)3}))) == (-1));
    assert(candidate((std::vector<long>({(long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8, (long)8}))) == (8));
    assert(candidate((std::vector<long>({(long)2, (long)3, (long)3, (long)2, (long)2}))) == (2));
    assert(candidate((std::vector<long>({(long)2, (long)7, (long)8, (long)8, (long)4, (long)8, (long)7, (long)3, (long)9, (long)6, (long)5, (long)10, (long)4, (long)3, (long)6, (long)7, (long)1, (long)7, (long)4, (long)10, (long)8, (long)1}))) == (1));
    assert(candidate((std::vector<long>({(long)3, (long)2, (long)8, (long)2}))) == (2));
    assert(candidate((std::vector<long>({(long)6, (long)7, (long)1, (long)8, (long)8, (long)10, (long)5, (long)8, (long)5, (long)3, (long)10}))) == (1));
    assert(candidate((std::vector<long>({(long)8, (long)8, (long)3, (long)6, (long)5, (long)6, (long)4}))) == (-1));
    assert(candidate((std::vector<long>({(long)6, (long)9, (long)6, (long)7, (long)1, (long)4, (long)7, (long)1, (long)8, (long)8, (long)9, (long)8, (long)10, (long)10, (long)8, (long)4, (long)10, (long)4, (long)10, (long)1, (long)2, (long)9, (long)5, (long)7, (long)9}))) == (1));
    assert(candidate((std::vector<long>({(long)1, (long)9, (long)10, (long)1, (long)3}))) == (1));
    assert(candidate((std::vector<long>({(long)6, (long)9, (long)7, (long)5, (long)8, (long)7, (long)5, (long)3, (long)7, (long)5, (long)10, (long)10, (long)3, (long)6, (long)10, (long)2, (long)8, (long)6, (long)5, (long)4, (long)9, (long)5, (long)3, (long)10}))) == (5));
    assert(candidate((std::vector<long>({(long)1}))) == (1));
    assert(candidate((std::vector<long>({(long)8, (long)8, (long)10, (long)6, (long)4, (long)3, (long)5, (long)8, (long)2, (long)4, (long)2, (long)8, (long)4, (long)6, (long)10, (long)4, (long)2, (long)1, (long)10, (long)2, (long)1, (long)1, (long)5}))) == (4));
    assert(candidate((std::vector<long>({(long)2, (long)10, (long)4, (long)8, (long)2, (long)10, (long)5, (long)1, (long)2, (long)9, (long)5, (long)5, (long)6, (long)3, (long)8, (long)6, (long)4, (long)10}))) == (2));
    assert(candidate((std::vector<long>({(long)1, (long)6, (long)10, (long)1, (long)6, (long)9, (long)10, (long)8, (long)6, (long)8, (long)7, (long)3}))) == (1));
    assert(candidate((std::vector<long>({(long)9, (long)2, (long)4, (long)1, (long)5, (long)1, (long)5, (long)2, (long)5, (long)7, (long)7, (long)7, (long)3, (long)10, (long)1, (long)5, (long)4, (long)2, (long)8, (long)4, (long)1, (long)9, (long)10, (long)7, (long)10, (long)2, (long)8, (long)10, (long)9, (long)4}))) == (4));
    assert(candidate((std::vector<long>({(long)2, (long)6, (long)4, (long)2, (long)8, (long)7, (long)5, (long)6, (long)4, (long)10, (long)4, (long)6, (long)3, (long)7, (long)8, (long)8, (long)3, (long)1, (long)4, (long)2, (long)2, (long)10, (long)7}))) == (4));
    assert(candidate((std::vector<long>({(long)9, (long)8, (long)6, (long)10, (long)2, (long)6, (long)10, (long)2, (long)7, (long)8, (long)10, (long)3, (long)8, (long)2, (long)6, (long)2, (long)3, (long)1}))) == (2));
    assert(candidate((std::vector<long>({(long)5, (long)5, (long)3, (long)9, (long)5, (long)6, (long)3, (long)2, (long)8, (long)5, (long)6, (long)10, (long)10, (long)6, (long)8, (long)4, (long)10, (long)7, (long)7, (long)10, (long)8}))) == (-1));
    assert(candidate((std::vector<long>({(long)10}))) == (-1));
    assert(candidate((std::vector<long>({(long)9, (long)7, (long)7, (long)2, (long)4, (long)7, (long)2, (long)10, (long)9, (long)7, (long)5, (long)7, (long)2}))) == (2));
    assert(candidate((std::vector<long>({(long)5, (long)4, (long)10, (long)2, (long)1, (long)1, (long)10, (long)3, (long)6, (long)1, (long)8}))) == (1));
    assert(candidate((std::vector<long>({(long)7, (long)9, (long)9, (long)9, (long)3, (long)4, (long)1, (long)5, (long)9, (long)1, (long)2, (long)1, (long)1, (long)10, (long)7, (long)5, (long)6, (long)7, (long)6, (long)7, (long)7, (long)6}))) == (1));
    assert(candidate((std::vector<long>({(long)3, (long)10, (long)10, (long)9, (long)2}))) == (-1));
}


Prompt:
#include<assert.h>
#include<bits/stdc++.h>
// brackets is a string of "(" and ")".
// return true if every opening bracket has a corresponding closing bracket.
// >>> correct_bracketing(("("))
// (false)
// >>> correct_bracketing(("()"))
// (true)
// >>> correct_bracketing(("(()())"))
// (true)
// >>> correct_bracketing((")(()"))
// (false)
bool correct_bracketing(std::string brackets) {

}
int main() {
    auto candidate = correct_bracketing;
    assert(candidate(("()")) == (true));
    assert(candidate(("(()())")) == (true));
    assert(candidate(("()()(()())()")) == (true));
    assert(candidate(("()()((()()())())(()()(()))")) == (true));
    assert(candidate(("((()())))")) == (false));
    assert(candidate((")(()")) == (false));
    assert(candidate(("(")) == (false));
    assert(candidate(("((((")) == (false));
    assert(candidate((")")) == (false));
    assert(candidate(("(()")) == (false));
    assert(candidate(("()()(()())())(()")) == (false));
    assert(candidate(("()()(()())()))()")) == (false));
}


Prompt:
#include<assert.h>
#include<bits/stdc++.h>
// This function takes a vector l and returns a vector l' such that
// l' is identical to l in the odd indicies, while its values at the even indicies are equal
// to the values of the even indicies of l, but sorted.
// >>> sort_even((std::vector<long>({(long)1, (long)2, (long)3})))
// (std::vector<long>({(long)1, (long)2, (long)3}))
// >>> sort_even((std::vector<long>({(long)5, (long)6, (long)3, (long)4})))
// (std::vector<long>({(long)3, (long)6, (long)5, (long)4}))
std::vector<long> sort_even(std::vector<long> l) {

}
int main() {
    auto candidate = sort_even;
    assert(candidate((std::vector<long>({(long)1, (long)2, (long)3}))) == (std::vector<long>({(long)1, (long)2, (long)3})));
    assert(candidate((std::vector<long>({(long)5, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)9, (long)0, (long)123, (long)1, (long)-10}))) == (std::vector<long>({(long)-10, (long)3, (long)-5, (long)2, (long)-3, (long)3, (long)5, (long)0, (long)9, (long)1, (long)123})));
    assert(candidate((std::vector<long>({(long)5, (long)8, (long)-12, (long)4, (long)23, (long)2, (long)3, (long)11, (long)12, (long)-10}))) == (std::vector<long>({(long)-12, (long)8, (long)3, (long)4, (long)5, (long)2, (long)12, (long)11, (long)23, (long)-10})));
}


Prompt:
#include<assert.h>
#include<bits/stdc++.h>
// Check if two words have the same characters.
// >>> same_chars(("eabcdzzzz"), ("dddzzzzzzzddeddabc"))
// (true)
// >>> same_chars(("abcd"), ("dddddddabc"))
// (true)
// >>> same_chars(("dddddddabc"), ("abcd"))
// (true)
// >>> same_chars(("eabcd"), ("dddddddabc"))
// (false)
// >>> same_chars(("abcd"), ("dddddddabce"))
// (false)
// >>> same_chars(("eabcdzzzz"), ("dddzzzzzzzddddabc"))
// (false)
bool same_chars(std::string s0, std::string s1) {

}
int main() {
    auto candidate = same_chars;
    assert(candidate(("eabcdzzzz"), ("dddzzzzzzzddeddabc")) == (true));
    assert(candidate(("abcd"), ("dddddddabc")) == (true));
    assert(candidate(("dddddddabc"), ("abcd")) == (true));
    assert(candidate(("eabcd"), ("dddddddabc")) == (false));
    assert(candidate(("abcd"), ("dddddddabcf")) == (false));
    assert(candidate(("eabcdzzzz"), ("dddzzzzzzzddddabc")) == (false));
    assert(candidate(("aabb"), ("aaccc")) == (false));
}


Prompt:
#include<assert.h>
#include<bits/stdc++.h>
// brackets is a string of "<" and ">".
// return true if every opening bracket has a corresponding closing bracket.
// >>> correct_bracketing(("<"))
// (false)
// >>> correct_bracketing(("<>"))
// (true)
// >>> correct_bracketing(("<<><>>"))
// (true)
// >>> correct_bracketing(("><<>"))
// (false)
bool correct_bracketing(std::string brackets) {

}
int main() {
    auto candidate = correct_bracketing;
    assert(candidate(("<>")) == (true));
    assert(candidate(("<<><>>")) == (true));
    assert(candidate(("<><><<><>><>")) == (true));
    assert(candidate(("<><><<<><><>><>><<><><<>>>")) == (true));
    assert(candidate(("<<<><>>>>")) == (false));
    assert(candidate(("><<>")) == (false));
    assert(candidate(("<")) == (false));
    assert(candidate(("<<<<")) == (false));
    assert(candidate((">")) == (false));
    assert(candidate(("<<>")) == (false));
    assert(candidate(("<><><<><>><>><<>")) == (false));
    assert(candidate(("<><><<><>><>>><>")) == (false));
}