Datasets:

Modalities:
Text
Languages:
English
ArXiv:
Tags:
code
Libraries:
Datasets
License:
qid
stringlengths
1
3
title
stringlengths
13
51
language
stringclasses
1 value
text
stringlengths
65
1.09k
signature_with_docstring
stringlengths
113
1.24k
signature
stringlengths
17
123
arguments
sequence
source
stringlengths
38
1.51k
question_info
dict
0
TP3/study.Study_1
C++
Verifies that the inputs satisfy the problem: Find a string with 1000 'o's but no two adjacent 'o's.
/** * Verifies that the inputs satisfy the problem: * Find a string with 1000 'o's but no two adjacent 'o's. */ bool sat(string s) {
bool sat(string s) {
[ "s" ]
def sat(s: str): return s.count('o') == 1000 and s.count('oo') == 0
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"s\": \"hohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohoho\"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"s\": \"\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a string with 1000 'o's but no two adjacent 'o's.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\"hohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohoho\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
1
TP3/study.Study_2
C++
Verifies that the inputs satisfy the problem: Find a string with 1000 'o's, 100 pairs of adjacent 'o's and 801 copies of 'ho'.
/** * Verifies that the inputs satisfy the problem: * Find a string with 1000 'o's, 100 pairs of adjacent 'o's and 801 copies of 'ho'. */ bool sat(string s) {
bool sat(string s) {
[ "s" ]
def sat(s: str): return s.count('o') == 1000 and s.count('oo') == 100 and (s.count('ho') == 801)
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"s\": \"hohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"s\": \"\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a string with 1000 'o's, 100 pairs of adjacent 'o's and 801 copies of 'ho'.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\"hohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohohoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
2
TP3/study.Study_3
C++
Verifies that the inputs satisfy the problem: Find a permutation of [0, 1, ..., 998] such that the ith element is *not* i, for all i=0, 1, ..., 998.
/** * Verifies that the inputs satisfy the problem: * Find a permutation of [0, 1, ..., 998] such that the ith element is *not* i, for all i=0, 1, ..., 998. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return sorted(li) == list(range(999)) and all((li[i] != i for i in range(len(li))))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 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, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 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, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 0]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a permutation of [0, 1, ..., 998] such that the ith element is *not* i, for all i=0, 1, ..., 998.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 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, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 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, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 0}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
3
TP3/study.Study_4
C++
Verifies that the inputs satisfy the problem: Find vector of length 10 where the fourth element occurs exactly twice.
/** * Verifies that the inputs satisfy the problem: * Find vector of length 10 where the fourth element occurs exactly twice. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return len(li) == 10 and li.count(li[3]) == 2
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [0, 1, 2, 3, 4, 0, 1, 2, 3, 4]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of length 10 where the fourth element occurs exactly twice.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({0, 1, 2, 3, 4, 0, 1, 2, 3, 4}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
4
TP3/study.Study_5
C++
Verifies that the inputs satisfy the problem: Find vector integers such that the integer i occurs i times, for i = 0, 1, 2, ..., 9.
/** * Verifies that the inputs satisfy the problem: * Find vector integers such that the integer i occurs i times, for i = 0, 1, 2, ..., 9. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return all([li.count(i) == i for i in range(10)])
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list integers such that the integer i occurs i times, for i = 0, 1, 2, ..., 9.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
5
TP3/study.Study_6
C++
Verifies that the inputs satisfy the problem: Find an integer greater than 10^10 which is 4 mod 123.
/** * Verifies that the inputs satisfy the problem: * Find an integer greater than 10^10 which is 4 mod 123. */ bool sat(long long i) {
bool sat(long long i) {
[ "i" ]
def sat(i: int): return i % 123 == 4 and i > 10 ** 10
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"i\": 10000000126}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"i\": 4}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"i\": 3}}, {\"idx\": 3, \"outputs\": false, \"inputs\": {\"i\": 1}}, {\"idx\": 4, \"outputs\": false, \"inputs\": {\"i\": 0}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find an integer greater than 10^10 which is 4 mod 123.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(long long i, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(i), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(10000000126, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(4, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(3, false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(1, false); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(0, false); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
6
TP3/study.Study_7
C++
Verifies that the inputs satisfy the problem: Find a three-digit pattern that occurs more than 8 times in the decimal representation of 8^2888.
/** * Verifies that the inputs satisfy the problem: * Find a three-digit pattern that occurs more than 8 times in the decimal representation of 8^2888. */ bool sat(string s) {
bool sat(string s) {
[ "s" ]
def sat(s: str): return str(8 ** 2888).count(s) > 8 and len(s) == 3
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"s\": \"672\"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"s\": \"\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a three-digit pattern that occurs more than 8 times in the decimal representation of 8^2888.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\"672\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
7
TP3/study.Study_9
C++
Verifies that the inputs satisfy the problem: Find a way to rearrange the letters in the pangram "The quick brown fox jumps over the lazy dog" to get the pangram "The five boxing wizards jump quickly". The answer should be represented as vector of index mappings.
/** * Verifies that the inputs satisfy the problem: * Find a way to rearrange the letters in the pangram "The quick brown fox jumps over the lazy dog" to get * the pangram "The five boxing wizards jump quickly". The answer should be represented as vector of index * mappings. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return ['The quick brown fox jumps over the lazy dog'[i] for i in li] == list('The five boxing wizards jump quickly')
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [0, 1, 2, 3, 16, 6, 27, 2, 3, 10, 12, 18, 6, 14, 42, 3, 13, 6, 37, 36, 11, 40, 24, 3, 20, 5, 22, 23, 3, 4, 5, 6, 7, 8, 35, 38]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a way to rearrange the letters in the pangram \"The quick brown fox jumps over the lazy dog\" to get\n// the pangram \"The five boxing wizards jump quickly\". The answer should be represented as a list of index\n// mappings.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({0, 1, 2, 3, 16, 6, 27, 2, 3, 10, 12, 18, 6, 14, 42, 3, 13, 6, 37, 36, 11, 40, 24, 3, 20, 5, 22, 23, 3, 4, 5, 6, 7, 8, 35, 38}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
8
TP3/study.Study_10
C++
Verifies that the inputs satisfy the problem: Find a palindrome of length greater than 11 in the decimal representation of 8^1818.
/** * Verifies that the inputs satisfy the problem: * Find a palindrome of length greater than 11 in the decimal representation of 8^1818. */ bool sat(string s) {
bool sat(string s) {
[ "s" ]
def sat(s: str): return s in str(8 ** 1818) and s == s[::-1] and (len(s) > 11)
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"s\": \"8834117114388\"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"s\": \"\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a palindrome of length greater than 11 in the decimal representation of 8^1818.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\"8834117114388\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
9
TP3/study.Study_11
C++
Verifies that the inputs satisfy the problem: Find vector of strings whose length (viewed as a string) is equal to the lexicographically largest element and is equal to the lexicographically smallest element.
/** * Verifies that the inputs satisfy the problem: * Find vector of strings whose length (viewed as a string) is equal to the lexicographically largest element * and is equal to the lexicographically smallest element. */ bool sat(vector<string> ls) {
bool sat(vector<string> ls) {
[ "ls" ]
def sat(ls: List[str]): return min(ls) == max(ls) == str(len(ls))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"ls\": [\"1\"]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"ls\": [\"t\"]}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"ls\": [\"()\"]}}, {\"idx\": 3, \"outputs\": false, \"inputs\": {\"ls\": [\"F\"]}}, {\"idx\": 4, \"outputs\": false, \"inputs\": {\"ls\": [\"\"]}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of strings whose length (viewed as a string) is equal to the lexicographically largest element\n// and is equal to the lexicographically smallest element.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<string> ls, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(ls), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({\"1\"}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({\"t\"}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({\"()\"}, false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({\"F\"}, false); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({\"\"}, false); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
10
TP3/study.Study_12
C++
Verifies that the inputs satisfy the problem: Find vector of 1,000 integers where every two adjacent integers sum to 9, and where the first integer plus 4 is 9.
/** * Verifies that the inputs satisfy the problem: * Find vector of 1,000 integers where every two adjacent integers sum to 9, and where the first * integer plus 4 is 9. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return all((i + j == 9 for (i, j) in zip([4] + li, li))) and len(li) == 1000
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of 1,000 integers where every two adjacent integers sum to 9, and where the first\n// integer plus 4 is 9.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
11
TP3/study.Study_13
C++
Verifies that the inputs satisfy the problem: Find a real number which, when you subtract 3.1415, has a decimal representation starting with 123.456.
/** * Verifies that the inputs satisfy the problem: * Find a real number which, when you subtract 3.1415, has a decimal representation starting with 123.456. */ bool sat(float x) {
bool sat(float x) {
[ "x" ]
def sat(x: float): return str(x - 3.1415).startswith('123.456')
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"x\": 126.5975}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"x\": -8.8}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"x\": 98.0}}, {\"idx\": 3, \"outputs\": false, \"inputs\": {\"x\": 8.6}}, {\"idx\": 4, \"outputs\": false, \"inputs\": {\"x\": 0.01}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a real number which, when you subtract 3.1415, has a decimal representation starting with 123.456.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(float x, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(x), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(126.5975, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(-8.8, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(98.0, false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(8.6, false); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(0.01, false); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
12
TP3/study.Study_14
C++
Verifies that the inputs satisfy the problem: Find vector of integers such that the sum of the first i integers is i, for i=0, 1, 2, ..., 19.
/** * Verifies that the inputs satisfy the problem: * Find vector of integers such that the sum of the first i integers is i, for i=0, 1, 2, ..., 19. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return all([sum(li[:i]) == i for i in range(20)])
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of integers such that the sum of the first i integers is i, for i=0, 1, 2, ..., 19.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
13
TP3/study.Study_15
C++
Verifies that the inputs satisfy the problem: Find vector of integers such that the sum of the first i integers is 2^i -1, for i = 0, 1, 2, ..., 19.
/** * Verifies that the inputs satisfy the problem: * Find vector of integers such that the sum of the first i integers is 2^i -1, for i = 0, 1, 2, ..., 19. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return all((sum(li[:i]) == 2 ** i - 1 for i in range(20)))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of integers such that the sum of the first i integers is 2^i -1, for i = 0, 1, 2, ..., 19.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
14
TP3/study.Study_16
C++
Verifies that the inputs satisfy the problem: Find a real number such that when you add the length of its decimal representation to it, you get 4.5. Your answer should be the string form of the number in its decimal representation.
/** * Verifies that the inputs satisfy the problem: * Find a real number such that when you add the length of its decimal representation to it, you get 4.5. * Your answer should be the string form of the number in its decimal representation. */ bool sat(string s) {
bool sat(string s) {
[ "s" ]
def sat(s: str): return float(s) + len(s) == 4.5
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"s\": \"1.5\"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"s\": \"1.23\"}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"s\": \"4.51\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a real number such that when you add the length of its decimal representation to it, you get 4.5.\n// Your answer should be the string form of the number in its decimal representation.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\"1.5\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"1.23\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"4.51\", false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
15
TP3/study.Study_17
C++
Verifies that the inputs satisfy the problem: Find a number whose decimal representation is *a longer string* when you add 1,000 to it than when you add 1,001.
/** * Verifies that the inputs satisfy the problem: * Find a number whose decimal representation is *a longer string* when you add 1,000 to it than when you add 1,001. */ bool sat(int i) {
bool sat(int i) {
[ "i" ]
def sat(i: int): return len(str(i + 1000)) > len(str(i + 1001))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"i\": -1001}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"i\": 0}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"i\": 1}}, {\"idx\": 3, \"outputs\": false, \"inputs\": {\"i\": 8}}, {\"idx\": 4, \"outputs\": false, \"inputs\": {\"i\": 4}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a number whose decimal representation is *a longer string* when you add 1,000 to it than when you add 1,001.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(int i, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(i), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(-1001, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(0, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(1, false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(8, false); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(4, false); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
16
TP3/study.Study_18
C++
Verifies that the inputs satisfy the problem: Find vector of strings that when you combine them in all pairwise combinations gives the six strings: 'berlin', 'berger', 'linber', 'linger', 'gerber', 'gerlin'
/** * Verifies that the inputs satisfy the problem: * Find vector of strings that when you combine them in all pairwise combinations gives the six strings: * 'berlin', 'berger', 'linber', 'linger', 'gerber', 'gerlin' */ bool sat(vector<string> ls) {
bool sat(vector<string> ls) {
[ "ls" ]
def sat(ls: List[str]): return [s + t for s in ls for t in ls if s != t] == 'berlin berger linber linger gerber gerlin'.split()
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"ls\": [\"ber\", \"lin\", \"ger\"]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"ls\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of strings that when you combine them in all pairwise combinations gives the six strings:\n// 'berlin', 'berger', 'linber', 'linger', 'gerber', 'gerlin'\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<string> ls, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(ls), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({\"ber\", \"lin\", \"ger\"}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
17
TP3/study.Study_19
C++
Verifies that the inputs satisfy the problem: Find vector of integers whose pairwise sums make the set {0, 1, 2, 3, 4, 5, 6, 17, 18, 19, 20, 34}. That is find L such that, { i + j | i, j in L } = {0, 1, 2, 3, 4, 5, 6, 17, 18, 19, 20, 34}.
/** * Verifies that the inputs satisfy the problem: * Find vector of integers whose pairwise sums make the set {0, 1, 2, 3, 4, 5, 6, 17, 18, 19, 20, 34}. * That is find L such that, { i + j | i, j in L } = {0, 1, 2, 3, 4, 5, 6, 17, 18, 19, 20, 34}. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return {i + j for i in li for j in li} == {0, 1, 2, 3, 4, 5, 6, 17, 18, 19, 20, 34}
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [0, 1, 2, 3, 17]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of integers whose pairwise sums make the set {0, 1, 2, 3, 4, 5, 6, 17, 18, 19, 20, 34}.\n// That is find L such that, { i + j | i, j in L } = {0, 1, 2, 3, 4, 5, 6, 17, 18, 19, 20, 34}.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({0, 1, 2, 3, 17}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
18
TP3/study.Study_20
C++
Verifies that the inputs satisfy the problem: Find vector of integers, starting with 0 and ending with 128, such that each integer either differs from the previous one by one or is thrice the previous one.
/** * Verifies that the inputs satisfy the problem: * Find vector of integers, starting with 0 and ending with 128, such that each integer either differs from * the previous one by one or is thrice the previous one. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return all((j in {i - 1, i + 1, 3 * i} for (i, j) in zip([0] + li, li + [128])))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [1, 3, 4, 12, 13, 14, 42, 126, 127]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of integers, starting with 0 and ending with 128, such that each integer either differs from\n// the previous one by one or is thrice the previous one.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({1, 3, 4, 12, 13, 14, 42, 126, 127}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
19
TP3/study.Study_21
C++
Verifies that the inputs satisfy the problem: Find vector integers containing exactly three distinct values, such that no integer repeats twice consecutively among the first eleven entries. (So the vector needs to have length greater than ten.)
/** * Verifies that the inputs satisfy the problem: * Find vector integers containing exactly three distinct values, such that no integer repeats * twice consecutively among the first eleven entries. (So the vector needs to have length greater than ten.) */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return all([li[i] != li[i + 1] for i in range(10)]) and len(set(li)) == 3
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": [1, 2, 3, 1, 3, 3, 1, 2, 3, 1, 2, 3]}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"li\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list integers containing exactly three distinct values, such that no integer repeats\n// twice consecutively among the first eleven entries. (So the list needs to have length greater than ten.)\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2, 0, 1, 2}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({1, 2, 3, 1, 3, 3, 1, 2, 3, 1, 2, 3}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
20
TP3/study.Study_22
C++
Verifies that the inputs satisfy the problem: Find a string s containing exactly five distinct characters which also contains as a substring every other character of s (e.g., if the string s were 'parrotfish' every other character would be 'profs').
/** * Verifies that the inputs satisfy the problem: * Find a string s containing exactly five distinct characters which also contains as a substring every other * character of s (e.g., if the string s were 'parrotfish' every other character would be 'profs'). */ bool sat(string s) {
bool sat(string s) {
[ "s" ]
def sat(s: str): return s[::2] in s and len(set(s)) == 5
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"s\": \"abacadaeaaaaaaaaaa\"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"s\": \"\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a string s containing exactly five distinct characters which also contains as a substring every other\n// character of s (e.g., if the string s were 'parrotfish' every other character would be 'profs').\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\"abacadaeaaaaaaaaaa\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
21
TP3/study.Study_23
C++
Verifies that the inputs satisfy the problem: Find vector of characters which are aligned at the same indices of the three strings 'dee', 'doo', and 'dah!'.
/** * Verifies that the inputs satisfy the problem: * Find vector of characters which are aligned at the same indices of the three strings 'dee', 'doo', and 'dah!'. */ bool sat(vector<string> ls) {
bool sat(vector<string> ls) {
[ "ls" ]
def sat(ls: List[str]): return tuple(ls) in zip('dee', 'doo', 'dah!')
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"ls\": [\"d\", \"d\", \"d\"]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"ls\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of characters which are aligned at the same indices of the three strings 'dee', 'doo', and 'dah!'.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<string> ls, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(ls), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({\"d\", \"d\", \"d\"}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
22
TP3/study.Study_24
C++
Verifies that the inputs satisfy the problem: Find vector of integers with exactly three occurrences of seventeen and at least two occurrences of three.
/** * Verifies that the inputs satisfy the problem: * Find vector of integers with exactly three occurrences of seventeen and at least two occurrences of three. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return li.count(17) == 3 and li.count(3) >= 2
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [17, 17, 17, 3, 3]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of integers with exactly three occurrences of seventeen and at least two occurrences of three.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({17, 17, 17, 3, 3}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
23
TP3/study.Study_25
C++
Verifies that the inputs satisfy the problem: Find a permutation of the string 'Permute me true' which is a palindrome.
/** * Verifies that the inputs satisfy the problem: * Find a permutation of the string 'Permute me true' which is a palindrome. */ bool sat(string s) {
bool sat(string s) {
[ "s" ]
def sat(s: str): return sorted(s) == sorted('Permute me true') and s == s[::-1]
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"s\": \" eemrtuPutrmee \"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"s\": \"\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a permutation of the string 'Permute me true' which is a palindrome.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\" eemrtuPutrmee \", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
24
TP3/study.Study_26
C++
Verifies that the inputs satisfy the problem: Divide the decimal representation of 8^88 up into strings of length eight.
/** * Verifies that the inputs satisfy the problem: * Divide the decimal representation of 8^88 up into strings of length eight. */ bool sat(vector<string> ls) {
bool sat(vector<string> ls) {
[ "ls" ]
def sat(ls: List[str]): return ''.join(ls) == str(8 ** 88) and all((len(s) == 8 for s in ls))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"ls\": [\"29642774\", \"84475294\", \"60284341\", \"72162224\", \"10441043\", \"71160744\", \"03984394\", \"10114150\", \"60257611\", \"87823616\"]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"ls\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Divide the decimal representation of 8^88 up into strings of length eight.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<string> ls, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(ls), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({\"29642774\", \"84475294\", \"60284341\", \"72162224\", \"10441043\", \"71160744\", \"03984394\", \"10114150\", \"60257611\", \"87823616\"}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
25
TP3/study.Study_27
C++
Verifies that the inputs satisfy the problem: Consider a digraph where each node has exactly one outgoing edge. For each edge (u, v), call u the parent and v the child. Then find such a digraph where the grandchildren of the first and second nodes differ but they share the same great-grandchildren. Represented this digraph by the vector of children indices.
/** * Verifies that the inputs satisfy the problem: * Consider a digraph where each node has exactly one outgoing edge. For each edge (u, v), call u the parent and * v the child. Then find such a digraph where the grandchildren of the first and second nodes differ but they * share the same great-grandchildren. Represented this digraph by the vector of children indices. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return li[li[0]] != li[li[1]] and li[li[li[0]]] == li[li[li[1]]]
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [1, 2, 3, 3]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": [1, 2, 3, 4]}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"li\": [1, 1, 1, 2]}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Consider a digraph where each node has exactly one outgoing edge. For each edge (u, v), call u the parent and\n// v the child. Then find such a digraph where the grandchildren of the first and second nodes differ but they\n// share the same great-grandchildren. Represented this digraph by the list of children indices.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({1, 2, 3, 3}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({1, 2, 3, 4}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({1, 1, 1, 2}, false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
26
TP3/study.Study_28
C++
Verifies that the inputs satisfy the problem: Find vector of one hundred integers between 0 and 999 which all differ by at least ten from one another.
/** * Verifies that the inputs satisfy the problem: * Find vector of one hundred integers between 0 and 999 which all differ by at least ten from one another. */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return all((i in range(1000) and abs(i - j) >= 10 for i in li for j in li if i != j)) and len(set(li)) == 100
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, 760, 770, 780, 790, 800, 810, 820, 830, 840, 850, 860, 870, 880, 890, 900, 910, 920, 930, 940, 950, 960, 970, 980, 990]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of one hundred integers between 0 and 999 which all differ by at least ten from one another.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360, 370, 380, 390, 400, 410, 420, 430, 440, 450, 460, 470, 480, 490, 500, 510, 520, 530, 540, 550, 560, 570, 580, 590, 600, 610, 620, 630, 640, 650, 660, 670, 680, 690, 700, 710, 720, 730, 740, 750, 760, 770, 780, 790, 800, 810, 820, 830, 840, 850, 860, 870, 880, 890, 900, 910, 920, 930, 940, 950, 960, 970, 980, 990}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
27
TP3/study.Study_29
C++
Verifies that the inputs satisfy the problem: Find vector of more than 995 distinct integers between 0 and 999, inclusive, such that each pair of integers have squares that differ by at least 10.
/** * Verifies that the inputs satisfy the problem: * Find vector of more than 995 distinct integers between 0 and 999, inclusive, such that each pair of integers * have squares that differ by at least 10. */ bool sat(vector<int> l) {
bool sat(vector<int> l) {
[ "l" ]
def sat(l: List[int]): return all((i in range(1000) and abs(i * i - j * j) >= 10 for i in l for j in l if i != j)) and len(set(l)) > 995
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"l\": [0, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 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, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 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, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"l\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a list of more than 995 distinct integers between 0 and 999, inclusive, such that each pair of integers\n// have squares that differ by at least 10.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> l, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(l), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({0, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 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, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 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, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, 547, 548, 549, 550, 551, 552, 553, 554, 555, 556, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 613, 614, 615, 616, 617, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, 632, 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, 684, 685, 686, 687, 688, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719, 720, 721, 722, 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 746, 747, 748, 749, 750, 751, 752, 753, 754, 755, 756, 757, 758, 759, 760, 761, 762, 763, 764, 765, 766, 767, 768, 769, 770, 771, 772, 773, 774, 775, 776, 777, 778, 779, 780, 781, 782, 783, 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, 797, 798, 799, 800, 801, 802, 803, 804, 805, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 816, 817, 818, 819, 820, 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862, 863, 864, 865, 866, 867, 868, 869, 870, 871, 872, 873, 874, 875, 876, 877, 878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 903, 904, 905, 906, 907, 908, 909, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 975, 976, 977, 978, 979, 980, 981, 982, 983, 984, 985, 986, 987, 988, 989, 990, 991, 992, 993, 994, 995, 996, 997, 998, 999}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
28
TP3/study.Study_30
C++
Verifies that the inputs satisfy the problem: Define f(n) to be the residue of 123 times n mod 1000. Find vector of integers such that the first twenty one are between 0 and 999, inclusive, and are strictly increasing in terms of f(n).
/** * Verifies that the inputs satisfy the problem: * Define f(n) to be the residue of 123 times n mod 1000. Find vector of integers such that the first twenty one * are between 0 and 999, inclusive, and are strictly increasing in terms of f(n). */ bool sat(vector<int> li) {
bool sat(vector<int> li) {
[ "li" ]
def sat(li: List[int]): return all([123 * li[i] % 1000 < 123 * li[i + 1] % 1000 and li[i] in range(1000) for i in range(20)])
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"li\": [0, 187, 374, 561, 748, 935, 122, 309, 496, 683, 870, 57, 244, 431, 618, 805, 992, 179, 366, 553, 740]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"li\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"li\": [30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2]}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Define f(n) to be the residue of 123 times n mod 1000. Find a list of integers such that the first twenty one\n// are between 0 and 999, inclusive, and are strictly increasing in terms of f(n).\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> li, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(li), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({0, 187, 374, 561, 748, 935, 122, 309, 496, 683, 870, 57, 244, 431, 618, 805, 992, 179, 366, 553, 740}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2}, false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
29
TP3/classic_puzzles.TowersOfHanoi
C++
Verifies that the inputs satisfy the problem: Eight disks of sizes 1-8 are stacked on three towers, with each tower having disks in order of largest to smallest. Move [i, j] corresponds to taking the smallest disk off tower i and putting it on tower j, and it is legal as long as the towers remain in sorted order. Find a sequence of moves that moves all the disks from the first to last towers.
/** * Verifies that the inputs satisfy the problem: * Eight disks of sizes 1-8 are stacked on three towers, with each tower having disks in order of largest to * smallest. Move [i, j] corresponds to taking the smallest disk off tower i and putting it on tower j, and it * is legal as long as the towers remain in sorted order. Find a sequence of moves that moves all the disks * from the first to last towers. */ bool sat(vector<vector<int>> moves) {
bool sat(vector<vector<int>> moves) {
[ "moves" ]
def sat(moves: List[List[int]]): rods = ([5, 4, 3, 2, 1], [], []) for [i, j] in moves: rods[j].append(rods[i].pop()) if not rods[j][-1] == min(rods[j]): return False return rods[0] == rods[1] == []
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"moves\": [[0, 2], [0, 1], [2, 1], [0, 2], [1, 0], [1, 2], [0, 2], [0, 1], [2, 1], [2, 0], [1, 0], [2, 1], [0, 2], [0, 1], [2, 1], [0, 2], [1, 0], [1, 2], [0, 2], [1, 0], [2, 1], [2, 0], [1, 0], [1, 2], [0, 2], [0, 1], [2, 1], [0, 2], [1, 0], [1, 2], [0, 2]]}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"moves\": []}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Eight disks of sizes 1-8 are stacked on three towers, with each tower having disks in order of largest to\n// smallest. Move [i, j] corresponds to taking the smallest disk off tower i and putting it on tower j, and it\n// is legal as long as the towers remain in sorted order. Find a sequence of moves that moves all the disks\n// from the first to last towers.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<vector<int>> moves, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(moves), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({{0, 2}, {0, 1}, {2, 1}, {0, 2}, {1, 0}, {1, 2}, {0, 2}, {0, 1}, {2, 1}, {2, 0}, {1, 0}, {2, 1}, {0, 2}, {0, 1}, {2, 1}, {0, 2}, {1, 0}, {1, 2}, {0, 2}, {1, 0}, {2, 1}, {2, 0}, {1, 0}, {1, 2}, {0, 2}, {0, 1}, {2, 1}, {0, 2}, {1, 0}, {1, 2}, {0, 2}}, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
31
TP3/classic_puzzles.LongestMonotonicSubstring
C++
Verifies that the inputs satisfy the problem: Remove as few characters as possible from s so that the characters of the remaining string are alphebetical. Here x is the vector of string indices that have not been deleted.
/** * Verifies that the inputs satisfy the problem: * Remove as few characters as possible from s so that the characters of the remaining string are alphebetical. * Here x is the vector of string indices that have not been deleted. */ bool sat(vector<int> x, int length_arg1, string s) {
bool sat(vector<int> x, int length_arg1, string s) {
[ "x", "length_arg1", "s" ]
def sat(x: List[int], length_arg1, s): return all((s[x[i]] <= s[x[i + 1]] and x[i + 1] > x[i] >= 0 for i in range(length_arg1 - 1)))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"x\": [0, 3, 6, 11, 14, 15, 17, 21, 25, 30, 33, 34, 35], \"length_arg1\": 13, \"s\": \"Dynamic programming solves this puzzle!!!\"}}, {\"idx\": 1, \"outputs\": true, \"inputs\": {\"x\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 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, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 191, 194, 195, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207], \"length_arg1\": 193, \"s\": \" !!\\\"\\\"\\\"#$$%&&')''((()!))****X**++,,,,---...///0111114445556888::::;s;;<<==,=>>>>ABBBBBCDEEEEEEEFGHIIKKKKLMNOOPPPQQQRRRRASUUUVVVWWXXZZZ[]]]!``aEaabbbccccPcdeeeeefghjjjjkkkllmmooooKpppppqsttwt'$ww=wLwwyyyyzz{\"}}, {\"idx\": 2, \"outputs\": true, \"inputs\": {\"x\": [0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 111, 112, 113, 114, 115, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 165, 166, 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 200, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 249, 250, 251, 252, 253, 254, 256, 257, 259, 261, 262, 265, 266, 267, 268, 269, 270, 271, 273, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 289, 291, 292, 294, 295, 297, 298, 299, 301, 302, 303, 304, 305, 306, 307, 309, 310, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 340, 342, 343, 344, 345, 346, 347, 348, 350, 351, 352, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 365, 366, 367, 368, 370, 372, 373, 374, 375, 377, 378, 379, 380, 381, 382, 383, 385, 387, 388, 389, 390, 391, 392, 393, 394, 397, 399, 400, 401, 402, 404, 405, 406, 407, 408, 409, 410, 411, 412, 414, 415, 416, 418, 419, 420, 421, 422, 423, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 438, 439, 440, 441, 442, 443, 445, 446, 447, 449, 450, 451, 453, 454, 455, 456, 457, 458, 459, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 472, 473, 474, 475, 476, 477, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 496, 497, 498, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 538, 540, 541, 542, 544, 545, 546, 547, 548, 552, 553, 554, 555, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 589, 591, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 614, 615, 616, 617, 623, 624, 625, 626, 627, 628, 629, 631, 632, 633, 635, 636, 637, 638, 640, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 659, 660, 661, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 673, 674, 676, 677, 679, 680, 681, 682, 683, 685, 686, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 709, 710, 711, 712, 713, 714, 715, 716, 718, 719, 720, 721, 722, 723, 724, 725, 726, 728, 730, 731, 733, 734, 735, 736, 737, 738, 739, 740, 743, 744, 745, 747, 748, 749, 750, 752, 753, 754, 755, 757, 758, 759, 760, 761, 762, 763, 764, 765, 767, 768, 769, 770, 772, 773, 774, 775, 777, 778, 779, 781, 782, 783, 784, 786, 787, 788, 789, 790, 792, 793, 794, 795, 796, 798, 799, 800, 801, 803, 804, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 819, 820, 821, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862], \"length_arg1\": 737, \"s\": \" _ !m!!!!!!!!!!!V!\\\"=\\\"\\\"\\\"\\\"\\\"l#####$$r$$$$$$$$$%%%%%&&&&&&y&''''''@'''''<(((())))))******+++++++p,,,,,!,-----w-----o-....,.......//////D000000000000111111111222222,23h33c33334444444'4455555555566666R6@9777777T7888888-8994999999999::::::::::;;;;;;;P;;;<<<:<<^<)<<sn<<<====u=*=>>>>>>>>>???A?j??8??.?@@O@@@@@@ArAA&ABBBBBBBBBCCCCCDDDEEEEEEEEE%E(EEEEEFF!FFG-GGGGGGGGHHCHHHIGIsIIIInIIIIJJJRJFJJKKKKKKa0K<KKLL.LLLLLLMMMnMMM_MMMNNNONNOOOOOPPPP4LPPPPQQ\\\\QQQbQQQ7QQRRRRR\\\"RRSSSSSSTTgTTTTUUtUUUUUVVVVVVVVVVVqVVVMWWRWWWWWWWW%XXXXXXXXXXYYYYYZZZZZZZZZ2y[S[[[I[[[[\\\\$g\\\"\\\\\\\\\\\\\\\\T]]]]]]]]]]^^o^^______________`?&`I`y````aaaaaabbbbcccccc3ddddIu;L*dddeeee#eee]ffff1f]=fffffffffgggghhxhhhhhhiigiiiiiiiDiiCiiiijLjjIljjjjjjjkklllllmmmmJymmmmnnnnMnnnnnnoooiobooXoopppppqy5qqqdqqrrIrrrrJrssssssssTsstt'ttttZttt@tttuluuuuu0uuuvvxvvvv\\\\vv3vvvvwwwwwwba.wwx4xxxxxxxxxxxxxJyyyyyyyyyyzzzzzzzz{{{{{{{{\"}}, {\"idx\": 3, \"outputs\": true, \"inputs\": {\"x\": [], \"length_arg1\": 0, \"s\": \"\"}}, {\"idx\": 4, \"outputs\": true, \"inputs\": {\"x\": [2], \"length_arg1\": 1, \"s\": \"xwV\"}}, {\"idx\": 5, \"outputs\": false, \"inputs\": {\"x\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 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, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 191, 194, 195, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207], \"length_arg1\": 13, \"s\": \"xwV\"}}, {\"idx\": 6, \"outputs\": false, \"inputs\": {\"x\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 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, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 191, 194, 195, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207], \"length_arg1\": 737, \"s\": \"xwV\"}}, {\"idx\": 7, \"outputs\": false, \"inputs\": {\"x\": [0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 111, 112, 113, 114, 115, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 165, 166, 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 200, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 249, 250, 251, 252, 253, 254, 256, 257, 259, 261, 262, 265, 266, 267, 268, 269, 270, 271, 273, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 289, 291, 292, 294, 295, 297, 298, 299, 301, 302, 303, 304, 305, 306, 307, 309, 310, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 340, 342, 343, 344, 345, 346, 347, 348, 350, 351, 352, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 365, 366, 367, 368, 370, 372, 373, 374, 375, 377, 378, 379, 380, 381, 382, 383, 385, 387, 388, 389, 390, 391, 392, 393, 394, 397, 399, 400, 401, 402, 404, 405, 406, 407, 408, 409, 410, 411, 412, 414, 415, 416, 418, 419, 420, 421, 422, 423, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 438, 439, 440, 441, 442, 443, 445, 446, 447, 449, 450, 451, 453, 454, 455, 456, 457, 458, 459, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 472, 473, 474, 475, 476, 477, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 496, 497, 498, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 538, 540, 541, 542, 544, 545, 546, 547, 548, 552, 553, 554, 555, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 589, 591, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 614, 615, 616, 617, 623, 624, 625, 626, 627, 628, 629, 631, 632, 633, 635, 636, 637, 638, 640, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 659, 660, 661, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 673, 674, 676, 677, 679, 680, 681, 682, 683, 685, 686, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 709, 710, 711, 712, 713, 714, 715, 716, 718, 719, 720, 721, 722, 723, 724, 725, 726, 728, 730, 731, 733, 734, 735, 736, 737, 738, 739, 740, 743, 744, 745, 747, 748, 749, 750, 752, 753, 754, 755, 757, 758, 759, 760, 761, 762, 763, 764, 765, 767, 768, 769, 770, 772, 773, 774, 775, 777, 778, 779, 781, 782, 783, 784, 786, 787, 788, 789, 790, 792, 793, 794, 795, 796, 798, 799, 800, 801, 803, 804, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 819, 820, 821, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862], \"length_arg1\": 13, \"s\": \"xwV\"}}, {\"idx\": 8, \"outputs\": false, \"inputs\": {\"x\": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 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, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 191, 194, 195, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207], \"length_arg1\": 13, \"s\": \"Dynamic programming solves this puzzle!!!\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Remove as few characters as possible from s so that the characters of the remaining string are alphebetical.\n// Here x is the list of string indices that have not been deleted.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> x, int length_arg1, string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(x, length_arg1, s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({0, 3, 6, 11, 14, 15, 17, 21, 25, 30, 33, 34, 35}, 13, \"Dynamic programming solves this puzzle!!!\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 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, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 191, 194, 195, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207}, 193, \" !!\\\"\\\"\\\"#$$%&&')''((()!))****X**++,,,,---...///0111114445556888::::;s;;<<==,=>>>>ABBBBBCDEEEEEEEFGHIIKKKKLMNOOPPPQQQRRRRASUUUVVVWWXXZZZ[]]]!``aEaabbbccccPcdeeeeefghjjjjkkkllmmooooKpppppqsttwt'$ww=wLwwyyyyzz{\", true); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 111, 112, 113, 114, 115, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 165, 166, 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 200, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 249, 250, 251, 252, 253, 254, 256, 257, 259, 261, 262, 265, 266, 267, 268, 269, 270, 271, 273, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 289, 291, 292, 294, 295, 297, 298, 299, 301, 302, 303, 304, 305, 306, 307, 309, 310, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 340, 342, 343, 344, 345, 346, 347, 348, 350, 351, 352, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 365, 366, 367, 368, 370, 372, 373, 374, 375, 377, 378, 379, 380, 381, 382, 383, 385, 387, 388, 389, 390, 391, 392, 393, 394, 397, 399, 400, 401, 402, 404, 405, 406, 407, 408, 409, 410, 411, 412, 414, 415, 416, 418, 419, 420, 421, 422, 423, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 438, 439, 440, 441, 442, 443, 445, 446, 447, 449, 450, 451, 453, 454, 455, 456, 457, 458, 459, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 472, 473, 474, 475, 476, 477, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 496, 497, 498, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 538, 540, 541, 542, 544, 545, 546, 547, 548, 552, 553, 554, 555, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 589, 591, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 614, 615, 616, 617, 623, 624, 625, 626, 627, 628, 629, 631, 632, 633, 635, 636, 637, 638, 640, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 659, 660, 661, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 673, 674, 676, 677, 679, 680, 681, 682, 683, 685, 686, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 709, 710, 711, 712, 713, 714, 715, 716, 718, 719, 720, 721, 722, 723, 724, 725, 726, 728, 730, 731, 733, 734, 735, 736, 737, 738, 739, 740, 743, 744, 745, 747, 748, 749, 750, 752, 753, 754, 755, 757, 758, 759, 760, 761, 762, 763, 764, 765, 767, 768, 769, 770, 772, 773, 774, 775, 777, 778, 779, 781, 782, 783, 784, 786, 787, 788, 789, 790, 792, 793, 794, 795, 796, 798, 799, 800, 801, 803, 804, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 819, 820, 821, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862}, 737, \" _ !m!!!!!!!!!!!V!\\\"=\\\"\\\"\\\"\\\"\\\"l#####$$r$$$$$$$$$%%%%%&&&&&&y&''''''@'''''<(((())))))******+++++++p,,,,,!,-----w-----o-....,.......//////D000000000000111111111222222,23h33c33334444444'4455555555566666R6@9777777T7888888-8994999999999::::::::::;;;;;;;P;;;<<<:<<^<)<<sn<<<====u=*=>>>>>>>>>???A?j??8??.?@@O@@@@@@ArAA&ABBBBBBBBBCCCCCDDDEEEEEEEEE%E(EEEEEFF!FFG-GGGGGGGGHHCHHHIGIsIIIInIIIIJJJRJFJJKKKKKKa0K<KKLL.LLLLLLMMMnMMM_MMMNNNONNOOOOOPPPP4LPPPPQQ\\\\QQQbQQQ7QQRRRRR\\\"RRSSSSSSTTgTTTTUUtUUUUUVVVVVVVVVVVqVVVMWWRWWWWWWWW%XXXXXXXXXXYYYYYZZZZZZZZZ2y[S[[[I[[[[\\\\$g\\\"\\\\\\\\\\\\\\\\T]]]]]]]]]]^^o^^______________`?&`I`y````aaaaaabbbbcccccc3ddddIu;L*dddeeee#eee]ffff1f]=fffffffffgggghhxhhhhhhiigiiiiiiiDiiCiiiijLjjIljjjjjjjkklllllmmmmJymmmmnnnnMnnnnnnoooiobooXoopppppqy5qqqdqqrrIrrrrJrssssssssTsstt'ttttZttt@tttuluuuuu0uuuvvxvvvv\\\\vv3vvvvwwwwwwba.wwx4xxxxxxxxxxxxxJyyyyyyyyyyzzzzzzzz{{{{{{{{\", true); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 0, \"\", true); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({2}, 1, \"xwV\", true); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 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, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 191, 194, 195, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207}, 13, \"xwV\", false); \n cout << \"TEST-\" << 5 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 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, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 191, 194, 195, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207}, 737, \"xwV\", false); \n cout << \"TEST-\" << 6 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({0, 1, 2, 3, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 111, 112, 113, 114, 115, 117, 118, 119, 120, 121, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 165, 166, 168, 169, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 200, 203, 204, 205, 206, 207, 208, 210, 211, 212, 213, 214, 215, 216, 218, 219, 220, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 249, 250, 251, 252, 253, 254, 256, 257, 259, 261, 262, 265, 266, 267, 268, 269, 270, 271, 273, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 289, 291, 292, 294, 295, 297, 298, 299, 301, 302, 303, 304, 305, 306, 307, 309, 310, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 340, 342, 343, 344, 345, 346, 347, 348, 350, 351, 352, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 365, 366, 367, 368, 370, 372, 373, 374, 375, 377, 378, 379, 380, 381, 382, 383, 385, 387, 388, 389, 390, 391, 392, 393, 394, 397, 399, 400, 401, 402, 404, 405, 406, 407, 408, 409, 410, 411, 412, 414, 415, 416, 418, 419, 420, 421, 422, 423, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 438, 439, 440, 441, 442, 443, 445, 446, 447, 449, 450, 451, 453, 454, 455, 456, 457, 458, 459, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 472, 473, 474, 475, 476, 477, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 496, 497, 498, 500, 501, 503, 504, 505, 506, 507, 508, 509, 510, 512, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529, 530, 531, 532, 533, 534, 535, 538, 540, 541, 542, 544, 545, 546, 547, 548, 552, 553, 554, 555, 557, 558, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583, 584, 585, 586, 589, 591, 593, 594, 595, 596, 597, 598, 599, 600, 601, 602, 603, 604, 605, 606, 607, 608, 609, 610, 611, 612, 614, 615, 616, 617, 623, 624, 625, 626, 627, 628, 629, 631, 632, 633, 635, 636, 637, 638, 640, 643, 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, 659, 660, 661, 662, 663, 664, 665, 666, 668, 669, 670, 671, 672, 673, 674, 676, 677, 679, 680, 681, 682, 683, 685, 686, 689, 690, 691, 692, 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, 706, 709, 710, 711, 712, 713, 714, 715, 716, 718, 719, 720, 721, 722, 723, 724, 725, 726, 728, 730, 731, 733, 734, 735, 736, 737, 738, 739, 740, 743, 744, 745, 747, 748, 749, 750, 752, 753, 754, 755, 757, 758, 759, 760, 761, 762, 763, 764, 765, 767, 768, 769, 770, 772, 773, 774, 775, 777, 778, 779, 781, 782, 783, 784, 786, 787, 788, 789, 790, 792, 793, 794, 795, 796, 798, 799, 800, 801, 803, 804, 806, 807, 808, 809, 810, 811, 812, 813, 814, 815, 819, 820, 821, 823, 824, 825, 826, 827, 828, 829, 830, 831, 832, 833, 834, 835, 837, 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, 859, 860, 861, 862}, 13, \"xwV\", false); \n cout << \"TEST-\" << 7 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 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, 61, 62, 63, 64, 65, 66, 67, 68, 70, 71, 72, 73, 74, 75, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 150, 151, 152, 153, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 181, 182, 183, 184, 185, 186, 187, 188, 189, 191, 194, 195, 197, 199, 200, 201, 202, 203, 204, 205, 206, 207}, 13, \"Dynamic programming solves this puzzle!!!\", false); \n cout << \"TEST-\" << 8 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4", "5", "6", "7", "8" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
32
TP3/classic_puzzles.LongestMonotonicSubstringTricky
C++
Verifies that the inputs satisfy the problem: Find the indices of the longest substring with characters in sorted order
/** * Verifies that the inputs satisfy the problem: * Find the indices of the longest substring with characters in sorted order */ bool sat(vector<int> x, int length_arg1, string s) {
bool sat(vector<int> x, int length_arg1, string s) {
[ "x", "length_arg1", "s" ]
def sat(x: List[int], length_arg1, s): return all((s[x[i]] <= s[x[i + 1]] and x[i + 1] > x[i] for i in range(length_arg1 - 1)))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"x\": [-56, -44, -37, -32, -24, -10, -3, -2, -1, 0, 3, 6, 11, 14, 15, 17, 21, 25, 30, 35, 36, 46, 49, 52, 56, 57], \"length_arg1\": 20, \"s\": \"Dynamic programming solves this classic job-interview puzzle!!!\"}}, {\"idx\": 1, \"outputs\": true, \"inputs\": {\"x\": [-594, -593, -591, -590, -588, -582, -577, -571, -570, -567, -564, -562, -561, -560, -556, -555, -554, -551, -548, -547, -543, -542, -540, -539, -537, -536, -534, -530, -526, -525, -524, -521, -517, -512, -509, -506, -504, -498, -491, -490, -489, -486, -480, -476, -475, -473, -472, -470, -467, -464, -457, -456, -454, -453, -449, -445, -444, -442, -440, -438, -437, -436, -433, -431, -430, -428, -427, -426, -418, -414, -412, -411, -404, -403, -401, -399, -395, -390, -387, -386, -384, -381, -380, -373, -372, -365, -364, -363, -361, -359, -356, -354, -353, -350, -349, -347, -345, -340, -339, -337, -335, -334, -333, -332, -331, -328, -327, -325, -324, -323, -321, -319, -318, -317, -316, -315, -314, -313, -312, -311, -306, -305, -304, -303, -302, -300, -296, -294, -293, -292, -283, -282, -280, -279, -277, -273, -272, -271, -270, -269, -266, -264, -263, -261, -260, -259, -254, -253, -252, -249, -247, -245, -244, -242, -238, -236, -234, -228, -227, -222, -219, -218, -217, -215, -212, -211, -208, -204, -203, -200, -197, -196, -191, -189, -183, -182, -181, -180, -174, -166, -162, -161, -160, -159, -157, -147, -143, -142, -141, -139, -138, -136, -135, -130, -126, -125, -124, -122, -120, -119, -117, -116, -115, -104, -103, -101, -100, -99, -96, -95, -92, -88, -87, -78, -77, -74, -71, -69, -68, -66, -65, -63, -61, -58, -55, -54, -47, -45, -43, -42, -38, -37, -36, -35, -34, -33, -32, -31, -30, -29, -28, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 6, 12, 13, 14, 15, 17, 18, 19, 22, 23, 24, 25, 26, 29, 30, 32, 33, 35, 39, 40, 41, 45, 48, 49, 54, 57, 63, 65, 66, 69, 70, 75, 76, 79, 80, 83, 84, 87, 88, 91, 93, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 110, 111, 113, 114, 115, 116, 117, 119, 121, 124, 127, 129, 130, 132, 133, 135, 137, 138, 139, 140, 146, 147, 148, 150, 151, 152, 155, 157, 163, 164, 169, 173, 174, 176, 177, 179, 181, 183, 185, 188, 192, 193, 196, 200, 201, 202, 204, 206, 207, 209, 210, 213, 215, 216, 219, 220, 221, 222, 223, 224, 227, 228, 229, 230, 231, 232, 236, 238, 240, 241, 243, 246, 247, 250, 254, 255, 257, 262, 268, 269, 272, 276, 278, 288, 289, 290, 291, 297, 299, 300, 301, 303, 307, 309, 310, 312, 314, 317, 320, 322, 330, 331, 333, 336, 340, 341, 342, 343, 347, 348, 350, 352, 355, 357, 358, 361, 363, 365, 367, 368, 369, 373, 377, 378, 382, 385, 388, 389, 392, 396, 397, 399, 403, 404, 405, 406, 408, 411, 412, 413, 414, 419, 420, 421, 422, 423, 425, 426, 427, 428, 429, 430, 431, 434, 435, 440, 442, 445, 446, 447, 449, 450, 452, 453, 454, 458, 461, 464, 465, 466, 469, 470, 471, 475, 480, 484, 485, 486, 487, 489, 490, 491, 492, 493, 496, 500, 504, 505, 508, 509, 512, 513, 514, 517, 518, 519, 523, 525, 526, 528, 531, 536, 538, 539, 541, 542, 545, 546, 547, 548, 549, 552, 554, 557, 559], \"length_arg1\": 535, \"s\": \"RRRS S !L!eSSSS!TTT+!TTTUU!!UU!UU\\\"U\\\"\\\"\\\"VVV\\\"\\\"\\\"VK#WW##gfW##X##6$$X$XX@$XXP%%%YY%+YY%&ZZ)%ZZ&#Z&[&[[[[\\\\'\\\\\\\\]\\\\\\\\]''']]']]]^^(^R^((^))^)^^*^_*_L____**;**_``*```++`+`+[+++``,m,,`,,-aa@aa[a-arb-b--b(vzbb-.b.6.ccc.cKcc.cc//c/cc//dddddd/0deeeee000e0f0ff0f01ff11f1<1gg;g12R2g22233gg33g333g3g445555566ghhh66799h9hhh9h999iEii/iYi::i::j:jvv:;;;;jj<j<<k===kkkk===ll=l=l>>l>ll0>l>m>m@mmm??0m^,?nn???n?sn@@oo@DobAAooAo7AAppppBqC$qqqqCCCCqqqqrDrrrrrrrDbrsDDDEsEs9asssfttEtttEEEtEEtFFtuuLFuuuFFFvF0FGvGGGvvvvRwwwwxGHxHHHx+HIxxIexxIIyyyPCyyyII,yIyyIzIJzJJQJzKzzKz{KK{{{{{[K{K{KK{?{KLLLLLLLMMM>NNNNNOOOOOOOOPPPQQQQQQQRRR\"}}, {\"idx\": 2, \"outputs\": true, \"inputs\": {\"x\": [-7, -6, -2, 0, 4, 5, 7], \"length_arg1\": 1, \"s\": \"O!A{SeKv\"}}, {\"idx\": 3, \"outputs\": true, \"inputs\": {\"x\": [-63, -60, -59, -57, -55, -52, -50, -48, -39, -38, -37, -36, -34, -30, -27, -26, -25, -24, -23, -21, -19, -18, -17, -13, -12, -11, -10, -8, -7, -6, 1, 5, 7, 9, 10, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 28, 30, 31, 32, 34, 35, 41, 47, 48, 49, 54, 58, 59, 60, 61, 62], \"length_arg1\": 61, \"s\": \" OW##P%T'UW)X+X-YY]^_`bd/044e5egk7lm779:<m?D@ADnnpDEFIpNNOqqwxx\"}}, {\"idx\": 4, \"outputs\": true, \"inputs\": {\"x\": [-875, -871, -829, -803, -785, -783, -760, -740, -658, -650, -636, -608, -575, -564, -536, -486, -481, -471, -453, -430, -427, -405, -378, -365, -362, -357, -326, -301, -298, -277, -251, -240, -237, -236, -224, -219, -212, -189, -182, -169, -144, -132, -124, -107, -90, -88, -52, -30, -25, 14, 102, 105, 120, 137, 165, 183, 207, 238, 255, 262, 263, 333, 374, 392, 407, 414, 425, 504, 523, 549, 566, 570, 575, 584, 634, 652, 683, 685, 693, 696, 710, 713, 714, 716, 737, 786, 821, 833, 834, 839, 850], \"length_arg1\": 19, \"s\": \"1>C>DmJh5\\\"Ju,\\\"Q8zJ_u-O-VfnVTZ?W'm=jq.\\\\l&%m$cU.nqv2\\\\**.o\\\">]FZ5owil>l*kIM wcLd<*UX`\\\"_u'DC3R$8wr;jT]CW\\\"F$QKeRPMzZY'U42&Km dRr8b$T3x)w2v,_k(dR,F:`=c$MjE_Kf/KCXFg^ueiO.U%S8_](:GF;`2`^O%eAqSRAHW0dYg5!u<ZV@usa`-<<ET@xZ)&<6=ogIhp9jJ/`$/_jEa-N$oZVT6#]^]x5u!$ Xk?g=TMwVGZqTU(OeH!Jbgz!9`%yxq(GN+@yD6RM1M#:geJpIPw1l{xxK!z'tXS5-S+vvE(nO:I_`l14Gz@U^.Ra73g!iH\\\\\\\"0{*>F@K'q>2HgCc^:baOy[,9vJtFWPAed2w_7zHLl&.x^:XLwwtS+Ocr#, *qXmo9Sp,Z>{l&ElT>RNZ:.5f6,yedMqH8?jA=_@oK;X\\\\pm>r0Il0+k\\\\,&'u*(S`]>u?(4M\\\\3=0 F<Jh?v`wz85A=?q3FUP<HiW[t0QB-Dx=e=ggmY29G4[HR!4i-*y@s$0)E'XPud6)gt(O[RWVf]ci,4.(: 8H[**k[g* T`z.Y2)Oq5`R8H$$joU/xfl*e4 \\\\z>*MS8wqj0(HwK?gvpuma{V5inBL\\\",39`%*r$uPi=%:s!<?{FCb-zILUAT?kdy\\\"B;sfYu#DoVp-'+]z:/c8eo2v&UAoeXEe:w#JZHKR\\\\3Xmxf'9jlHli*PTR-y`sdqRnv=;E$s]m!%I*`<*&.5N)wrI\\\"C=4^9RP5'9[5\\\"uG(4YU{3_aPHffi<E*+nVYQq37UP(P#wU9;p0Si.vyM1e?tXWZ9dRho1i!(we-<waQrvITH6vkTCG2 9hxMvtZ8QdR%WQ[B^0X1B;Vm&g/o=;YlD5[`Oh\"}}, {\"idx\": 5, \"outputs\": false, \"inputs\": {\"x\": [-7, -6, -2, 0, 4, 5, 7], \"length_arg1\": 20, \"s\": \"Dynamic programming solves this classic job-interview puzzle!!!\"}}, {\"idx\": 6, \"outputs\": false, \"inputs\": {\"x\": [-7, -6, -2, 0, 4, 5, 7], \"length_arg1\": 61, \"s\": \"Dynamic programming solves this classic job-interview puzzle!!!\"}}, {\"idx\": 7, \"outputs\": false, \"inputs\": {\"x\": [-63, -60, -59, -57, -55, -52, -50, -48, -39, -38, -37, -36, -34, -30, -27, -26, -25, -24, -23, -21, -19, -18, -17, -13, -12, -11, -10, -8, -7, -6, 1, 5, 7, 9, 10, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 28, 30, 31, 32, 34, 35, 41, 47, 48, 49, 54, 58, 59, 60, 61, 62], \"length_arg1\": 61, \"s\": \"Dynamic programming solves this classic job-interview puzzle!!!\"}}, {\"idx\": 8, \"outputs\": false, \"inputs\": {\"x\": [-63, -60, -59, -57, -55, -52, -50, -48, -39, -38, -37, -36, -34, -30, -27, -26, -25, -24, -23, -21, -19, -18, -17, -13, -12, -11, -10, -8, -7, -6, 1, 5, 7, 9, 10, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 28, 30, 31, 32, 34, 35, 41, 47, 48, 49, 54, 58, 59, 60, 61, 62], \"length_arg1\": 20, \"s\": \"Dynamic programming solves this classic job-interview puzzle!!!\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find the indices of the longest substring with characters in sorted order\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> x, int length_arg1, string s, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(x, length_arg1, s), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({-56, -44, -37, -32, -24, -10, -3, -2, -1, 0, 3, 6, 11, 14, 15, 17, 21, 25, 30, 35, 36, 46, 49, 52, 56, 57}, 20, \"Dynamic programming solves this classic job-interview puzzle!!!\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({-594, -593, -591, -590, -588, -582, -577, -571, -570, -567, -564, -562, -561, -560, -556, -555, -554, -551, -548, -547, -543, -542, -540, -539, -537, -536, -534, -530, -526, -525, -524, -521, -517, -512, -509, -506, -504, -498, -491, -490, -489, -486, -480, -476, -475, -473, -472, -470, -467, -464, -457, -456, -454, -453, -449, -445, -444, -442, -440, -438, -437, -436, -433, -431, -430, -428, -427, -426, -418, -414, -412, -411, -404, -403, -401, -399, -395, -390, -387, -386, -384, -381, -380, -373, -372, -365, -364, -363, -361, -359, -356, -354, -353, -350, -349, -347, -345, -340, -339, -337, -335, -334, -333, -332, -331, -328, -327, -325, -324, -323, -321, -319, -318, -317, -316, -315, -314, -313, -312, -311, -306, -305, -304, -303, -302, -300, -296, -294, -293, -292, -283, -282, -280, -279, -277, -273, -272, -271, -270, -269, -266, -264, -263, -261, -260, -259, -254, -253, -252, -249, -247, -245, -244, -242, -238, -236, -234, -228, -227, -222, -219, -218, -217, -215, -212, -211, -208, -204, -203, -200, -197, -196, -191, -189, -183, -182, -181, -180, -174, -166, -162, -161, -160, -159, -157, -147, -143, -142, -141, -139, -138, -136, -135, -130, -126, -125, -124, -122, -120, -119, -117, -116, -115, -104, -103, -101, -100, -99, -96, -95, -92, -88, -87, -78, -77, -74, -71, -69, -68, -66, -65, -63, -61, -58, -55, -54, -47, -45, -43, -42, -38, -37, -36, -35, -34, -33, -32, -31, -30, -29, -28, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 6, 12, 13, 14, 15, 17, 18, 19, 22, 23, 24, 25, 26, 29, 30, 32, 33, 35, 39, 40, 41, 45, 48, 49, 54, 57, 63, 65, 66, 69, 70, 75, 76, 79, 80, 83, 84, 87, 88, 91, 93, 95, 96, 97, 98, 99, 101, 102, 104, 105, 106, 110, 111, 113, 114, 115, 116, 117, 119, 121, 124, 127, 129, 130, 132, 133, 135, 137, 138, 139, 140, 146, 147, 148, 150, 151, 152, 155, 157, 163, 164, 169, 173, 174, 176, 177, 179, 181, 183, 185, 188, 192, 193, 196, 200, 201, 202, 204, 206, 207, 209, 210, 213, 215, 216, 219, 220, 221, 222, 223, 224, 227, 228, 229, 230, 231, 232, 236, 238, 240, 241, 243, 246, 247, 250, 254, 255, 257, 262, 268, 269, 272, 276, 278, 288, 289, 290, 291, 297, 299, 300, 301, 303, 307, 309, 310, 312, 314, 317, 320, 322, 330, 331, 333, 336, 340, 341, 342, 343, 347, 348, 350, 352, 355, 357, 358, 361, 363, 365, 367, 368, 369, 373, 377, 378, 382, 385, 388, 389, 392, 396, 397, 399, 403, 404, 405, 406, 408, 411, 412, 413, 414, 419, 420, 421, 422, 423, 425, 426, 427, 428, 429, 430, 431, 434, 435, 440, 442, 445, 446, 447, 449, 450, 452, 453, 454, 458, 461, 464, 465, 466, 469, 470, 471, 475, 480, 484, 485, 486, 487, 489, 490, 491, 492, 493, 496, 500, 504, 505, 508, 509, 512, 513, 514, 517, 518, 519, 523, 525, 526, 528, 531, 536, 538, 539, 541, 542, 545, 546, 547, 548, 549, 552, 554, 557, 559}, 535, \"RRRS S !L!eSSSS!TTT+!TTTUU!!UU!UU\\\"U\\\"\\\"\\\"VVV\\\"\\\"\\\"VK#WW##gfW##X##6$$X$XX@$XXP%%%YY%+YY%&ZZ)%ZZ&#Z&[&[[[[\\\\'\\\\\\\\]\\\\\\\\]''']]']]]^^(^R^((^))^)^^*^_*_L____**;**_``*```++`+`+[+++``,m,,`,,-aa@aa[a-arb-b--b(vzbb-.b.6.ccc.cKcc.cc//c/cc//dddddd/0deeeee000e0f0ff0f01ff11f1<1gg;g12R2g22233gg33g333g3g445555566ghhh66799h9hhh9h999iEii/iYi::i::j:jvv:;;;;jj<j<<k===kkkk===ll=l=l>>l>ll0>l>m>m@mmm??0m^,?nn???n?sn@@oo@DobAAooAo7AAppppBqC$qqqqCCCCqqqqrDrrrrrrrDbrsDDDEsEs9asssfttEtttEEEtEEtFFtuuLFuuuFFFvF0FGvGGGvvvvRwwwwxGHxHHHx+HIxxIexxIIyyyPCyyyII,yIyyIzIJzJJQJzKzzKz{KK{{{{{[K{K{KK{?{KLLLLLLLMMM>NNNNNOOOOOOOOPPPQQQQQQQRRR\", true); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({-7, -6, -2, 0, 4, 5, 7}, 1, \"O!A{SeKv\", true); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({-63, -60, -59, -57, -55, -52, -50, -48, -39, -38, -37, -36, -34, -30, -27, -26, -25, -24, -23, -21, -19, -18, -17, -13, -12, -11, -10, -8, -7, -6, 1, 5, 7, 9, 10, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 28, 30, 31, 32, 34, 35, 41, 47, 48, 49, 54, 58, 59, 60, 61, 62}, 61, \" OW##P%T'UW)X+X-YY]^_`bd/044e5egk7lm779:<m?D@ADnnpDEFIpNNOqqwxx\", true); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({-875, -871, -829, -803, -785, -783, -760, -740, -658, -650, -636, -608, -575, -564, -536, -486, -481, -471, -453, -430, -427, -405, -378, -365, -362, -357, -326, -301, -298, -277, -251, -240, -237, -236, -224, -219, -212, -189, -182, -169, -144, -132, -124, -107, -90, -88, -52, -30, -25, 14, 102, 105, 120, 137, 165, 183, 207, 238, 255, 262, 263, 333, 374, 392, 407, 414, 425, 504, 523, 549, 566, 570, 575, 584, 634, 652, 683, 685, 693, 696, 710, 713, 714, 716, 737, 786, 821, 833, 834, 839, 850}, 19, \"1>C>DmJh5\\\"Ju,\\\"Q8zJ_u-O-VfnVTZ?W'm=jq.\\\\l&%m$cU.nqv2\\\\**.o\\\">]FZ5owil>l*kIM wcLd<*UX`\\\"_u'DC3R$8wr;jT]CW\\\"F$QKeRPMzZY'U42&Km dRr8b$T3x)w2v,_k(dR,F:`=c$MjE_Kf/KCXFg^ueiO.U%S8_](:GF;`2`^O%eAqSRAHW0dYg5!u<ZV@usa`-<<ET@xZ)&<6=ogIhp9jJ/`$/_jEa-N$oZVT6#]^]x5u!$ Xk?g=TMwVGZqTU(OeH!Jbgz!9`%yxq(GN+@yD6RM1M#:geJpIPw1l{xxK!z'tXS5-S+vvE(nO:I_`l14Gz@U^.Ra73g!iH\\\\\\\"0{*>F@K'q>2HgCc^:baOy[,9vJtFWPAed2w_7zHLl&.x^:XLwwtS+Ocr#, *qXmo9Sp,Z>{l&ElT>RNZ:.5f6,yedMqH8?jA=_@oK;X\\\\pm>r0Il0+k\\\\,&'u*(S`]>u?(4M\\\\3=0 F<Jh?v`wz85A=?q3FUP<HiW[t0QB-Dx=e=ggmY29G4[HR!4i-*y@s$0)E'XPud6)gt(O[RWVf]ci,4.(: 8H[**k[g* T`z.Y2)Oq5`R8H$$joU/xfl*e4 \\\\z>*MS8wqj0(HwK?gvpuma{V5inBL\\\",39`%*r$uPi=%:s!<?{FCb-zILUAT?kdy\\\"B;sfYu#DoVp-'+]z:/c8eo2v&UAoeXEe:w#JZHKR\\\\3Xmxf'9jlHli*PTR-y`sdqRnv=;E$s]m!%I*`<*&.5N)wrI\\\"C=4^9RP5'9[5\\\"uG(4YU{3_aPHffi<E*+nVYQq37UP(P#wU9;p0Si.vyM1e?tXWZ9dRho1i!(we-<waQrvITH6vkTCG2 9hxMvtZ8QdR%WQ[B^0X1B;Vm&g/o=;YlD5[`Oh\", true); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({-7, -6, -2, 0, 4, 5, 7}, 20, \"Dynamic programming solves this classic job-interview puzzle!!!\", false); \n cout << \"TEST-\" << 5 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({-7, -6, -2, 0, 4, 5, 7}, 61, \"Dynamic programming solves this classic job-interview puzzle!!!\", false); \n cout << \"TEST-\" << 6 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({-63, -60, -59, -57, -55, -52, -50, -48, -39, -38, -37, -36, -34, -30, -27, -26, -25, -24, -23, -21, -19, -18, -17, -13, -12, -11, -10, -8, -7, -6, 1, 5, 7, 9, 10, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 28, 30, 31, 32, 34, 35, 41, 47, 48, 49, 54, 58, 59, 60, 61, 62}, 61, \"Dynamic programming solves this classic job-interview puzzle!!!\", false); \n cout << \"TEST-\" << 7 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({-63, -60, -59, -57, -55, -52, -50, -48, -39, -38, -37, -36, -34, -30, -27, -26, -25, -24, -23, -21, -19, -18, -17, -13, -12, -11, -10, -8, -7, -6, 1, 5, 7, 9, 10, 12, 14, 16, 17, 18, 19, 20, 21, 22, 23, 28, 30, 31, 32, 34, 35, 41, 47, 48, 49, 54, 58, 59, 60, 61, 62}, 20, \"Dynamic programming solves this classic job-interview puzzle!!!\", false); \n cout << \"TEST-\" << 8 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4", "5", "6", "7", "8" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
33
TP3/classic_puzzles.Quine
C++
Verifies that the inputs satisfy the problem: Find a string that when evaluated as a C++ expression is that string itself.
/** * Verifies that the inputs satisfy the problem: * Find a string that when evaluated as a C++ expression is that string itself. */ bool sat(string quine) {
bool sat(string quine) {
[ "quine" ]
def sat(quine: str): return eval(quine) == quine
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"quine\": \"(lambda x: f'({x})({chr(34)}{x}{chr(34)})')(\\\"lambda x: f'({x})({chr(34)}{x}{chr(34)})'\\\")\"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"quine\": \"(lambda x: chr(34))\"}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"quine\": \"(lambda x: 'Hello World')\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a string that when evaluated as a Python expression is that string itself.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string quine, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(quine), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\"(lambda x: f'({x})({chr(34)}{x}{chr(34)})')(\\\"lambda x: f'({x})({chr(34)}{x}{chr(34)})'\\\")\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"(lambda x: chr(34))\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"(lambda x: 'Hello World')\", false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
34
TP3/classic_puzzles.RevQuine
C++
Verifies that the inputs satisfy the problem: Find a string that, when reversed and evaluated gives you back that same string.
/** * Verifies that the inputs satisfy the problem: * Find a string that, when reversed and evaluated gives you back that same string. */ bool sat(string rev_quine) {
bool sat(string rev_quine) {
[ "rev_quine" ]
def sat(rev_quine: str): return eval(rev_quine[::-1]) == rev_quine
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"rev_quine\": \"eniuq_ver\"}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"rev_quine\": \"'no'\"}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"rev_quine\": \"'yessir'\"}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find a string that, when reversed and evaluated gives you back that same string.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(string rev_quine, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(rev_quine), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(\"eniuq_ver\", true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"'no'\", false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(\"'yessir'\", false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
35
TP3/classic_puzzles.BooleanPythagoreanTriples
C++
Verifies that the inputs satisfy the problem: Color the first n integers with one of two colors so that there is no monochromatic Pythagorean triple. A monochromatic Pythagorean triple is a triple of numbers i, j, k such that i^2 + j^2 = k^2 that are all assigned the same color. The input, colors, is vector of 0\/1 colors of length >= n.
/** * Verifies that the inputs satisfy the problem: * Color the first n integers with one of two colors so that there is no monochromatic Pythagorean triple. * A monochromatic Pythagorean triple is a triple of numbers i, j, k such that i^2 + j^2 = k^2 that * are all assigned the same color. The input, colors, is vector of 0\\/1 colors of length >= n. */ bool sat(vector<int> colors, int n) {
bool sat(vector<int> colors, int n) {
[ "colors", "n" ]
def sat(colors: List[int], n): if not (set(colors) <= {0, 1} and len(colors) >= n): return False squares = {i ** 2: colors[i] for i in range(1, len(colors))} return not any((c == d == squares.get(i + j) for (i, c) in squares.items() for (j, d) in squares.items()))
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"colors\": [1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0], \"n\": 100}}, {\"idx\": 1, \"outputs\": true, \"inputs\": {\"colors\": [], \"n\": 0}}, {\"idx\": 2, \"outputs\": true, \"inputs\": {\"colors\": [1], \"n\": 1}}, {\"idx\": 3, \"outputs\": false, \"inputs\": {\"colors\": [], \"n\": 1}}, {\"idx\": 4, \"outputs\": false, \"inputs\": {\"colors\": [1], \"n\": 100}}, {\"idx\": 5, \"outputs\": false, \"inputs\": {\"colors\": [], \"n\": 100}}, {\"idx\": 6, \"outputs\": false, \"inputs\": {\"colors\": [], \"n\": 100}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Color the first n integers with one of two colors so that there is no monochromatic Pythagorean triple.\n// A monochromatic Pythagorean triple is a triple of numbers i, j, k such that i^2 + j^2 = k^2 that\n// are all assigned the same color. The input, colors, is a list of 0/1 colors of length >= n.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> colors, int n, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(colors, n), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0}, 100, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 0, true); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({1}, 1, true); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 1, false); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({1}, 100, false); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 100, false); \n cout << \"TEST-\" << 5 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 100, false); \n cout << \"TEST-\" << 6 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4", "5", "6" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
36
TP3/classic_puzzles.ClockAngle
C++
Verifies that the inputs satisfy the problem: Find clock hands = [hour, min] such that the angle is target_angle degrees.
/** * Verifies that the inputs satisfy the problem: * Find clock hands = [hour, min] such that the angle is target_angle degrees. */ bool sat(vector<int> hands, int target_angle) {
bool sat(vector<int> hands, int target_angle) {
[ "hands", "target_angle" ]
def sat(hands: List[int], target_angle): (h, m) = hands if not (0 < h <= 12 and 0 <= m < 60): return False hour_angle = 30 * h + m / 2 minute_angle = 6 * m return abs(hour_angle - minute_angle) in [target_angle, 360 - target_angle]
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"hands\": [4, 30], \"target_angle\": 45}}, {\"idx\": 1, \"outputs\": true, \"inputs\": {\"hands\": [2, 18], \"target_angle\": 39}}, {\"idx\": 2, \"outputs\": true, \"inputs\": {\"hands\": [4, 46], \"target_angle\": 133}}, {\"idx\": 3, \"outputs\": true, \"inputs\": {\"hands\": [2, 36], \"target_angle\": 138}}, {\"idx\": 4, \"outputs\": true, \"inputs\": {\"hands\": [3, 4], \"target_angle\": 68}}, {\"idx\": 5, \"outputs\": false, \"inputs\": {\"hands\": [3, 4], \"target_angle\": 39}}, {\"idx\": 6, \"outputs\": false, \"inputs\": {\"hands\": [4, 46], \"target_angle\": 68}}, {\"idx\": 7, \"outputs\": false, \"inputs\": {\"hands\": [3, 4], \"target_angle\": 133}}, {\"idx\": 8, \"outputs\": false, \"inputs\": {\"hands\": [2, 36], \"target_angle\": 45}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find clock hands = [hour, min] such that the angle is target_angle degrees.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<int> hands, int target_angle, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(hands, target_angle), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({4, 30}, 45, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({2, 18}, 39, true); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({4, 46}, 133, true); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({2, 36}, 138, true); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({3, 4}, 68, true); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({3, 4}, 39, false); \n cout << \"TEST-\" << 5 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({4, 46}, 68, false); \n cout << \"TEST-\" << 6 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({3, 4}, 133, false); \n cout << \"TEST-\" << 7 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({2, 36}, 45, false); \n cout << \"TEST-\" << 8 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4", "5", "6", "7", "8" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
37
TP3/classic_puzzles.MonkeyAndCoconuts
C++
Verifies that the inputs satisfy the problem: Find the number of coconuts to solve the following riddle: There is a pile of coconuts, owned by five men. One man divides the pile into five equal piles, giving the one left over coconut to a passing monkey, and takes away his own share. The second man then repeats the procedure, dividing the remaining pile into five and taking away his share, as do the third, fourth, and fifth, each of them finding one coconut left over when dividing the pile by five, and giving it to a monkey. Finally, the group divide the remaining coconuts into five equal piles: this time no coconuts are left over. How many coconuts were there in the original pile? Quoted from https:\/\/en.wikipedia.org\/wiki\/The_monkey_and_the_coconuts
/** * Verifies that the inputs satisfy the problem: * Find the number of coconuts to solve the following riddle: * There is a pile of coconuts, owned by five men. One man divides the pile into five equal piles, giving the * one left over coconut to a passing monkey, and takes away his own share. The second man then repeats the * procedure, dividing the remaining pile into five and taking away his share, as do the third, fourth, and * fifth, each of them finding one coconut left over when dividing the pile by five, and giving it to a monkey. * Finally, the group divide the remaining coconuts into five equal piles: this time no coconuts are left over. * How many coconuts were there in the original pile? * Quoted from https:\\/\\/en.wikipedia.org\\/wiki\\/The_monkey_and_the_coconuts */ bool sat(int n) {
bool sat(int n) {
[ "n" ]
def sat(n: int): for i in range(5): if not n % 5 == 1: return False n -= 1 + (n - 1) // 5 return n > 0 and n % 5 == 1
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"n\": 15621}}, {\"idx\": 1, \"outputs\": false, \"inputs\": {\"n\": 4}}, {\"idx\": 2, \"outputs\": false, \"inputs\": {\"n\": 3}}, {\"idx\": 3, \"outputs\": false, \"inputs\": {\"n\": 1}}, {\"idx\": 4, \"outputs\": false, \"inputs\": {\"n\": 8}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find the number of coconuts to solve the following riddle:\n// There is a pile of coconuts, owned by five men. One man divides the pile into five equal piles, giving the\n// one left over coconut to a passing monkey, and takes away his own share. The second man then repeats the\n// procedure, dividing the remaining pile into five and taking away his share, as do the third, fourth, and\n// fifth, each of them finding one coconut left over when dividing the pile by five, and giving it to a monkey.\n// Finally, the group divide the remaining coconuts into five equal piles: this time no coconuts are left over.\n// How many coconuts were there in the original pile?\n// Quoted from https://en.wikipedia.org/wiki/The_monkey_and_the_coconuts\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(int n, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(n), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver(15621, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(4, false); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(3, false); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(1, false); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver(8, false); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }
38
TP3/classic_puzzles.No3Colinear
C++
Verifies that the inputs satisfy the problem: Find num_points points in an side x side grid such that no three points are collinear.
/** * Verifies that the inputs satisfy the problem: * Find num_points points in an side x side grid such that no three points are collinear. */ bool sat(vector<vector<int>> coords, int side, int num_points) {
bool sat(vector<vector<int>> coords, int side, int num_points) {
[ "coords", "side", "num_points" ]
def sat(coords: List[List[int]], side, num_points): for i1 in range(len(coords)): (x1, y1) = coords[i1] if not (0 <= x1 < side and 0 <= y1 < side): return False for i2 in range(i1): (x2, y2) = coords[i2] for i3 in range(i2): (x3, y3) = coords[i3] if not x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2) != 0: return False return len({(a, b) for (a, b) in coords}) == len(coords) >= num_points
{ "extension": "cpp", "test_list": "[{\"idx\": 0, \"outputs\": true, \"inputs\": {\"coords\": [[0, 4], [0, 5], [9, 4], [9, 5], [1, 2], [1, 7], [8, 2], [8, 7], [2, 1], [2, 8], [7, 1], [7, 8], [3, 3], [3, 6], [6, 3], [6, 6], [4, 0], [4, 9], [5, 0], [5, 9]], \"side\": 10, \"num_points\": 20}}, {\"idx\": 1, \"outputs\": true, \"inputs\": {\"coords\": [], \"side\": 0, \"num_points\": 0}}, {\"idx\": 2, \"outputs\": true, \"inputs\": {\"coords\": [[0, 0]], \"side\": 1, \"num_points\": 1}}, {\"idx\": 3, \"outputs\": true, \"inputs\": {\"coords\": [[0, 0], [0, 1], [1, 0], [1, 1]], \"side\": 2, \"num_points\": 4}}, {\"idx\": 4, \"outputs\": false, \"inputs\": {\"coords\": [], \"side\": 1, \"num_points\": 1}}, {\"idx\": 5, \"outputs\": false, \"inputs\": {\"coords\": [], \"side\": 2, \"num_points\": 1}}, {\"idx\": 6, \"outputs\": false, \"inputs\": {\"coords\": [], \"side\": 2, \"num_points\": 4}}, {\"idx\": 7, \"outputs\": false, \"inputs\": {\"coords\": [], \"side\": 1, \"num_points\": 4}}]", "entry_cls_name": "Solution", "test_code": "#include <algorithm>\n#include <assert.h>\n#include <cstdlib>\n#include <iostream>\n#include <map>\n#include <set>\n#include <string>\n#include <tuple> \n#include <unordered_map>\n#include <vector>\n#include <math.h>\n#include <cmath>\n#include <bits/stdc++.h>\n#include <numeric>\n#include <functional>\n\nusing namespace std;\n// Question Prompt (NOT what is passed to the model)\n// Verifies that the inputs satisfy the problem:\n// Find num_points points in an side x side grid such that no three points are collinear.\n//\n// SOLUTION CODE\n// ============================================\nPLACEHOLDER_CODE_BODY\n\n// TESTING CODE \n// ============================================\nbool validateSolution(bool actual, bool expected){\n return actual == expected;\n}\n\nstring driver(vector<vector<int>> coords, int side, int num_points, bool expected){\n try\n {\n if (validateSolution(PLACEHOLDER_FN_NAME(coords, side, num_points), expected)){\n return \"PASSED\";\n }\n return \"FAILED\";\n }\n catch (const std::overflow_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::runtime_error& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (const std::exception& exception_obj)\n {\n return typeid(exception_obj).name();\n }\n catch (...)\n {\n return \"UNK_ERROR\";\n }\n}\n\nint main() {\n string result = \"\";\n\n result = driver({{0, 4}, {0, 5}, {9, 4}, {9, 5}, {1, 2}, {1, 7}, {8, 2}, {8, 7}, {2, 1}, {2, 8}, {7, 1}, {7, 8}, {3, 3}, {3, 6}, {6, 3}, {6, 6}, {4, 0}, {4, 9}, {5, 0}, {5, 9}}, 10, 20, true); \n cout << \"TEST-\" << 0 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 0, 0, true); \n cout << \"TEST-\" << 1 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({{0, 0}}, 1, 1, true); \n cout << \"TEST-\" << 2 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({{0, 0}, {0, 1}, {1, 0}, {1, 1}}, 2, 4, true); \n cout << \"TEST-\" << 3 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 1, 1, false); \n cout << \"TEST-\" << 4 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 2, 1, false); \n cout << \"TEST-\" << 5 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 2, 4, false); \n cout << \"TEST-\" << 6 << \"...\"\n << result\n << \"\\n\";\n\n result = driver({}, 1, 4, false); \n cout << \"TEST-\" << 7 << \"...\"\n << result\n << \"\\n\";\n\n return 0;\n}", "entry_fn_name": "sat", "test_case_ids": [ "0", "1", "2", "3", "4", "5", "6", "7" ], "commands": [ [ "g++", "__FILENAME__", "-o", "main.exe" ], [ "./main.exe" ] ], "timeouts": [ 10, 10 ] }

Dataset Card for Translating Python Programming Puzzles (TP3)

How To Use This Dataset

To use this dataset, you can either use the original BabelCode Repo, or you can use the bc_eval Metric.

Dataset Summary

The Translating Python Programming Puzzles (TP3) dataset is created from the verification functions in the Python Programming Puzzles dataset (Schuster et al., 2021) to create this dataset. These functions are hand-crafted by the authors and are used to check if an answer satisfies the constraints of the puzzle. These puzzles range in difficulty from basic character checking to competitive programming problems.

Supported Tasks and Leaderboards

Languages

BC-TP3 supports:

  • C++
  • C#
  • Dart
  • Go
  • Haskell
  • Java
  • Javascript
  • Julia
  • Kotlin
  • Lua
  • PHP
  • R
  • Rust
  • Scala
  • TypeScript

Dataset Structure

>>> from datasets import load_dataset
>>> load_dataset("gabeorlanski/tp3")
DatasetDict({
    test: Dataset({
        features: ['qid', 'title', 'language', 'text', 'signature_with_docstring', 'signature', 'arguments', 'source', 'question_info'],
        num_rows: 5920
    })
})

Data Fields

  • qid: The question ID used for running tests.
  • title: The title of the question.
  • language: The programming language of the example.
  • text: The description of the problem.
  • signature: The signature for the problem.
  • signature_with_docstring: The signature with the adequately formatted docstring for the given problem.
  • arguments: The arguments of the problem.
  • source: The source solution in Python.
  • question_info: The dict of information used for executing predictions. It has the keys:
    • test_code: The raw testing script used in the language. If you want to use this, replace PLACEHOLDER_FN_NAME (and PLACEHOLDER_CLS_NAME if needed) with the corresponding entry points. Next, replace PLACEHOLDER_CODE_BODY with the postprocessed prediction.
    • test_list: The raw json line of the list of tests for the problem. To load them, use json.loads
    • test_case_ids: The list of test case ids for the problem. These are used to determine if a prediction passes or not.
    • entry_fn_name: The function's name to use an entry point.
    • entry_cls_name: The class name to use an entry point.
    • commands: The commands used to execute the prediction. Includes a __FILENAME__ hole that is replaced with the filename.
    • timeouts: The default timeouts for each command.
    • extension: The extension for the prediction file.

NOTE: If you want to use a different function name (or class name for languages that require class names) for the prediction, you must update the entry_fn_name and entry_cls_name accordingly. For example, if you have the original question with entry_fn_name of add, but want to change it to f, you must update ds["question_info"]["entry_fn_name"] to f:

>>> from datasets import load_dataset
>>> ds = load_dataset("gabeorlanski/bc-mbpp")['test']
>>> # The original entry_fn_name
>>> ds[0]['question_info']['entry_fn_name']
removeOcc
>>> # You MUST update the corresponding entry_fn_name
>>> ds[0]['question_info']['entry_fn_name'] = 'f'
>>> ds[0]['question_info']['entry_fn_name']
f

Dataset Creation

See section 2 and section 4.4 of the BabelCode Paper to learn more about how the datasets are translated.

For information on how the original P3 dataset was collected, please see Programming Puzzles paper.

Dataset Curators

Google Research

Licensing Information

CC-BY-4.0

Citation Information

@article{orlanski2023measuring,
  title={Measuring The Impact Of Programming Language Distribution},
  author={Orlanski, Gabriel and Xiao, Kefan and Garcia, Xavier and Hui, Jeffrey and Howland, Joshua and Malmaud, Jonathan and Austin, Jacob and Singh, Rishah and Catasta, Michele},
  journal={arXiv preprint arXiv:2302.01973},
  year={2023}
}
@inproceedings{
    schuster2021programming,
    title={Programming Puzzles},
    author={Tal Schuster and Ashwin Kalyan and Alex Polozov and Adam Tauman Kalai},
    booktitle={Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track},
    year={2021},
    url={https://arxiv.org/abs/2106.05784}
}
Downloads last month
93
Edit dataset card