Dataset Viewer
Auto-converted to Parquet Duplicate
stop_tokens
sequencelengths
1
1
prompt
stringlengths
299
1.59k
prompt_terminology
stringclasses
1 value
doctests
stringclasses
1 value
name
stringlengths
15
44
tests
stringlengths
190
4.93k
original
stringlengths
130
159
language
stringclasses
1 value
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // リストnumbersの中に、与えられたthresholdより近い2つの数値が存在するか判定する // >>> HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f})), (0.5f)) // (false) // >>> HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.8f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.3f)) // (true) public static bool HasCloseElements(List<float> numbers, float threshold) {
reworded
transform
HumanEval_0_has_close_elements
} public static void Main(string[] args) { Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.3f)) == (true)); Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f})), (0.05f)) == (false)); Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.95f)) == (true)); Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f})), (0.8f)) == (false)); Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f})), (0.1f)) == (true)); Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (1.0f)) == (true)); Debug.Assert(HasCloseElements((new List<float>(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f})), (0.5f)) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_0_has_close_elements.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // この関数への入力は、入れ子になった括弧が複数含まれる文字列である。 // あなたの目的は、これらの括弧を別々の文字列に分割し、そのリストを返すことである。 // 分離された括弧はバランスがとれ、つまり、開いた括弧はそれぞれ適切に閉じられていて、 // 互いに入れ子になっていない。引数の文字列内の空白は無視せよ。 // >>> SeparateParenGroups(("( ) (( )) (( )( ))")) // (new List<string>(new string[]{(string)"()", (string)"(())", (string)"(()())"})) public static List<string> SeparateParenGroups(string paren_string) {
reworded
transform
HumanEval_1_separate_paren_groups
} public static void Main(string[] args) { Debug.Assert(SeparateParenGroups(("(()()) ((())) () ((())()())")).Equals((new List<string>(new string[]{(string)"(()())", (string)"((()))", (string)"()", (string)"((())()())"})))); Debug.Assert(SeparateParenGroups(("() (()) ((())) (((())))")).Equals((new List<string>(new string[]{(string)"()", (string)"(())", (string)"((()))", (string)"(((())))"})))); Debug.Assert(SeparateParenGroups(("(()(())((())))")).Equals((new List<string>(new string[]{(string)"(()(())((())))"})))); Debug.Assert(SeparateParenGroups(("( ) (( )) (( )( ))")).Equals((new List<string>(new string[]{(string)"()", (string)"(())", (string)"(()())"})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_1_separate_paren_groups.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 正の浮動小数点数が与えられると、それを整数部(与えられた数より小さい最大の整数) // と小数部(常に1より小さい残余部分)に分解することができる。 // 関数は、数値の小数部を返す。 // >>> TruncateNumber((3.5f)) // (0.5f) public static float TruncateNumber(float number) {
reworded
transform
HumanEval_2_truncate_number
} public static void Main(string[] args) { Debug.Assert(TruncateNumber((3.5f)) == (0.5f)); Debug.Assert(TruncateNumber((1.25f)) == (0.25f)); Debug.Assert(TruncateNumber((123.0f)) == (0.0f)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_2_truncate_number.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 銀行口座に対する入出金操作のリストが与えられます。あなたのタスクは、残高ゼロから // 始まて、口座の残高がゼロ未満になったかどうかを検出し、その時点で関数がtrueを // 返すようにすることです。そうでなければfalseを返すようにしてください。 // >>> BelowZero((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) // (false) // >>> BelowZero((new List<long>(new long[]{(long)1L, (long)2L, (long)-4L, (long)5L}))) // (true) public static bool BelowZero(List<long> operations) {
reworded
transform
HumanEval_3_below_zero
} public static void Main(string[] args) { Debug.Assert(BelowZero((new List<long>())) == (false)); Debug.Assert(BelowZero((new List<long>(new long[]{(long)1L, (long)2L, (long)-3L, (long)1L, (long)2L, (long)-3L}))) == (false)); Debug.Assert(BelowZero((new List<long>(new long[]{(long)1L, (long)2L, (long)-4L, (long)5L, (long)6L}))) == (true)); Debug.Assert(BelowZero((new List<long>(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (false)); Debug.Assert(BelowZero((new List<long>(new long[]{(long)1L, (long)-1L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-5L}))) == (true)); Debug.Assert(BelowZero((new List<long>(new long[]{(long)1L, (long)-2L, (long)2L, (long)-2L, (long)5L, (long)-5L, (long)4L, (long)-4L}))) == (true)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_3_below_zero.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 第一引数の数値リストに対して、このデータセットの平均値を中心とした平均絶対偏差(MAD)を計算する。 // 平均絶対偏差(MAD)とは、各要素と中心点(この場合は平均値)との差の絶対値の平均である: // MAD = 平均|x - x_mean| // >>> MeanAbsoluteDeviation((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f}))) // (1.0f) public static float MeanAbsoluteDeviation(List<float> numbers) {
reworded
transform
HumanEval_4_mean_absolute_deviation
} public static void Main(string[] args) { Debug.Assert(MeanAbsoluteDeviation((new List<float>(new float[]{(float)1.0f, (float)2.0f}))) == (0.5f)); Debug.Assert(MeanAbsoluteDeviation((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f}))) == (1.0f)); Debug.Assert(MeanAbsoluteDeviation((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))) == (1.2f)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_4_mean_absolute_deviation.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 数値リスト numbers 中の全ての連続する二要素の間に、'delimeterの値を挿入する // >>> Intersperse((new List<long>()), (4L)) // (new List<long>()) // >>> Intersperse((new List<long>(new long[]{(long)1L, (long)2L, (long)3L})), (4L)) // (new List<long>(new long[]{(long)1L, (long)4L, (long)2L, (long)4L, (long)3L})) public static List<long> Intersperse(List<long> numbers, long delimeter) {
reworded
transform
HumanEval_5_intersperse
} public static void Main(string[] args) { Debug.Assert(Intersperse((new List<long>()), (7L)).Equals((new List<long>()))); Debug.Assert(Intersperse((new List<long>(new long[]{(long)5L, (long)6L, (long)3L, (long)2L})), (8L)).Equals((new List<long>(new long[]{(long)5L, (long)8L, (long)6L, (long)8L, (long)3L, (long)8L, (long)2L})))); Debug.Assert(Intersperse((new List<long>(new long[]{(long)2L, (long)2L, (long)2L})), (2L)).Equals((new List<long>(new long[]{(long)2L, (long)2L, (long)2L, (long)2L, (long)2L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_5_intersperse.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // この関数の入力は、空白で区切られた複数の入れ子になった括弧のグループを表す文字列です。 // 各グループについて、括弧の最も深い入れ子のレベルを出力します。 // 例えば、'(()())'は最大で2レベルの入れ子になっていますが、'((()))'は3レベルです。 // >>> ParseNestedParens(("(()()) ((())) () ((())()())")) // (new List<long>(new long[]{(long)2L, (long)3L, (long)1L, (long)3L})) public static List<long> ParseNestedParens(string paren_string) {
reworded
transform
HumanEval_6_parse_nested_parens
} public static void Main(string[] args) { Debug.Assert(ParseNestedParens(("(()()) ((())) () ((())()())")).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)1L, (long)3L})))); Debug.Assert(ParseNestedParens(("() (()) ((())) (((())))")).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))); Debug.Assert(ParseNestedParens(("(()(())((())))")).Equals((new List<long>(new long[]{(long)4L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_6_parse_nested_parens.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列リストstringsを、与えれた部分文字列substringを含むものだけにフィルタする // >>> FilterBySubstring((new List<string>()), ("a")) // (new List<string>()) // >>> FilterBySubstring((new List<string>(new string[]{(string)"abc", (string)"bacd", (string)"cde", (string)"array"})), ("a")) // (new List<string>(new string[]{(string)"abc", (string)"bacd", (string)"array"})) public static List<string> FilterBySubstring(List<string> strings, string substring) {
reworded
transform
HumanEval_7_filter_by_substring
} public static void Main(string[] args) { Debug.Assert(FilterBySubstring((new List<string>()), ("john")).Equals((new List<string>()))); Debug.Assert(FilterBySubstring((new List<string>(new string[]{(string)"xxx", (string)"asd", (string)"xxy", (string)"john doe", (string)"xxxAAA", (string)"xxx"})), ("xxx")).Equals((new List<string>(new string[]{(string)"xxx", (string)"xxxAAA", (string)"xxx"})))); Debug.Assert(FilterBySubstring((new List<string>(new string[]{(string)"xxx", (string)"asd", (string)"aaaxxy", (string)"john doe", (string)"xxxAAA", (string)"xxx"})), ("xx")).Equals((new List<string>(new string[]{(string)"xxx", (string)"aaaxxy", (string)"xxxAAA", (string)"xxx"})))); Debug.Assert(FilterBySubstring((new List<string>(new string[]{(string)"grunt", (string)"trumpet", (string)"prune", (string)"gruesome"})), ("run")).Equals((new List<string>(new string[]{(string)"grunt", (string)"prune"})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_7_filter_by_substring.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた整数リストに対して、リスト内のすべての整数の和と積からなるタプルを返す。 // ただし、空の和は0、空の積は1とする。 // >>> SumProduct((new List<long>())) // (Tuple.Create(0L, 1L)) // >>> SumProduct((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))) // (Tuple.Create(10L, 24L)) public static Tuple<long, long> SumProduct(List<long> numbers) {
reworded
transform
HumanEval_8_sum_product
} public static void Main(string[] args) { Debug.Assert(SumProduct((new List<long>())).Equals((Tuple.Create(0L, 1L)))); Debug.Assert(SumProduct((new List<long>(new long[]{(long)1L, (long)1L, (long)1L}))).Equals((Tuple.Create(3L, 1L)))); Debug.Assert(SumProduct((new List<long>(new long[]{(long)100L, (long)0L}))).Equals((Tuple.Create(100L, 0L)))); Debug.Assert(SumProduct((new List<long>(new long[]{(long)3L, (long)5L, (long)7L}))).Equals((Tuple.Create(15L, 105L)))); Debug.Assert(SumProduct((new List<long>(new long[]{(long)10L}))).Equals((Tuple.Create(10L, 10L)))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_8_sum_product.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた整数リストから、各要素のそこまでの最大値(ローリング最大値)のリストを生成する。 // >>> RollingMax((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)3L, (long)4L, (long)2L}))) // (new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L, (long)4L})) public static List<long> RollingMax(List<long> numbers) {
reworded
transform
HumanEval_9_rolling_max
} public static void Main(string[] args) { Debug.Assert(RollingMax((new List<long>())).Equals((new List<long>()))); Debug.Assert(RollingMax((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))); Debug.Assert(RollingMax((new List<long>(new long[]{(long)4L, (long)3L, (long)2L, (long)1L}))).Equals((new List<long>(new long[]{(long)4L, (long)4L, (long)4L, (long)4L})))); Debug.Assert(RollingMax((new List<long>(new long[]{(long)3L, (long)2L, (long)3L, (long)100L, (long)3L}))).Equals((new List<long>(new long[]{(long)3L, (long)3L, (long)3L, (long)100L, (long)100L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_9_rolling_max.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた文字列で始まる最短の回文を見つけてください。 // アルゴリズムのアイデアは以下の通りです: // - 与えられた文字列の中で最も長い回文となる接尾辞を見つけます。 // - その回文の接尾辞の前に来る接頭辞を逆順にして、文字列の末尾に追加します。 // >>> MakePalindrome(("")) // ("") // >>> MakePalindrome(("cat")) // ("catac") // >>> MakePalindrome(("cata")) // ("catac") public static string MakePalindrome(string str) {
reworded
transform
HumanEval_10_make_palindrome
} public static void Main(string[] args) { Debug.Assert(MakePalindrome(("")).Equals((""))); Debug.Assert(MakePalindrome(("x")).Equals(("x"))); Debug.Assert(MakePalindrome(("xyz")).Equals(("xyzyx"))); Debug.Assert(MakePalindrome(("xyx")).Equals(("xyx"))); Debug.Assert(MakePalindrome(("jerry")).Equals(("jerryrrej"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_10_make_palindrome.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 引数は1と0のみからなる文字列aとbである。 // これらの引数に対して排他論理和(XOR)を実行し、結果を文字列として返す。 // >>> StringXor(("010"), ("110")) // ("100") public static string StringXor(string a, string b) {
reworded
transform
HumanEval_11_string_xor
} public static void Main(string[] args) { Debug.Assert(StringXor(("111000"), ("101010")).Equals(("010010"))); Debug.Assert(StringXor(("1"), ("1")).Equals(("0"))); Debug.Assert(StringXor(("0101"), ("0000")).Equals(("0101"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_11_string_xor.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列のリストのうち、最も長いものを返す。同じ長さの文字列が // 複数ある場合は最初のものを返す。入力リストが空の場合は null を返す。 // >>> Longest((new List<string>())) // null // >>> Longest((new List<string>(new string[]{(string)"a", (string)"b", (string)"c"}))) // ("a") // >>> Longest((new List<string>(new string[]{(string)"a", (string)"bb", (string)"ccc"}))) // ("ccc") public static string Longest(List<string> strings) {
reworded
transform
HumanEval_12_longest
} public static void Main(string[] args) { Debug.Assert(Longest((new List<string>())).Equals(null)); Debug.Assert(Longest((new List<string>(new string[]{(string)"x", (string)"y", (string)"z"}))).Equals(("x"))); Debug.Assert(Longest((new List<string>(new string[]{(string)"x", (string)"yyy", (string)"zzzz", (string)"www", (string)"kkkk", (string)"abc"}))).Equals(("zzzz"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_12_longest.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 整数 a と b の最大公約数を返す // >>> GreatestCommonDivisor((3L), (5L)) // (1L) // >>> GreatestCommonDivisor((25L), (15L)) // (5L) public static long GreatestCommonDivisor(long a, long b) {
reworded
transform
HumanEval_13_greatest_common_divisor
} public static void Main(string[] args) { Debug.Assert(GreatestCommonDivisor((3L), (7L)) == (1L)); Debug.Assert(GreatestCommonDivisor((10L), (15L)) == (5L)); Debug.Assert(GreatestCommonDivisor((49L), (14L)) == (7L)); Debug.Assert(GreatestCommonDivisor((144L), (60L)) == (12L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_13_greatest_common_divisor.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 引数で与えられた文字列に対して、短いものから長いものへ、全ての接頭辞のリストを返す // >>> AllPrefixes(("abc")) // (new List<string>(new string[]{(string)"a", (string)"ab", (string)"abc"})) public static List<string> AllPrefixes(string str) {
reworded
transform
HumanEval_14_all_prefixes
} public static void Main(string[] args) { Debug.Assert(AllPrefixes(("")).Equals((new List<string>()))); Debug.Assert(AllPrefixes(("asdfgh")).Equals((new List<string>(new string[]{(string)"a", (string)"as", (string)"asd", (string)"asdf", (string)"asdfg", (string)"asdfgh"})))); Debug.Assert(AllPrefixes(("WWW")).Equals((new List<string>(new string[]{(string)"W", (string)"WW", (string)"WWW"})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_14_all_prefixes.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 0からnまでの数字を空白区切りで連結した文字列で返す。 // >>> StringSequence((0L)) // ("0") // >>> StringSequence((5L)) // ("0 1 2 3 4 5") public static string StringSequence(long n) {
reworded
transform
HumanEval_15_string_sequence
} public static void Main(string[] args) { Debug.Assert(StringSequence((0L)).Equals(("0"))); Debug.Assert(StringSequence((3L)).Equals(("0 1 2 3"))); Debug.Assert(StringSequence((10L)).Equals(("0 1 2 3 4 5 6 7 8 9 10"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_15_string_sequence.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列が与えられたとき、その文字列が(大文字小文字に関係なく)いくつの異なる文字が含まれているか数える // >>> CountDistinctCharacters(("xyzXYZ")) // (3L) // >>> CountDistinctCharacters(("Jerry")) // (4L) public static long CountDistinctCharacters(string str) {
reworded
transform
HumanEval_16_count_distinct_characters
} public static void Main(string[] args) { Debug.Assert(CountDistinctCharacters(("")) == (0L)); Debug.Assert(CountDistinctCharacters(("abcde")) == (5L)); Debug.Assert(CountDistinctCharacters(("abcdecadeCADE")) == (5L)); Debug.Assert(CountDistinctCharacters(("aaaaAAAAaaaa")) == (1L)); Debug.Assert(CountDistinctCharacters(("Jerry jERRY JeRRRY")) == (5L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_16_count_distinct_characters.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // この関数の引数は、特別なASCII形式の音符を表す文字列である。あなたの仕事は、この文字列を解析して、それぞれの音符が何拍続くかに対応する整数のリストを返すことである。 // ここに凡例がある: // o' - 全音符、4拍続く // o|' - 2分音符、2拍続く // .|」-4分音符、1拍続く // >>> ParseMusic(("o o| .| o| o| .| .| .| .| o o")) // (new List<long>(new long[]{(long)4L, (long)2L, (long)1L, (long)2L, (long)2L, (long)1L, (long)1L, (long)1L, (long)1L, (long)4L, (long)4L})) public static List<long> ParseMusic(string music_string) {
reworded
transform
HumanEval_17_parse_music
} public static void Main(string[] args) { Debug.Assert(ParseMusic(("")).Equals((new List<long>()))); Debug.Assert(ParseMusic(("o o o o")).Equals((new List<long>(new long[]{(long)4L, (long)4L, (long)4L, (long)4L})))); Debug.Assert(ParseMusic((".| .| .| .|")).Equals((new List<long>(new long[]{(long)1L, (long)1L, (long)1L, (long)1L})))); Debug.Assert(ParseMusic(("o| o| .| .| o o o o")).Equals((new List<long>(new long[]{(long)2L, (long)2L, (long)1L, (long)1L, (long)4L, (long)4L, (long)4L, (long)4L})))); Debug.Assert(ParseMusic(("o| .| o| .| o o| o o|")).Equals((new List<long>(new long[]{(long)2L, (long)1L, (long)2L, (long)1L, (long)4L, (long)2L, (long)4L, (long)2L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_17_parse_music.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 部分文字列substringが文字列stringの中で何回見つかるか数える。 // 重なるケースもカウントに含まれる。 // >>> HowManyTimes((""), ("a")) // (0L) // >>> HowManyTimes(("aaa"), ("a")) // (3L) // >>> HowManyTimes(("aaaa"), ("aa")) // (3L) public static long HowManyTimes(string str, string substring) {
reworded
transform
HumanEval_18_how_many_times
} public static void Main(string[] args) { Debug.Assert(HowManyTimes((""), ("x")) == (0L)); Debug.Assert(HowManyTimes(("xyxyxyx"), ("x")) == (4L)); Debug.Assert(HowManyTimes(("cacacacac"), ("cac")) == (4L)); Debug.Assert(HowManyTimes(("john doe"), ("john")) == (1L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_18_how_many_times.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 引数は'zero'から'nine'までの英単語の数を空白で区切った文字列である。 // 有効な英単語は''、'zero', 'one'、'two'、'three'、'four'、'five'、'six'、'seven'、'eight'、'nine'である。 // 関数は、英単語の数を小さい方から大きい方へとソートした文字列を返す。 // >>> SortNumbers(("three one five")) // ("one three five") public static string SortNumbers(string numbers) {
reworded
transform
HumanEval_19_sort_numbers
} public static void Main(string[] args) { Debug.Assert(SortNumbers(("")).Equals((""))); Debug.Assert(SortNumbers(("three")).Equals(("three"))); Debug.Assert(SortNumbers(("three five nine")).Equals(("three five nine"))); Debug.Assert(SortNumbers(("five zero four seven nine eight")).Equals(("zero four five seven eight nine"))); Debug.Assert(SortNumbers(("six five four three two one zero")).Equals(("zero one two three four five six"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_19_sort_numbers.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // (少なくとも長さ2以上の)リストnumbersから、互いに最も近いものを2つ選び、 // 順番に(小さい数、大きい数)返す。 // >>> FindClosestElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f}))) // (Tuple.Create(2.0f, 2.2f)) // >>> FindClosestElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f}))) // (Tuple.Create(2.0f, 2.0f)) public static Tuple<float, float> FindClosestElements(List<float> numbers) {
reworded
transform
HumanEval_20_find_closest_elements
} public static void Main(string[] args) { Debug.Assert(FindClosestElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.9f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(3.9f, 4.0f)))); Debug.Assert(FindClosestElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)5.9f, (float)4.0f, (float)5.0f}))).Equals((Tuple.Create(5.0f, 5.9f)))); Debug.Assert(FindClosestElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.2f}))).Equals((Tuple.Create(2.0f, 2.2f)))); Debug.Assert(FindClosestElements((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f, (float)2.0f}))).Equals((Tuple.Create(2.0f, 2.0f)))); Debug.Assert(FindClosestElements((new List<float>(new float[]{(float)1.1f, (float)2.2f, (float)3.1f, (float)4.1f, (float)5.1f}))).Equals((Tuple.Create(2.2f, 3.1f)))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_20_find_closest_elements.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // (少なくとも 2 つ以上の要素からなる) リストnumbersに線形変換を適用し、 // 最小の数値が 0 になり、最大の数値が 1 になるリストを返す // >>> RescaleToUnit((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))) // (new List<float>(new float[]{(float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f})) public static List<float> RescaleToUnit(List<float> numbers) {
reworded
transform
HumanEval_21_rescale_to_unit
} public static void Main(string[] args) { Debug.Assert(RescaleToUnit((new List<float>(new float[]{(float)2.0f, (float)49.9f}))).Equals((new List<float>(new float[]{(float)0.0f, (float)1.0f})))); Debug.Assert(RescaleToUnit((new List<float>(new float[]{(float)100.0f, (float)49.9f}))).Equals((new List<float>(new float[]{(float)1.0f, (float)0.0f})))); Debug.Assert(RescaleToUnit((new List<float>(new float[]{(float)1.0f, (float)2.0f, (float)3.0f, (float)4.0f, (float)5.0f}))).Equals((new List<float>(new float[]{(float)0.0f, (float)0.25f, (float)0.5f, (float)0.75f, (float)1.0f})))); Debug.Assert(RescaleToUnit((new List<float>(new float[]{(float)2.0f, (float)1.0f, (float)5.0f, (float)3.0f, (float)4.0f}))).Equals((new List<float>(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f})))); Debug.Assert(RescaleToUnit((new List<float>(new float[]{(float)12.0f, (float)11.0f, (float)15.0f, (float)13.0f, (float)14.0f}))).Equals((new List<float>(new float[]{(float)0.25f, (float)0.0f, (float)1.0f, (float)0.5f, (float)0.75f})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_21_rescale_to_unit.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 任意の種類の値が含まれるリストから整数値のみ抽出する // >>> FilterIntegers((new List<object>(new string[]{(string)"a", (string)3.14f, (string)5L}))) // (new List<long>(new long[]{(long)5L})) // >>> FilterIntegers((new List<object>(new object[]{1L, 2L, 3L, "abc", new List<object>()}))) // (new List<long>(new long[]{(long)1L, (long)2L, (long)3L})) public static List<long> FilterIntegers(List<object> values) {
reworded
transform
HumanEval_22_filter_integers
} public static void Main(string[] args) { Debug.Assert(FilterIntegers((new List<object>())).Equals((new List<long>()))); Debug.Assert(FilterIntegers((new List<object>(new object[]{4L, new List<object>(), 23.2f, 9L, "adasd"}))).Equals((new List<long>(new long[]{(long)4L, (long)9L})))); Debug.Assert(FilterIntegers((new List<object>(new object[]{3L, "c", 3L, 3L, "a", "b"}))).Equals((new List<long>(new long[]{(long)3L, (long)3L, (long)3L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_22_filter_integers.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 引数で与えられた文字列の長さを返す // >>> StringLength(("")) // (0L) // >>> StringLength(("abc")) // (3L) public static long Strlen(string str) {
reworded
transform
HumanEval_23_strlen
} public static void Main(string[] args) { Debug.Assert(Strlen(("")) == (0L)); Debug.Assert(Strlen(("x")) == (1L)); Debug.Assert(Strlen(("asdasnakj")) == (9L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_23_strlen.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた数nについて、nの約数のうち、nより小さい最大の数を求める // >>> LargestDivisor((15L)) // (5L) public static long LargestDivisor(long n) {
reworded
transform
HumanEval_24_largest_divisor
} public static void Main(string[] args) { Debug.Assert(LargestDivisor((3L)) == (1L)); Debug.Assert(LargestDivisor((7L)) == (1L)); Debug.Assert(LargestDivisor((10L)) == (5L)); Debug.Assert(LargestDivisor((100L)) == (50L)); Debug.Assert(LargestDivisor((49L)) == (7L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_24_largest_divisor.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた整数の素因数のリストを小さいものから大きいものの順に返す。各因数は、 // 因数分解で現れる回数分、リストに登場する。引数の整数は全ての因数の積に等しくな // ければならない。 // >>> Factorize((8L)) // (new List<long>(new long[]{(long)2L, (long)2L, (long)2L})) // >>> Factorize((25L)) // (new List<long>(new long[]{(long)5L, (long)5L})) // >>> Factorize((70L)) // (new List<long>(new long[]{(long)2L, (long)5L, (long)7L})) public static List<long> Factorize(long n) {
reworded
transform
HumanEval_25_factorize
} public static void Main(string[] args) { Debug.Assert(Factorize((2L)).Equals((new List<long>(new long[]{(long)2L})))); Debug.Assert(Factorize((4L)).Equals((new List<long>(new long[]{(long)2L, (long)2L})))); Debug.Assert(Factorize((8L)).Equals((new List<long>(new long[]{(long)2L, (long)2L, (long)2L})))); Debug.Assert(Factorize((57L)).Equals((new List<long>(new long[]{(long)3L, (long)19L})))); Debug.Assert(Factorize((3249L)).Equals((new List<long>(new long[]{(long)3L, (long)3L, (long)19L, (long)19L})))); Debug.Assert(Factorize((185193L)).Equals((new List<long>(new long[]{(long)3L, (long)3L, (long)3L, (long)19L, (long)19L, (long)19L})))); Debug.Assert(Factorize((20577L)).Equals((new List<long>(new long[]{(long)3L, (long)19L, (long)19L, (long)19L})))); Debug.Assert(Factorize((18L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)3L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_25_factorize.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 整数のリストから、複数回出現する要素をすべて取り除く。 // 要素の順序は入力と同じようにする。 // >>> RemoveDuplicates((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)4L}))) // (new List<long>(new long[]{(long)1L, (long)3L, (long)4L})) public static List<long> RemoveDuplicates(List<long> numbers) {
reworded
transform
HumanEval_26_remove_duplicates
} public static void Main(string[] args) { Debug.Assert(RemoveDuplicates((new List<long>())).Equals((new List<long>()))); Debug.Assert(RemoveDuplicates((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L})))); Debug.Assert(RemoveDuplicates((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)4L, (long)3L, (long)5L}))).Equals((new List<long>(new long[]{(long)1L, (long)4L, (long)5L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_26_remove_duplicates.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた文字列に対して、英小文字を英大文字に、英大文字を英小文字に変換する。 // >>> FlipCase(("Hello")) // ("hELLO") public static string FlipCase(string str) {
reworded
transform
HumanEval_27_flip_case
} public static void Main(string[] args) { Debug.Assert(FlipCase(("")).Equals((""))); Debug.Assert(FlipCase(("Hello!")).Equals(("hELLO!"))); Debug.Assert(FlipCase(("These violent delights have violent ends")).Equals(("tHESE VIOLENT DELIGHTS HAVE VIOLENT ENDS"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_27_flip_case.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列のリストを1つの文字列に連結する // >>> Concatenate((new List<string>())) // ("") // >>> Concatenate((new List<string>(new string[]{(string)"a", (string)"b", (string)"c"}))) // ("abc") public static string Concatenate(List<string> strings) {
reworded
transform
HumanEval_28_concatenate
} public static void Main(string[] args) { Debug.Assert(Concatenate((new List<string>())).Equals((""))); Debug.Assert(Concatenate((new List<string>(new string[]{(string)"x", (string)"y", (string)"z"}))).Equals(("xyz"))); Debug.Assert(Concatenate((new List<string>(new string[]{(string)"x", (string)"y", (string)"z", (string)"w", (string)"k"}))).Equals(("xyzwk"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_28_concatenate.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列のリストから、指定された接頭辞prefixで始まるものだけを取り出す。 // >>> FilterByPrefix((new List<string>()), ("a")) // (new List<string>()) // >>> FilterByPrefix((new List<string>(new string[]{(string)"abc", (string)"bcd", (string)"cde", (string)"array"})), ("a")) // (new List<string>(new string[]{(string)"abc", (string)"array"})) public static List<string> FilterByPrefix(List<string> strings, string prefix) {
reworded
transform
HumanEval_29_filter_by_prefix
} public static void Main(string[] args) { Debug.Assert(FilterByPrefix((new List<string>()), ("john")).Equals((new List<string>()))); Debug.Assert(FilterByPrefix((new List<string>(new string[]{(string)"xxx", (string)"asd", (string)"xxy", (string)"john doe", (string)"xxxAAA", (string)"xxx"})), ("xxx")).Equals((new List<string>(new string[]{(string)"xxx", (string)"xxxAAA", (string)"xxx"})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_29_filter_by_prefix.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // リスト内の正の数だけを返す。 // >>> GetPositive((new List<long>(new long[]{(long)-1L, (long)2L, (long)-4L, (long)5L, (long)6L}))) // (new List<long>(new long[]{(long)2L, (long)5L, (long)6L})) // >>> GetPositive((new List<long>(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))) // (new List<long>(new long[]{(long)5L, (long)3L, (long)2L, (long)3L, (long)9L, (long)123L, (long)1L})) public static List<long> GetPositive(List<long> l) {
reworded
transform
HumanEval_30_get_positive
} public static void Main(string[] args) { Debug.Assert(GetPositive((new List<long>(new long[]{(long)-1L, (long)-2L, (long)4L, (long)5L, (long)6L}))).Equals((new List<long>(new long[]{(long)4L, (long)5L, (long)6L})))); Debug.Assert(GetPositive((new List<long>(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List<long>(new long[]{(long)5L, (long)3L, (long)2L, (long)3L, (long)3L, (long)9L, (long)123L, (long)1L})))); Debug.Assert(GetPositive((new List<long>(new long[]{(long)-1L, (long)-2L}))).Equals((new List<long>()))); Debug.Assert(GetPositive((new List<long>())).Equals((new List<long>()))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_30_get_positive.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた数が素数であれば真を、そうでなければ偽を返す。 // >>> IsPrime((6L)) // (false) // >>> IsPrime((101L)) // (true) // >>> IsPrime((11L)) // (true) // >>> IsPrime((13441L)) // (true) // >>> IsPrime((61L)) // (true) // >>> IsPrime((4L)) // (false) // >>> IsPrime((1L)) // (false) public static bool IsPrime(long n) {
reworded
transform
HumanEval_31_is_prime
} public static void Main(string[] args) { Debug.Assert(IsPrime((6L)) == (false)); Debug.Assert(IsPrime((101L)) == (true)); Debug.Assert(IsPrime((11L)) == (true)); Debug.Assert(IsPrime((13441L)) == (true)); Debug.Assert(IsPrime((61L)) == (true)); Debug.Assert(IsPrime((4L)) == (false)); Debug.Assert(IsPrime((1L)) == (false)); Debug.Assert(IsPrime((5L)) == (true)); Debug.Assert(IsPrime((11L)) == (true)); Debug.Assert(IsPrime((17L)) == (true)); Debug.Assert(IsPrime((85L)) == (false)); Debug.Assert(IsPrime((77L)) == (false)); Debug.Assert(IsPrime((255379L)) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_31_is_prime.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // この関数はリストlを受け取り、l'を返す。l'は、インデックスが3で割り // 切れない場合はlと同じであるが、インデックスが3で割り切れる要素は // ソートされている。 // >>> SortThird((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) // (new List<long>(new long[]{(long)1L, (long)2L, (long)3L})) // >>> SortThird((new List<long>(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L}))) // (new List<long>(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L})) public static List<long> SortThird(List<long> l) {
reworded
transform
HumanEval_33_sort_third
} public static void Main(string[] args) { Debug.Assert(SortThird((new List<long>(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L}))).Equals((new List<long>(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L})))); Debug.Assert(SortThird((new List<long>(new long[]{(long)5L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)2L}))).Equals((new List<long>(new long[]{(long)2L, (long)8L, (long)3L, (long)4L, (long)6L, (long)9L, (long)5L})))); Debug.Assert(SortThird((new List<long>(new long[]{(long)5L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)2L}))).Equals((new List<long>(new long[]{(long)2L, (long)6L, (long)9L, (long)4L, (long)8L, (long)3L, (long)5L})))); Debug.Assert(SortThird((new List<long>(new long[]{(long)5L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)2L, (long)1L}))).Equals((new List<long>(new long[]{(long)2L, (long)6L, (long)3L, (long)4L, (long)8L, (long)9L, (long)5L, (long)1L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_33_sort_third.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // リスト内のユニークな要素をソートして返す // >>> Unique((new List<long>(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))) // (new List<long>(new long[]{(long)0L, (long)2L, (long)3L, (long)5L, (long)9L, (long)123L})) public static List<long> Unique(List<long> l) {
reworded
transform
HumanEval_34_unique
} public static void Main(string[] args) { Debug.Assert(Unique((new List<long>(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List<long>(new long[]{(long)0L, (long)2L, (long)3L, (long)5L, (long)9L, (long)123L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_34_unique.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // リスト内の最大要素を返す。 // >>> MaxElement((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) // (3L) // >>> MaxElement((new List<long>(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))) // (123L) public static long MaxElement(List<long> l) {
reworded
transform
HumanEval_35_max_element
} public static void Main(string[] args) { Debug.Assert(MaxElement((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) == (3L)); Debug.Assert(MaxElement((new List<long>(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)124L, (long)1L, (long)-10L}))) == (124L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_35_max_element.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられたn未満の整数の中で、11または13で割り切れる数の中に'7'という数字が何回現れるかを返す // >>> FizzBuzz((50L)) // (0L) // >>> FizzBuzz((78L)) // (2L) // >>> FizzBuzz((79L)) // (3L) public static long FizzBuzz(long n) {
reworded
transform
HumanEval_36_fizz_buzz
} public static void Main(string[] args) { Debug.Assert(FizzBuzz((50L)) == (0L)); Debug.Assert(FizzBuzz((78L)) == (2L)); Debug.Assert(FizzBuzz((79L)) == (3L)); Debug.Assert(FizzBuzz((100L)) == (3L)); Debug.Assert(FizzBuzz((200L)) == (6L)); Debug.Assert(FizzBuzz((4000L)) == (192L)); Debug.Assert(FizzBuzz((10000L)) == (639L)); Debug.Assert(FizzBuzz((100000L)) == (8026L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_36_fizz_buzz.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // この関数はリスト l を受け取り、l' を返す。l'は、インデックスが奇数の // ときは l と同じで、インデックスが偶数のときはソートされている。 // >>> SortEven((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) // (new List<long>(new long[]{(long)1L, (long)2L, (long)3L})) // >>> SortEven((new List<long>(new long[]{(long)5L, (long)6L, (long)3L, (long)4L}))) // (new List<long>(new long[]{(long)3L, (long)6L, (long)5L, (long)4L})) public static List<long> SortEven(List<long> l) {
reworded
transform
HumanEval_37_sort_even
} public static void Main(string[] args) { Debug.Assert(SortEven((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List<long>(new long[]{(long)1L, (long)2L, (long)3L})))); Debug.Assert(SortEven((new List<long>(new long[]{(long)5L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)9L, (long)0L, (long)123L, (long)1L, (long)-10L}))).Equals((new List<long>(new long[]{(long)-10L, (long)3L, (long)-5L, (long)2L, (long)-3L, (long)3L, (long)5L, (long)0L, (long)9L, (long)1L, (long)123L})))); Debug.Assert(SortEven((new List<long>(new long[]{(long)5L, (long)8L, (long)-12L, (long)4L, (long)23L, (long)2L, (long)3L, (long)11L, (long)12L, (long)-10L}))).Equals((new List<long>(new long[]{(long)-12L, (long)8L, (long)3L, (long)4L, (long)5L, (long)2L, (long)12L, (long)11L, (long)23L, (long)-10L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_37_sort_even.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // prime_fib はフィボナッチ数で、かつ素数であるn番目の数を返す。 // >>> PrimeFib((1L)) // (2L) // >>> PrimeFib((2L)) // (3L) // >>> PrimeFib((3L)) // (5L) // >>> PrimeFib((4L)) // (13L) // >>> PrimeFib((5L)) // (89L) public static long PrimeFib(long n) {
reworded
transform
HumanEval_39_prime_fib
} public static void Main(string[] args) { Debug.Assert(PrimeFib((1L)) == (2L)); Debug.Assert(PrimeFib((2L)) == (3L)); Debug.Assert(PrimeFib((3L)) == (5L)); Debug.Assert(PrimeFib((4L)) == (13L)); Debug.Assert(PrimeFib((5L)) == (89L)); Debug.Assert(PrimeFib((6L)) == (233L)); Debug.Assert(PrimeFib((7L)) == (1597L)); Debug.Assert(PrimeFib((8L)) == (28657L)); Debug.Assert(PrimeFib((9L)) == (514229L)); Debug.Assert(PrimeFib((10L)) == (433494437L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_39_prime_fib.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // triples_sum_to_zero は整数のリストを引数に取り、 // リストの中に和が0になる3つの要素があればtrueを、 // そうでなければfalseを返す。 // >>> TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) // (false) // >>> TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) // (true) // >>> TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) // (false) // >>> TriplesSumToZero((new List<long>(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)9L, (long)7L}))) // (true) // >>> TriplesSumToZero((new List<long>(new long[]{(long)1L}))) // (false) public static bool TriplesSumToZero(List<long> l) {
reworded
transform
HumanEval_40_triples_sum_to_zero
} public static void Main(string[] args) { Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)-1L}))) == (false)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (true)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)2L, (long)5L, (long)7L}))) == (false)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)9L, (long)7L}))) == (true)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L}))) == (false)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)-100L}))) == (false)); Debug.Assert(TriplesSumToZero((new List<long>(new long[]{(long)100L, (long)3L, (long)5L, (long)-100L}))) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_40_triples_sum_to_zero.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 完全な直線で無限に長い道路を想像してほしい。 // n台の車が左から右に向かって走っている。同時に、別のn台の車が // 右から左に向かって走っている。この2組の車は、最初は互いに非 // 常に離れている。すべての車は同じ速度で動く。2台の車は次のよ // うに衝突する。左から右に動いている車が、右から左に動いている // 車にぶつかること。 // しかし、車は限りなく頑丈で強い。あたかも衝突しなかったかのよ // うに、その軌道を進み続ける。 // この関数は、このような衝突の回数を出力する。 public static long CarRaceCollision(long n) {
reworded
transform
HumanEval_41_car_race_collision
} public static void Main(string[] args) { Debug.Assert(CarRaceCollision((2L)) == (4L)); Debug.Assert(CarRaceCollision((3L)) == (9L)); Debug.Assert(CarRaceCollision((4L)) == (16L)); Debug.Assert(CarRaceCollision((8L)) == (64L)); Debug.Assert(CarRaceCollision((10L)) == (100L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_41_car_race_collision.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 要素を1ずつ増やしたリストを返す。 // >>> IncrList((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) // (new List<long>(new long[]{(long)2L, (long)3L, (long)4L})) // >>> IncrList((new List<long>(new long[]{(long)5L, (long)3L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))) // (new List<long>(new long[]{(long)6L, (long)4L, (long)6L, (long)3L, (long)4L, (long)4L, (long)10L, (long)1L, (long)124L})) public static List<long> IncrList(List<long> l) {
reworded
transform
HumanEval_42_incr_list
} public static void Main(string[] args) { Debug.Assert(IncrList((new List<long>())).Equals((new List<long>()))); Debug.Assert(IncrList((new List<long>(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List<long>(new long[]{(long)4L, (long)3L, (long)2L})))); Debug.Assert(IncrList((new List<long>(new long[]{(long)5L, (long)2L, (long)5L, (long)2L, (long)3L, (long)3L, (long)9L, (long)0L, (long)123L}))).Equals((new List<long>(new long[]{(long)6L, (long)3L, (long)6L, (long)3L, (long)4L, (long)4L, (long)10L, (long)1L, (long)124L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_42_incr_list.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // pairs_sum_to_zero は整数のリストを引数にとる。 // リストの中に2つの要素の和がゼロになる要素があればtrueを、 // そうでなければfalseを返す。 // >>> PairsSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) // (false) // >>> PairsSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) // (false) // >>> PairsSumToZero((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) // (false) // >>> PairsSumToZero((new List<long>(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)5L, (long)7L}))) // (true) // >>> PairsSumToZero((new List<long>(new long[]{(long)1L}))) // (false) public static bool PairsSumToZero(List<long> l) {
reworded
transform
HumanEval_43_pairs_sum_to_zero
} public static void Main(string[] args) { Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)5L, (long)0L}))) == (false)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)1L, (long)3L, (long)-2L, (long)1L}))) == (false)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)7L}))) == (false)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)2L, (long)4L, (long)-5L, (long)3L, (long)5L, (long)7L}))) == (true)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)1L}))) == (false)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)30L}))) == (true)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)-3L, (long)9L, (long)-1L, (long)3L, (long)2L, (long)31L}))) == (true)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)30L}))) == (false)); Debug.Assert(PairsSumToZero((new List<long>(new long[]{(long)-3L, (long)9L, (long)-1L, (long)4L, (long)2L, (long)31L}))) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_43_pairs_sum_to_zero.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 引数xの基数をbaseに変換する。 // 返り値は変換後の文字列表現である。 // 基数は10未満である。 // >>> ChangeBase((8L), (3L)) // ("22") // >>> ChangeBase((8L), (2L)) // ("1000") // >>> ChangeBase((7L), (2L)) // ("111") public static string ChangeBase(long x, long numBase) {
reworded
transform
HumanEval_44_change_base
} public static void Main(string[] args) { Debug.Assert(ChangeBase((8L), (3L)).Equals(("22"))); Debug.Assert(ChangeBase((9L), (3L)).Equals(("100"))); Debug.Assert(ChangeBase((234L), (2L)).Equals(("11101010"))); Debug.Assert(ChangeBase((16L), (2L)).Equals(("10000"))); Debug.Assert(ChangeBase((8L), (2L)).Equals(("1000"))); Debug.Assert(ChangeBase((7L), (2L)).Equals(("111"))); Debug.Assert(ChangeBase((2L), (3L)).Equals(("2"))); Debug.Assert(ChangeBase((3L), (4L)).Equals(("3"))); Debug.Assert(ChangeBase((4L), (5L)).Equals(("4"))); Debug.Assert(ChangeBase((5L), (6L)).Equals(("5"))); Debug.Assert(ChangeBase((6L), (7L)).Equals(("6"))); Debug.Assert(ChangeBase((7L), (8L)).Equals(("7"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_44_change_base.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 三角形の一辺の長さと高さが与えられたとき、面積を返す。 // >>> TriangleArea((5L), (3L)) // (7.5f) public static float TriangleArea(long a, long h) {
reworded
transform
HumanEval_45_triangle_area
} public static void Main(string[] args) { Debug.Assert(TriangleArea((5L), (3L)) == (7.5f)); Debug.Assert(TriangleArea((2L), (2L)) == (2.0f)); Debug.Assert(TriangleArea((10L), (8L)) == (40.0f)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_45_triangle_area.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // fib4数列はフィボナッチ数列に似た数列で、次のように定義される: // fib4(0) -> 0 // fib4(1) -> 0 // fib4(2) -> 2 // fib4(3) -> 0 // fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4). // fib4数列のn番目の要素を効率的に計算する関数を書け。再帰は使わないこと。 // >>> Fib4((5L)) // (4L) // >>> Fib4((6L)) // (8L) // >>> Fib4((7L)) // (14L) public static long Fib4(long n) {
reworded
transform
HumanEval_46_fib4
} public static void Main(string[] args) { Debug.Assert(Fib4((5L)) == (4L)); Debug.Assert(Fib4((8L)) == (28L)); Debug.Assert(Fib4((10L)) == (104L)); Debug.Assert(Fib4((12L)) == (386L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_46_fib4.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // リスト l の要素の中央値を返す。 // >>> Median((new List<long>(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))) // (float)3L // >>> Median((new List<long>(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L}))) // (15.0f) public static float Median(List<long> l) {
reworded
transform
HumanEval_47_median
} public static void Main(string[] args) { Debug.Assert(Median((new List<long>(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))) == (float)3L); Debug.Assert(Median((new List<long>(new long[]{(long)-10L, (long)4L, (long)6L, (long)1000L, (long)10L, (long)20L}))) == (8.0f)); Debug.Assert(Median((new List<long>(new long[]{(long)5L}))) == (float)5L); Debug.Assert(Median((new List<long>(new long[]{(long)6L, (long)5L}))) == (5.5f)); Debug.Assert(Median((new List<long>(new long[]{(long)8L, (long)1L, (long)3L, (long)9L, (long)9L, (long)2L, (long)7L}))) == (float)7L); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_47_median.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた文字列が回文かどうかを判定する // >>> IsPalindrome(("")) // (true) // >>> IsPalindrome(("aba")) // (true) // >>> IsPalindrome(("aaaaa")) // (true) // >>> IsPalindrome(("zbcd")) // (false) public static bool IsPalindrome(string text) {
reworded
transform
HumanEval_48_is_palindrome
} public static void Main(string[] args) { Debug.Assert(IsPalindrome(("")) == (true)); Debug.Assert(IsPalindrome(("aba")) == (true)); Debug.Assert(IsPalindrome(("aaaaa")) == (true)); Debug.Assert(IsPalindrome(("zbcd")) == (false)); Debug.Assert(IsPalindrome(("xywyx")) == (true)); Debug.Assert(IsPalindrome(("xywyz")) == (false)); Debug.Assert(IsPalindrome(("xywzx")) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_48_is_palindrome.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 2^n を p で割ったモジュロを返す。計算精度に注意。 // >>> Modp((3L), (5L)) // (3L) // >>> Modp((1101L), (101L)) // (2L) // >>> Modp((0L), (101L)) // (1L) // >>> Modp((3L), (11L)) // (8L) // >>> Modp((100L), (101L)) // (1L) public static long Modp(long n, long p) {
reworded
transform
HumanEval_49_modp
} public static void Main(string[] args) { Debug.Assert(Modp((3L), (5L)) == (3L)); Debug.Assert(Modp((1101L), (101L)) == (2L)); Debug.Assert(Modp((0L), (101L)) == (1L)); Debug.Assert(Modp((3L), (11L)) == (8L)); Debug.Assert(Modp((100L), (101L)) == (1L)); Debug.Assert(Modp((30L), (5L)) == (4L)); Debug.Assert(Modp((31L), (5L)) == (3L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_49_modp.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // remove_vowelsは文字列を引数に取り、母音を除いた文字列を返す関数である。 // >>> RemoveVowels(("")) // ("") // >>> RemoveVowels(("abcdef")) // ("bcdf") // >>> RemoveVowels(("aaaaa")) // ("") // >>> RemoveVowels(("aaBAA")) // ("B") // >>> RemoveVowels(("zbcd")) // ("zbcd") public static string RemoveVowels(string text) {
reworded
transform
HumanEval_51_remove_vowels
} public static void Main(string[] args) { Debug.Assert(RemoveVowels(("")).Equals((""))); Debug.Assert(RemoveVowels(("abcdef\nghijklm")).Equals(("bcdf\nghjklm"))); Debug.Assert(RemoveVowels(("fedcba")).Equals(("fdcb"))); Debug.Assert(RemoveVowels(("eeeee")).Equals((""))); Debug.Assert(RemoveVowels(("acBAA")).Equals(("cB"))); Debug.Assert(RemoveVowels(("EcBOO")).Equals(("cB"))); Debug.Assert(RemoveVowels(("ybcd")).Equals(("ybcd"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_51_remove_vowels.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // リスト l 内の全ての数値が閾値 t 未満の場合、trueを返す。 // >>> BelowThreshold((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L)) // (true) // >>> BelowThreshold((new List<long>(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L)) // (false) public static bool BelowThreshold(List<long> l, long t) {
reworded
transform
HumanEval_52_below_threshold
} public static void Main(string[] args) { Debug.Assert(BelowThreshold((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)10L})), (100L)) == (true)); Debug.Assert(BelowThreshold((new List<long>(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (5L)) == (false)); Debug.Assert(BelowThreshold((new List<long>(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (21L)) == (true)); Debug.Assert(BelowThreshold((new List<long>(new long[]{(long)1L, (long)20L, (long)4L, (long)10L})), (22L)) == (true)); Debug.Assert(BelowThreshold((new List<long>(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (11L)) == (true)); Debug.Assert(BelowThreshold((new List<long>(new long[]{(long)1L, (long)8L, (long)4L, (long)10L})), (10L)) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_52_below_threshold.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 2つの数xとyを足す // >>> Add((2L), (3L)) // (5L) // >>> Add((5L), (7L)) // (12L) public static long Add(long x, long y) {
reworded
transform
HumanEval_53_add
} public static void Main(string[] args) { Debug.Assert(Add((0L), (1L)) == (1L)); Debug.Assert(Add((1L), (0L)) == (1L)); Debug.Assert(Add((2L), (3L)) == (5L)); Debug.Assert(Add((5L), (7L)) == (12L)); Debug.Assert(Add((7L), (5L)) == (12L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_53_add.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 2つの単語が同じ文字セットから構成されるかどうか判定する。 // >>> SameChars(("eabcdzzzz"), ("dddzzzzzzzddeddabc")) // (true) // >>> SameChars(("abcd"), ("dddddddabc")) // (true) // >>> SameChars(("dddddddabc"), ("abcd")) // (true) // >>> SameChars(("eabcd"), ("dddddddabc")) // (false) // >>> SameChars(("abcd"), ("dddddddabce")) // (false) // >>> SameChars(("eabcdzzzz"), ("dddzzzzzzzddddabc")) // (false) public static bool SameChars(string s0, string s1) {
reworded
transform
HumanEval_54_same_chars
} public static void Main(string[] args) { Debug.Assert(SameChars(("eabcdzzzz"), ("dddzzzzzzzddeddabc")) == (true)); Debug.Assert(SameChars(("abcd"), ("dddddddabc")) == (true)); Debug.Assert(SameChars(("dddddddabc"), ("abcd")) == (true)); Debug.Assert(SameChars(("eabcd"), ("dddddddabc")) == (false)); Debug.Assert(SameChars(("abcd"), ("dddddddabcf")) == (false)); Debug.Assert(SameChars(("eabcdzzzz"), ("dddzzzzzzzddddabc")) == (false)); Debug.Assert(SameChars(("aabb"), ("aaccc")) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_54_same_chars.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // n番目のフィボナッチ数を返す。 // >>> Fib((10L)) // (55L) // >>> Fib((1L)) // (1L) // >>> Fib((8L)) // (21L) public static long Fib(long n) {
reworded
transform
HumanEval_55_fib
} public static void Main(string[] args) { Debug.Assert(Fib((10L)) == (55L)); Debug.Assert(Fib((1L)) == (1L)); Debug.Assert(Fib((8L)) == (21L)); Debug.Assert(Fib((11L)) == (89L)); Debug.Assert(Fib((12L)) == (144L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_55_fib.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 引数bracketsは"<"と">"の文字列である。 // すべての開き括弧が対応する閉じ括弧を持つ場合、trueを返す。 // >>> CorrectBracketing(("<")) // (false) // >>> CorrectBracketing(("<>")) // (true) // >>> CorrectBracketing(("<<><>>")) // (true) // >>> CorrectBracketing(("><<>")) // (false) public static bool CorrectBracketing(string brackets) {
reworded
transform
HumanEval_56_correct_bracketing
} public static void Main(string[] args) { Debug.Assert(CorrectBracketing(("<>")) == (true)); Debug.Assert(CorrectBracketing(("<<><>>")) == (true)); Debug.Assert(CorrectBracketing(("<><><<><>><>")) == (true)); Debug.Assert(CorrectBracketing(("<><><<<><><>><>><<><><<>>>")) == (true)); Debug.Assert(CorrectBracketing(("<<<><>>>>")) == (false)); Debug.Assert(CorrectBracketing(("><<>")) == (false)); Debug.Assert(CorrectBracketing(("<")) == (false)); Debug.Assert(CorrectBracketing(("<<<<")) == (false)); Debug.Assert(CorrectBracketing((">")) == (false)); Debug.Assert(CorrectBracketing(("<<>")) == (false)); Debug.Assert(CorrectBracketing(("<><><<><>><>><<>")) == (false)); Debug.Assert(CorrectBracketing(("<><><<><>><>>><>")) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_56_correct_bracketing.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // リストの要素が単調増加または単調減少する場合にtrueを返す。 // >>> Monotonic((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)20L}))) // (true) // >>> Monotonic((new List<long>(new long[]{(long)1L, (long)20L, (long)4L, (long)10L}))) // (false) // >>> Monotonic((new List<long>(new long[]{(long)4L, (long)1L, (long)0L, (long)-10L}))) // (true) public static bool Monotonic(List<long> l) {
reworded
transform
HumanEval_57_monotonic
} public static void Main(string[] args) { Debug.Assert(Monotonic((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)10L}))) == (true)); Debug.Assert(Monotonic((new List<long>(new long[]{(long)1L, (long)2L, (long)4L, (long)20L}))) == (true)); Debug.Assert(Monotonic((new List<long>(new long[]{(long)1L, (long)20L, (long)4L, (long)10L}))) == (false)); Debug.Assert(Monotonic((new List<long>(new long[]{(long)4L, (long)1L, (long)0L, (long)-10L}))) == (true)); Debug.Assert(Monotonic((new List<long>(new long[]{(long)4L, (long)1L, (long)1L, (long)0L}))) == (true)); Debug.Assert(Monotonic((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)5L, (long)60L}))) == (false)); Debug.Assert(Monotonic((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)60L}))) == (true)); Debug.Assert(Monotonic((new List<long>(new long[]{(long)9L, (long)9L, (long)9L, (long)9L}))) == (true)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_57_monotonic.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 2つのリストについて、ユニークな共通要素をソートして返す。 // >>> Common((new List<long>(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List<long>(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L}))) // (new List<long>(new long[]{(long)1L, (long)5L, (long)653L})) // >>> Common((new List<long>(new long[]{(long)5L, (long)3L, (long)2L, (long)8L})), (new List<long>(new long[]{(long)3L, (long)2L}))) // (new List<long>(new long[]{(long)2L, (long)3L})) public static List<long> Common(List<long> l1, List<long> l2) {
reworded
transform
HumanEval_58_common
} public static void Main(string[] args) { Debug.Assert(Common((new List<long>(new long[]{(long)1L, (long)4L, (long)3L, (long)34L, (long)653L, (long)2L, (long)5L})), (new List<long>(new long[]{(long)5L, (long)7L, (long)1L, (long)5L, (long)9L, (long)653L, (long)121L}))).Equals((new List<long>(new long[]{(long)1L, (long)5L, (long)653L})))); Debug.Assert(Common((new List<long>(new long[]{(long)5L, (long)3L, (long)2L, (long)8L})), (new List<long>(new long[]{(long)3L, (long)2L}))).Equals((new List<long>(new long[]{(long)2L, (long)3L})))); Debug.Assert(Common((new List<long>(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List<long>(new long[]{(long)3L, (long)2L, (long)4L}))).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)4L})))); Debug.Assert(Common((new List<long>(new long[]{(long)4L, (long)3L, (long)2L, (long)8L})), (new List<long>())).Equals((new List<long>()))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_58_common.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // nの最大となる素因数を返す。ただし、 n > 1 を前提とし、素数ではないものとする。 // >>> LargestPrimeFactor((13195L)) // (29L) // >>> LargestPrimeFactor((2048L)) // (2L) public static long LargestPrimeFactor(long n) {
reworded
transform
HumanEval_59_largest_prime_factor
} public static void Main(string[] args) { Debug.Assert(LargestPrimeFactor((15L)) == (5L)); Debug.Assert(LargestPrimeFactor((27L)) == (3L)); Debug.Assert(LargestPrimeFactor((63L)) == (7L)); Debug.Assert(LargestPrimeFactor((330L)) == (11L)); Debug.Assert(LargestPrimeFactor((13195L)) == (29L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_59_largest_prime_factor.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // sum_to_nは1からnまでの総和を求める関数である。 // >>> SumToN((30L)) // (465L) // >>> SumToN((100L)) // (5050L) // >>> SumToN((5L)) // (15L) // >>> SumToN((10L)) // (55L) // >>> SumToN((1L)) // (1L) public static long SumToN(long n) {
reworded
transform
HumanEval_60_sum_to_n
} public static void Main(string[] args) { Debug.Assert(SumToN((1L)) == (1L)); Debug.Assert(SumToN((6L)) == (21L)); Debug.Assert(SumToN((11L)) == (66L)); Debug.Assert(SumToN((30L)) == (465L)); Debug.Assert(SumToN((100L)) == (5050L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_60_sum_to_n.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 引数bracketsは"("と") "からなる文字列である。 // すべての開き括弧が対応する閉じ括弧を持つ場合、trueを返す。 // >>> CorrectBracketing(("(")) // (false) // >>> CorrectBracketing(("()")) // (true) // >>> CorrectBracketing(("(()())")) // (true) // >>> CorrectBracketing((")(()")) // (false) public static bool CorrectBracketing(string brackets) {
reworded
transform
HumanEval_61_correct_bracketing
} public static void Main(string[] args) { Debug.Assert(CorrectBracketing(("()")) == (true)); Debug.Assert(CorrectBracketing(("(()())")) == (true)); Debug.Assert(CorrectBracketing(("()()(()())()")) == (true)); Debug.Assert(CorrectBracketing(("()()((()()())())(()()(()))")) == (true)); Debug.Assert(CorrectBracketing(("((()())))")) == (false)); Debug.Assert(CorrectBracketing((")(()")) == (false)); Debug.Assert(CorrectBracketing(("(")) == (false)); Debug.Assert(CorrectBracketing(("((((")) == (false)); Debug.Assert(CorrectBracketing((")")) == (false)); Debug.Assert(CorrectBracketing(("(()")) == (false)); Debug.Assert(CorrectBracketing(("()()(()())())(()")) == (false)); Debug.Assert(CorrectBracketing(("()()(()())()))()")) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_61_correct_bracketing.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // xsは多項式の係数列を表す。 // xs[0] + xs[1] * x + xs[2] * x^2 + .... // 関数は、この多項式の導関数を同じ形式で返す。 // >>> Derivative((new List<long>(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))) // (new List<long>(new long[]{(long)1L, (long)4L, (long)12L, (long)20L})) // >>> Derivative((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) // (new List<long>(new long[]{(long)2L, (long)6L})) public static List<long> Derivative(List<long> xs) {
reworded
transform
HumanEval_62_derivative
} public static void Main(string[] args) { Debug.Assert(Derivative((new List<long>(new long[]{(long)3L, (long)1L, (long)2L, (long)4L, (long)5L}))).Equals((new List<long>(new long[]{(long)1L, (long)4L, (long)12L, (long)20L})))); Debug.Assert(Derivative((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List<long>(new long[]{(long)2L, (long)6L})))); Debug.Assert(Derivative((new List<long>(new long[]{(long)3L, (long)2L, (long)1L}))).Equals((new List<long>(new long[]{(long)2L, (long)2L})))); Debug.Assert(Derivative((new List<long>(new long[]{(long)3L, (long)2L, (long)1L, (long)0L, (long)4L}))).Equals((new List<long>(new long[]{(long)2L, (long)2L, (long)0L, (long)16L})))); Debug.Assert(Derivative((new List<long>(new long[]{(long)1L}))).Equals((new List<long>()))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_62_derivative.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // FibFib数列はフィボナッチ数列に似た数列で、以下のように定義される: // fibfib(0) == 0 // fibfib(1) == 0 // fibfib(2) == 1 // fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3). // fibfib数列のn番目の要素を効率よく計算する関数を書いてください。 // >>> Fibfib((1L)) // (0L) // >>> Fibfib((5L)) // (4L) // >>> Fibfib((8L)) // (24L) public static long Fibfib(long n) {
reworded
transform
HumanEval_63_fibfib
} public static void Main(string[] args) { Debug.Assert(Fibfib((2L)) == (1L)); Debug.Assert(Fibfib((1L)) == (0L)); Debug.Assert(Fibfib((5L)) == (4L)); Debug.Assert(Fibfib((8L)) == (24L)); Debug.Assert(Fibfib((10L)) == (81L)); Debug.Assert(Fibfib((12L)) == (274L)); Debug.Assert(Fibfib((14L)) == (927L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_63_fibfib.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 単語を表す文字列を引数とし、その文字列に含まれる母音の数を返す // 関数 vowels_count を書きなさい。この場合の母音は'a', 'e', 'i', 'o', 'u'である。 // ここで、与えられた単語の末尾にある場合のみ、'y'も母音とする。 // 例:: // >>> VowelsCount(("abcde")) // (2L) // >>> VowelsCount(("ACEDY")) // (3L) public static long VowelsCount(string s) {
reworded
transform
HumanEval_64_vowels_count
} public static void Main(string[] args) { Debug.Assert(VowelsCount(("abcde")) == (2L)); Debug.Assert(VowelsCount(("Alone")) == (3L)); Debug.Assert(VowelsCount(("key")) == (2L)); Debug.Assert(VowelsCount(("bye")) == (1L)); Debug.Assert(VowelsCount(("keY")) == (2L)); Debug.Assert(VowelsCount(("bYe")) == (1L)); Debug.Assert(VowelsCount(("ACEDY")) == (3L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_64_vowels_count.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 整数 x の桁を循環シフトする。shift 分だけ桁を右にシフトし、結果を文字列として返す。 // もし、shift > 桁数なら、桁を反転して返す。 // >>> CircularShift((12L), (1L)) // ("21") // >>> CircularShift((12L), (2L)) // ("12") public static string CircularShift(long x, long shift) {
reworded
transform
HumanEval_65_circular_shift
} public static void Main(string[] args) { Debug.Assert(CircularShift((100L), (2L)).Equals(("001"))); Debug.Assert(CircularShift((12L), (2L)).Equals(("12"))); Debug.Assert(CircularShift((97L), (8L)).Equals(("79"))); Debug.Assert(CircularShift((12L), (1L)).Equals(("21"))); Debug.Assert(CircularShift((11L), (101L)).Equals(("11"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_65_circular_shift.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // タスク // 文字列を引数にとり、英大文字のみのASCIIコードの和を返す関数を書く。 // 例: // >>> Digitsum(("")) // (0L) // >>> Digitsum(("abAB")) // (131L) // >>> Digitsum(("abcCd")) // (67L) // >>> Digitsum(("helloE")) // (69L) // >>> Digitsum(("woArBld")) // (131L) // >>> Digitsum(("aAaaaXa")) // (153L) public static long Digitsum(string s) {
reworded
transform
HumanEval_66_digitSum
} public static void Main(string[] args) { Debug.Assert(Digitsum(("")) == (0L)); Debug.Assert(Digitsum(("abAB")) == (131L)); Debug.Assert(Digitsum(("abcCd")) == (67L)); Debug.Assert(Digitsum(("helloE")) == (69L)); Debug.Assert(Digitsum(("woArBld")) == (131L)); Debug.Assert(Digitsum(("aAaaaXa")) == (153L)); Debug.Assert(Digitsum((" How are yOu?")) == (151L)); Debug.Assert(Digitsum(("You arE Very Smart")) == (327L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_66_digitSum.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // この課題では、果物の入ったカゴに配られたリンゴとオレンジの数を表す文字列が // 与えられ、このカゴにはリンゴ、オレンジ、マンゴーの果実が入っている。オレンジ // とリンゴの総数を表す文字列と、かごの中の果物の総数を表す整数が与えられたら、 // かごの中のマンゴーの果物の数を返しなさい。 // たとえば: // >>> FruitDistribution(("5 apples and 6 oranges"), (19L)) // (8L) // >>> FruitDistribution(("0 apples and 1 oranges"), (3L)) // (2L) // >>> FruitDistribution(("2 apples and 3 oranges"), (100L)) // (95L) // >>> FruitDistribution(("100 apples and 1 oranges"), (120L)) // (19L) public static long FruitDistribution(string s, long n) {
reworded
transform
HumanEval_67_fruit_distribution
} public static void Main(string[] args) { Debug.Assert(FruitDistribution(("5 apples and 6 oranges"), (19L)) == (8L)); Debug.Assert(FruitDistribution(("5 apples and 6 oranges"), (21L)) == (10L)); Debug.Assert(FruitDistribution(("0 apples and 1 oranges"), (3L)) == (2L)); Debug.Assert(FruitDistribution(("1 apples and 0 oranges"), (3L)) == (2L)); Debug.Assert(FruitDistribution(("2 apples and 3 oranges"), (100L)) == (95L)); Debug.Assert(FruitDistribution(("2 apples and 3 oranges"), (5L)) == (0L)); Debug.Assert(FruitDistribution(("1 apples and 100 oranges"), (120L)) == (19L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_67_fruit_distribution.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 非負整数のノードを持つ木の枝を表す配列が与えられたとする。あなたの仕事は、 // ノードの1つを抜き取り、それを返すことである。 // 摘出されるノードは、最小偶数値を持つノードでなければならない。 // 同じ最小偶数値を持つノードが複数見つかった場合は、最小のインデックスを持つ // ノードを返す。 // 摘出されたノードは [ smalest_value, its index ] というリストで返されなければならない。 // 偶数値がない場合や与えられた配列が空の場合は [] を返します。 // 例 1: // >>> Pluck((new List<long>(new long[]{(long)4L, (long)2L, (long)3L}))) // (new List<long>(new long[]{(long)2L, (long)1L})) // 解説: 2は最小偶数値を持ち、最小インデックスを持つ。 // 例 2: // >>> Pluck((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))) // (new List<long>(new long[]{(long)2L, (long)1L})) // 例 3: // >>> Pluck((new List<long>())) // (new List<long>()) // 例 4: // >>> Pluck((new List<long>(new long[]{(long)5L, (long)0L, (long)3L, (long)0L, (long)4L, (long)2L}))) // (new List<long>(new long[]{(long)0L, (long)1L})) // 解説: 0は最小値だが、0は2つあるので、最小インデックスを持つ最初の0を選ぶ。 // 制約: // * 1 <= ノードの長さ <= 10000 // * 0 <= ノードの値 public static List<long> Pluck(List<long> arr) {
reworded
transform
HumanEval_68_pluck
} public static void Main(string[] args) { Debug.Assert(Pluck((new List<long>(new long[]{(long)4L, (long)2L, (long)3L}))).Equals((new List<long>(new long[]{(long)2L, (long)1L})))); Debug.Assert(Pluck((new List<long>(new long[]{(long)1L, (long)2L, (long)3L}))).Equals((new List<long>(new long[]{(long)2L, (long)1L})))); Debug.Assert(Pluck((new List<long>())).Equals((new List<long>()))); Debug.Assert(Pluck((new List<long>(new long[]{(long)5L, (long)0L, (long)3L, (long)0L, (long)4L, (long)2L}))).Equals((new List<long>(new long[]{(long)0L, (long)1L})))); Debug.Assert(Pluck((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)0L, (long)5L, (long)3L}))).Equals((new List<long>(new long[]{(long)0L, (long)3L})))); Debug.Assert(Pluck((new List<long>(new long[]{(long)5L, (long)4L, (long)8L, (long)4L, (long)8L}))).Equals((new List<long>(new long[]{(long)4L, (long)1L})))); Debug.Assert(Pluck((new List<long>(new long[]{(long)7L, (long)6L, (long)7L, (long)1L}))).Equals((new List<long>(new long[]{(long)6L, (long)1L})))); Debug.Assert(Pluck((new List<long>(new long[]{(long)7L, (long)9L, (long)7L, (long)1L}))).Equals((new List<long>()))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_68_pluck.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 正の整数の空でないリストが与えられる。0より大きく、その整数自身の値以上の頻度を // 持つ最大の整数を返せ。整数の頻度とは、それがリストに現れる回数である。 // のような値が存在しない場合は -1 を返す。 // 例: // >>> Search((new List<long>(new long[]{(long)4L, (long)1L, (long)2L, (long)2L, (long)3L, (long)1L}))) // (2L) // >>> Search((new List<long>(new long[]{(long)1L, (long)2L, (long)2L, (long)3L, (long)3L, (long)3L, (long)4L, (long)4L, (long)4L}))) // (3L) // >>> Search((new List<long>(new long[]{(long)5L, (long)5L, (long)4L, (long)4L, (long)4L}))) // (-1L) public static long Search(List<long> lst) {
reworded
transform
HumanEval_69_search
} public static void Main(string[] args) { Debug.Assert(Search((new List<long>(new long[]{(long)5L, (long)5L, (long)5L, (long)5L, (long)1L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)4L, (long)1L, (long)4L, (long)1L, (long)4L, (long)4L}))) == (4L)); Debug.Assert(Search((new List<long>(new long[]{(long)3L, (long)3L}))) == (-1L)); Debug.Assert(Search((new List<long>(new long[]{(long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L, (long)8L}))) == (8L)); Debug.Assert(Search((new List<long>(new long[]{(long)2L, (long)3L, (long)3L, (long)2L, (long)2L}))) == (2L)); Debug.Assert(Search((new List<long>(new long[]{(long)2L, (long)7L, (long)8L, (long)8L, (long)4L, (long)8L, (long)7L, (long)3L, (long)9L, (long)6L, (long)5L, (long)10L, (long)4L, (long)3L, (long)6L, (long)7L, (long)1L, (long)7L, (long)4L, (long)10L, (long)8L, (long)1L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)3L, (long)2L, (long)8L, (long)2L}))) == (2L)); Debug.Assert(Search((new List<long>(new long[]{(long)6L, (long)7L, (long)1L, (long)8L, (long)8L, (long)10L, (long)5L, (long)8L, (long)5L, (long)3L, (long)10L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)8L, (long)8L, (long)3L, (long)6L, (long)5L, (long)6L, (long)4L}))) == (-1L)); Debug.Assert(Search((new List<long>(new long[]{(long)6L, (long)9L, (long)6L, (long)7L, (long)1L, (long)4L, (long)7L, (long)1L, (long)8L, (long)8L, (long)9L, (long)8L, (long)10L, (long)10L, (long)8L, (long)4L, (long)10L, (long)4L, (long)10L, (long)1L, (long)2L, (long)9L, (long)5L, (long)7L, (long)9L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)1L, (long)9L, (long)10L, (long)1L, (long)3L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)6L, (long)9L, (long)7L, (long)5L, (long)8L, (long)7L, (long)5L, (long)3L, (long)7L, (long)5L, (long)10L, (long)10L, (long)3L, (long)6L, (long)10L, (long)2L, (long)8L, (long)6L, (long)5L, (long)4L, (long)9L, (long)5L, (long)3L, (long)10L}))) == (5L)); Debug.Assert(Search((new List<long>(new long[]{(long)1L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)8L, (long)8L, (long)10L, (long)6L, (long)4L, (long)3L, (long)5L, (long)8L, (long)2L, (long)4L, (long)2L, (long)8L, (long)4L, (long)6L, (long)10L, (long)4L, (long)2L, (long)1L, (long)10L, (long)2L, (long)1L, (long)1L, (long)5L}))) == (4L)); Debug.Assert(Search((new List<long>(new long[]{(long)2L, (long)10L, (long)4L, (long)8L, (long)2L, (long)10L, (long)5L, (long)1L, (long)2L, (long)9L, (long)5L, (long)5L, (long)6L, (long)3L, (long)8L, (long)6L, (long)4L, (long)10L}))) == (2L)); Debug.Assert(Search((new List<long>(new long[]{(long)1L, (long)6L, (long)10L, (long)1L, (long)6L, (long)9L, (long)10L, (long)8L, (long)6L, (long)8L, (long)7L, (long)3L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)9L, (long)2L, (long)4L, (long)1L, (long)5L, (long)1L, (long)5L, (long)2L, (long)5L, (long)7L, (long)7L, (long)7L, (long)3L, (long)10L, (long)1L, (long)5L, (long)4L, (long)2L, (long)8L, (long)4L, (long)1L, (long)9L, (long)10L, (long)7L, (long)10L, (long)2L, (long)8L, (long)10L, (long)9L, (long)4L}))) == (4L)); Debug.Assert(Search((new List<long>(new long[]{(long)2L, (long)6L, (long)4L, (long)2L, (long)8L, (long)7L, (long)5L, (long)6L, (long)4L, (long)10L, (long)4L, (long)6L, (long)3L, (long)7L, (long)8L, (long)8L, (long)3L, (long)1L, (long)4L, (long)2L, (long)2L, (long)10L, (long)7L}))) == (4L)); Debug.Assert(Search((new List<long>(new long[]{(long)9L, (long)8L, (long)6L, (long)10L, (long)2L, (long)6L, (long)10L, (long)2L, (long)7L, (long)8L, (long)10L, (long)3L, (long)8L, (long)2L, (long)6L, (long)2L, (long)3L, (long)1L}))) == (2L)); Debug.Assert(Search((new List<long>(new long[]{(long)5L, (long)5L, (long)3L, (long)9L, (long)5L, (long)6L, (long)3L, (long)2L, (long)8L, (long)5L, (long)6L, (long)10L, (long)10L, (long)6L, (long)8L, (long)4L, (long)10L, (long)7L, (long)7L, (long)10L, (long)8L}))) == (-1L)); Debug.Assert(Search((new List<long>(new long[]{(long)10L}))) == (-1L)); Debug.Assert(Search((new List<long>(new long[]{(long)9L, (long)7L, (long)7L, (long)2L, (long)4L, (long)7L, (long)2L, (long)10L, (long)9L, (long)7L, (long)5L, (long)7L, (long)2L}))) == (2L)); Debug.Assert(Search((new List<long>(new long[]{(long)5L, (long)4L, (long)10L, (long)2L, (long)1L, (long)1L, (long)10L, (long)3L, (long)6L, (long)1L, (long)8L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)7L, (long)9L, (long)9L, (long)9L, (long)3L, (long)4L, (long)1L, (long)5L, (long)9L, (long)1L, (long)2L, (long)1L, (long)1L, (long)10L, (long)7L, (long)5L, (long)6L, (long)7L, (long)6L, (long)7L, (long)7L, (long)6L}))) == (1L)); Debug.Assert(Search((new List<long>(new long[]{(long)3L, (long)10L, (long)10L, (long)9L, (long)2L}))) == (-1L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_69_search.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 整数のリストが与えられたとき、リストを奇妙な順序で返す。 // 奇妙なソートとは、最小値から始まり、残りの整数の最大値、最小値の順で // ソートすることである。 // 例: // >>> StrangeSortList((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))) // (new List<long>(new long[]{(long)1L, (long)4L, (long)2L, (long)3L})) // >>> StrangeSortList((new List<long>(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))) // (new List<long>(new long[]{(long)5L, (long)5L, (long)5L, (long)5L})) // >>> StrangeSortList((new List<long>())) // (new List<long>()) public static List<long> StrangeSortList(List<long> lst) {
reworded
transform
HumanEval_70_strange_sort_list
} public static void Main(string[] args) { Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L}))).Equals((new List<long>(new long[]{(long)1L, (long)4L, (long)2L, (long)3L})))); Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L}))).Equals((new List<long>(new long[]{(long)5L, (long)9L, (long)6L, (long)8L, (long)7L})))); Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals((new List<long>(new long[]{(long)1L, (long)5L, (long)2L, (long)4L, (long)3L})))); Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)5L, (long)6L, (long)7L, (long)8L, (long)9L, (long)1L}))).Equals((new List<long>(new long[]{(long)1L, (long)9L, (long)5L, (long)8L, (long)6L, (long)7L})))); Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)5L, (long)5L, (long)5L, (long)5L}))).Equals((new List<long>(new long[]{(long)5L, (long)5L, (long)5L, (long)5L})))); Debug.Assert(StrangeSortList((new List<long>())).Equals((new List<long>()))); Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L, (long)7L, (long)8L}))).Equals((new List<long>(new long[]{(long)1L, (long)8L, (long)2L, (long)7L, (long)3L, (long)6L, (long)4L, (long)5L})))); Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)0L, (long)2L, (long)2L, (long)2L, (long)5L, (long)5L, (long)-5L, (long)-5L}))).Equals((new List<long>(new long[]{(long)-5L, (long)5L, (long)-5L, (long)5L, (long)0L, (long)2L, (long)2L, (long)2L})))); Debug.Assert(StrangeSortList((new List<long>(new long[]{(long)111111L}))).Equals((new List<long>(new long[]{(long)111111L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_70_strange_sort_list.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 三角形の3辺の長さが与えられた。3辺が有効な三角形を形成していれば、 // 三角形の面積を小数点以下2桁で四捨五入して返す。そうでない場合は-1を // 返す。 // 任意の2辺の和が3辺より大きいとき、3辺は有効な三角形となる。 // 例: // >>> TriangleArea((3L), (4L), (5L)) // (6.0f) // >>> TriangleArea((1L), (2L), (10L)) // (float)-1L public static float TriangleArea(long a, long b, long c) {
reworded
transform
HumanEval_71_triangle_area
} public static void Main(string[] args) { Debug.Assert(TriangleArea((3L), (4L), (5L)) == (6.0f)); Debug.Assert(TriangleArea((1L), (2L), (10L)) == (float)-1L); Debug.Assert(TriangleArea((4L), (8L), (5L)) == (8.18f)); Debug.Assert(TriangleArea((2L), (2L), (2L)) == (1.73f)); Debug.Assert(TriangleArea((1L), (2L), (3L)) == (float)-1L); Debug.Assert(TriangleArea((10L), (5L), (7L)) == (16.25f)); Debug.Assert(TriangleArea((2L), (6L), (3L)) == (float)-1L); Debug.Assert(TriangleArea((1L), (1L), (1L)) == (0.43f)); Debug.Assert(TriangleArea((2L), (2L), (10L)) == (float)-1L); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_71_triangle_area.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 物体qが飛べばtrueを、そうでなければfalseを返す関数を書け。 // 物体qはバランスが取れていて(つまり、リストが回文であって)、その要素の和が // 最大荷重w以下であれば飛ぶ。 // 例: // >>> WillItFly((new List<long>(new long[]{(long)1L, (long)2L})), (5L)) // (false) // # 1+2 は最大荷重以下であるが、バランスが取れていない // >>> WillItFly((new List<long>(new long[]{(long)3L, (long)2L, (long)3L})), (1L)) // (false) // # バランスが取れているが、3+2+3 は最大荷重を超える // >>> WillItFly((new List<long>(new long[]{(long)3L, (long)2L, (long)3L})), (9L)) // (true) // # 3+2+3 は最大荷重以下であり、バランスも取れている // >>> WillItFly((new List<long>(new long[]{(long)3L})), (5L)) // (true) // # 3 は最大荷重以下であり、バランスも取れている public static bool WillItFly(List<long> q, long w) {
reworded
transform
HumanEval_72_will_it_fly
} public static void Main(string[] args) { Debug.Assert(WillItFly((new List<long>(new long[]{(long)3L, (long)2L, (long)3L})), (9L)) == (true)); Debug.Assert(WillItFly((new List<long>(new long[]{(long)1L, (long)2L})), (5L)) == (false)); Debug.Assert(WillItFly((new List<long>(new long[]{(long)3L})), (5L)) == (true)); Debug.Assert(WillItFly((new List<long>(new long[]{(long)3L, (long)2L, (long)3L})), (1L)) == (false)); Debug.Assert(WillItFly((new List<long>(new long[]{(long)1L, (long)2L, (long)3L})), (6L)) == (false)); Debug.Assert(WillItFly((new List<long>(new long[]{(long)5L})), (5L)) == (true)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_72_will_it_fly.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 整数の配列arrが与えられたとき、その配列を回文配列にするために // 必要な要素の最小数を求めよ。回文配列とは、前からも後からも同じ // ようになる配列のことである。1回の変更で、1つの要素を他の任意の // 要素に変更できる。 // 例えば: // >>> SmallestChange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L}))) // (4L) // >>> SmallestChange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L, (long)2L}))) // (1L) // >>> SmallestChange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)1L}))) // (0L) public static long SmallestChange(List<long> arr) {
reworded
transform
HumanEval_73_smallest_change
} public static void Main(string[] args) { Debug.Assert(SmallestChange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)5L, (long)4L, (long)7L, (long)9L, (long)6L}))) == (4L)); Debug.Assert(SmallestChange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)3L, (long)2L, (long)2L}))) == (1L)); Debug.Assert(SmallestChange((new List<long>(new long[]{(long)1L, (long)4L, (long)2L}))) == (1L)); Debug.Assert(SmallestChange((new List<long>(new long[]{(long)1L, (long)4L, (long)4L, (long)2L}))) == (1L)); Debug.Assert(SmallestChange((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)2L, (long)1L}))) == (0L)); Debug.Assert(SmallestChange((new List<long>(new long[]{(long)3L, (long)1L, (long)1L, (long)3L}))) == (0L)); Debug.Assert(SmallestChange((new List<long>(new long[]{(long)1L}))) == (0L)); Debug.Assert(SmallestChange((new List<long>(new long[]{(long)0L, (long)1L}))) == (1L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_73_smallest_change.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 2つの文字列リストを受け取り、リストの全文字数の合計がもう一方 // のリストより少ないリストを返す関数を書きなさい。 // もし2つのリストの文字数が同じなら、最初のリストを返す。 // 例 // >>> TotalMatch((new List<string>()), (new List<string>())) // (new List<string>()) // >>> TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hI", (string)"Hi"}))) // (new List<string>(new string[]{(string)"hI", (string)"Hi"})) // >>> TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hi", (string)"hi", (string)"admin", (string)"project"}))) // (new List<string>(new string[]{(string)"hi", (string)"admin"})) // >>> TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hI", (string)"hi", (string)"hi"}))) // (new List<string>(new string[]{(string)"hI", (string)"hi", (string)"hi"})) // >>> TotalMatch((new List<string>(new string[]{(string)"4"})), (new List<string>(new string[]{(string)"1", (string)"2", (string)"3", (string)"4", (string)"5"}))) // (new List<string>(new string[]{(string)"4"})) public static List<string> TotalMatch(List<string> lst1, List<string> lst2) {
reworded
transform
HumanEval_74_total_match
} public static void Main(string[] args) { Debug.Assert(TotalMatch((new List<string>()), (new List<string>())).Equals((new List<string>()))); Debug.Assert(TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hi", (string)"hi"}))).Equals((new List<string>(new string[]{(string)"hi", (string)"hi"})))); Debug.Assert(TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hi", (string)"hi", (string)"admin", (string)"project"}))).Equals((new List<string>(new string[]{(string)"hi", (string)"admin"})))); Debug.Assert(TotalMatch((new List<string>(new string[]{(string)"4"})), (new List<string>(new string[]{(string)"1", (string)"2", (string)"3", (string)"4", (string)"5"}))).Equals((new List<string>(new string[]{(string)"4"})))); Debug.Assert(TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hI", (string)"Hi"}))).Equals((new List<string>(new string[]{(string)"hI", (string)"Hi"})))); Debug.Assert(TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hI", (string)"hi", (string)"hi"}))).Equals((new List<string>(new string[]{(string)"hI", (string)"hi", (string)"hi"})))); Debug.Assert(TotalMatch((new List<string>(new string[]{(string)"hi", (string)"admin"})), (new List<string>(new string[]{(string)"hI", (string)"hi", (string)"hii"}))).Equals((new List<string>(new string[]{(string)"hi", (string)"admin"})))); Debug.Assert(TotalMatch((new List<string>()), (new List<string>(new string[]{(string)"this"}))).Equals((new List<string>()))); Debug.Assert(TotalMatch((new List<string>(new string[]{(string)"this"})), (new List<string>())).Equals((new List<string>()))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_74_total_match.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 与えられた数が3つの素数の掛け算であればtrueを、そうでなければfalseを返す // 関数を書きなさい。 // 引数 aは100以下を既知としていよい。 // 例: // >>> IsMultiplyPrime((30L)) // (true) // 30 = 2 * 3 * 5 public static bool IsMultiplyPrime(long a) {
reworded
transform
HumanEval_75_is_multiply_prime
} public static void Main(string[] args) { Debug.Assert(IsMultiplyPrime((5L)) == (false)); Debug.Assert(IsMultiplyPrime((30L)) == (true)); Debug.Assert(IsMultiplyPrime((8L)) == (true)); Debug.Assert(IsMultiplyPrime((10L)) == (false)); Debug.Assert(IsMultiplyPrime((125L)) == (true)); Debug.Assert(IsMultiplyPrime((105L)) == (true)); Debug.Assert(IsMultiplyPrime((126L)) == (false)); Debug.Assert(IsMultiplyPrime((729L)) == (false)); Debug.Assert(IsMultiplyPrime((891L)) == (false)); Debug.Assert(IsMultiplyPrime((1001L)) == (true)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_75_is_multiply_prime.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // あなたのタスクは、ある数xがnの単純なべき乗である場合にtrueを、 // それ以外の場合にfalseを返す関数を書くことである。 // xは、n**int=xのとき、nの単純なべき乗である。 // 例えば: // >>> IsSimplePower((1L), (4L)) // (true) // >>> IsSimplePower((2L), (2L)) // (true) // >>> IsSimplePower((8L), (2L)) // (true) // >>> IsSimplePower((3L), (2L)) // (false) // >>> IsSimplePower((3L), (1L)) // (false) // >>> IsSimplePower((5L), (3L)) // (false) public static bool IsSimplePower(long x, long n) {
reworded
transform
HumanEval_76_is_simple_power
} public static void Main(string[] args) { Debug.Assert(IsSimplePower((16L), (2L)) == (true)); Debug.Assert(IsSimplePower((143214L), (16L)) == (false)); Debug.Assert(IsSimplePower((4L), (2L)) == (true)); Debug.Assert(IsSimplePower((9L), (3L)) == (true)); Debug.Assert(IsSimplePower((16L), (4L)) == (true)); Debug.Assert(IsSimplePower((24L), (2L)) == (false)); Debug.Assert(IsSimplePower((128L), (4L)) == (false)); Debug.Assert(IsSimplePower((12L), (6L)) == (false)); Debug.Assert(IsSimplePower((1L), (1L)) == (true)); Debug.Assert(IsSimplePower((1L), (12L)) == (true)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_76_is_simple_power.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 整数aを受け取り、この整数がある整数の3乗である場合にtrue // を返す関数を書きなさい。 // 注意:入力は常に処理可能であると仮定してよい。 // 例: // >>> Iscube((1L)) // (true) // >>> Iscube((2L)) // (false) // >>> Iscube((-1L)) // (true) // >>> Iscube((64L)) // (true) // >>> Iscube((0L)) // (true) // >>> Iscube((180L)) // (false) public static bool Iscube(long a) {
reworded
transform
HumanEval_77_iscube
} public static void Main(string[] args) { Debug.Assert(Iscube((1L)) == (true)); Debug.Assert(Iscube((2L)) == (false)); Debug.Assert(Iscube((-1L)) == (true)); Debug.Assert(Iscube((64L)) == (true)); Debug.Assert(Iscube((180L)) == (false)); Debug.Assert(Iscube((1000L)) == (true)); Debug.Assert(Iscube((0L)) == (true)); Debug.Assert(Iscube((1729L)) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_77_iscube.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 16進数の数字を文字列として受け取り、その中に含まれる素数である16進数の桁数を // カウントする関数を作成するタスクが与えられました。素数とは、1より大きく、 // 2つのより小さい自然数の積でない自然数です。 // 16進数の桁には0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, Fがあります。 // 素数としては2, 3, 5, 7, 11, 13, 17,...があります。 // したがって、次の数字のいずれかがいくつあるかを判定する必要があります: // 2, 3, 5, 7, B(=10進数で11), D(=10進数で13) // 注意:入力は常に正確、または空の文字列であり、記号A, B, C, D, E, Fは常に // 大文字であると仮定してよいです。 // 例: // >>> HexKey(("AB")) // (1L) // >>> HexKey(("1077E")) // (2L) // >>> HexKey(("ABED1A33")) // (4L) // >>> HexKey(("123456789ABCDEF0")) // (6L) // >>> HexKey(("2020")) // (2L) public static long HexKey(string num) {
reworded
transform
HumanEval_78_hex_key
} public static void Main(string[] args) { Debug.Assert(HexKey(("AB")) == (1L)); Debug.Assert(HexKey(("1077E")) == (2L)); Debug.Assert(HexKey(("ABED1A33")) == (4L)); Debug.Assert(HexKey(("2020")) == (2L)); Debug.Assert(HexKey(("123456789ABCDEF0")) == (6L)); Debug.Assert(HexKey(("112233445566778899AABBCCDDEEFF00")) == (12L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_78_hex_key.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 10進数形式の数値が与えられ、あなたのタスクはそれを2進数形式に変換することである。 // この関数は、文字列を返し、その各文字は2進数を表す。文字列の各文字は'0'か'1'である。 // なお、文字列の最初と最後には'db'という余分な文字をつける。 // この文字は書式を助けるためにある。 // 例: // >>> DecimalToBinary((15L)) // ("db1111db") // >>> DecimalToBinary((32L)) // ("db100000db") public static string DecimalToBinary(long decimalNum) {
reworded
transform
HumanEval_79_decimal_to_binary
} public static void Main(string[] args) { Debug.Assert(DecimalToBinary((0L)).Equals(("db0db"))); Debug.Assert(DecimalToBinary((32L)).Equals(("db100000db"))); Debug.Assert(DecimalToBinary((103L)).Equals(("db1100111db"))); Debug.Assert(DecimalToBinary((15L)).Equals(("db1111db"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_79_decimal_to_binary.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // あなたは文字列sが与えられる。 // あなたのタスクは、その文字列が幸せかどうかをチェックすることである。 // 文字列は幸せとは、文字列の長さが少なくとも3以上で、連続する3文字がすべて異なる場合である。 // 例えば: // >>> IsHappy(("a")) // (false) // >>> IsHappy(("aa")) // (false) // >>> IsHappy(("abcd")) // (true) // >>> IsHappy(("aabb")) // (false) // >>> IsHappy(("adb")) // (true) // >>> IsHappy(("xyy")) // (false) public static bool IsHappy(string s) {
reworded
transform
HumanEval_80_is_happy
} public static void Main(string[] args) { Debug.Assert(IsHappy(("a")) == (false)); Debug.Assert(IsHappy(("aa")) == (false)); Debug.Assert(IsHappy(("abcd")) == (true)); Debug.Assert(IsHappy(("aabb")) == (false)); Debug.Assert(IsHappy(("adb")) == (true)); Debug.Assert(IsHappy(("xyy")) == (false)); Debug.Assert(IsHappy(("iopaxpoi")) == (true)); Debug.Assert(IsHappy(("iopaxioi")) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_80_is_happy.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 学期最終週、教師は生徒に成績をつけなければならない。教師は独自のアルゴリズムで採点している。 // 問題は、彼女が成績評価に使ったコードを紛失してしまったことです。 // 彼女は何人かの生徒のGPAのリストをあなたに渡したので、あなたは次の表を使って評点のリストを // 出力できる関数を書くことになりました。: // GPA | Letter grade // 4.0 A+ // > 3.7 A // > 3.3 A- // > 3.0 B+ // > 2.7 B // > 2.3 B- // > 2.0 C+ // > 1.7 C // > 1.3 C- // > 1.0 D+ // > 0.7 D // > 0.0 D- // 0.0 E // 例: // >>> GradeEquation((new List<float>(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f}))) // (new List<string>(new string[]{(string)"A+", (string)"B", (string)"C-", (string)"C", (string)"A-"})) public static List<string> NumericalLetterGrade(List<float> grades) {
reworded
transform
HumanEval_81_numerical_letter_grade
} public static void Main(string[] args) { Debug.Assert(NumericalLetterGrade((new List<float>(new float[]{(float)4.0f, (float)3L, (float)1.7f, (float)2L, (float)3.5f}))).Equals((new List<string>(new string[]{(string)"A+", (string)"B", (string)"C-", (string)"C", (string)"A-"})))); Debug.Assert(NumericalLetterGrade((new List<float>(new float[]{(float)1.2f}))).Equals((new List<string>(new string[]{(string)"D+"})))); Debug.Assert(NumericalLetterGrade((new List<float>(new float[]{(float)0.5f}))).Equals((new List<string>(new string[]{(string)"D-"})))); Debug.Assert(NumericalLetterGrade((new List<float>(new float[]{(float)0.0f}))).Equals((new List<string>(new string[]{(string)"E"})))); Debug.Assert(NumericalLetterGrade((new List<float>(new float[]{(float)1.0f, (float)0.3f, (float)1.5f, (float)2.8f, (float)3.3f}))).Equals((new List<string>(new string[]{(string)"D", (string)"D-", (string)"C-", (string)"B", (string)"B+"})))); Debug.Assert(NumericalLetterGrade((new List<float>(new float[]{(float)0.0f, (float)0.7f}))).Equals((new List<string>(new string[]{(string)"E", (string)"D-"})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_81_numerical_letter_grade.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列を受け取り、文字列の長さが素数であればtrueを、そうでなければfalseを返す関数を書く。 // 例 // >>> PrimeLength(("Hello")) // (true) // >>> PrimeLength(("abcdcba")) // (true) // >>> PrimeLength(("kittens")) // (true) // >>> PrimeLength(("orange")) // (false) public static bool PrimeLength(string str) {
reworded
transform
HumanEval_82_prime_length
} public static void Main(string[] args) { Debug.Assert(PrimeLength(("Hello")) == (true)); Debug.Assert(PrimeLength(("abcdcba")) == (true)); Debug.Assert(PrimeLength(("kittens")) == (true)); Debug.Assert(PrimeLength(("orange")) == (false)); Debug.Assert(PrimeLength(("wow")) == (true)); Debug.Assert(PrimeLength(("world")) == (true)); Debug.Assert(PrimeLength(("MadaM")) == (true)); Debug.Assert(PrimeLength(("Wow")) == (true)); Debug.Assert(PrimeLength(("")) == (false)); Debug.Assert(PrimeLength(("HI")) == (true)); Debug.Assert(PrimeLength(("go")) == (true)); Debug.Assert(PrimeLength(("gogo")) == (false)); Debug.Assert(PrimeLength(("aaaaaaaaaaaaaaa")) == (false)); Debug.Assert(PrimeLength(("Madam")) == (true)); Debug.Assert(PrimeLength(("M")) == (false)); Debug.Assert(PrimeLength(("0")) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_82_prime_length.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 正の整数 n が与えられたとき、n 桁の正の整数で 1 で始まるか // もしくは終わる数のカウントを返す public static long StartsOneEnds(long n) {
reworded
transform
HumanEval_83_starts_one_ends
} public static void Main(string[] args) { Debug.Assert(StartsOneEnds((1L)) == (1L)); Debug.Assert(StartsOneEnds((2L)) == (18L)); Debug.Assert(StartsOneEnds((3L)) == (180L)); Debug.Assert(StartsOneEnds((4L)) == (1800L)); Debug.Assert(StartsOneEnds((5L)) == (18000L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_83_starts_one_ends.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 正の整数 N が与えられた時、その桁の総和を2進数で返す。 // >>> Solve((1000L)) // ("1") // >>> Solve((150L)) // ("110") // >>> Solve((147L)) // ("1100") // 数: // @N 整数 // 制約: 0 ≤ N ≤ 10000. // 返り値: // 2進数表記の文字列 public static string Solve(long N) {
reworded
transform
HumanEval_84_solve
} public static void Main(string[] args) { Debug.Assert(Solve((1000L)).Equals(("1"))); Debug.Assert(Solve((150L)).Equals(("110"))); Debug.Assert(Solve((147L)).Equals(("1100"))); Debug.Assert(Solve((333L)).Equals(("1001"))); Debug.Assert(Solve((963L)).Equals(("10010"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_84_solve.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 空でない整数のリストlstが与えられたとき、奇数のインデックスにある偶数の要素を加える。 // 例: // >>> Add((new List<long>(new long[]{(long)4L, (long)2L, (long)6L, (long)7L}))) // (2L) public static long Add(List<long> lst) {
reworded
transform
HumanEval_85_add
} public static void Main(string[] args) { Debug.Assert(Add((new List<long>(new long[]{(long)4L, (long)88L}))) == (88L)); Debug.Assert(Add((new List<long>(new long[]{(long)4L, (long)5L, (long)6L, (long)7L, (long)2L, (long)122L}))) == (122L)); Debug.Assert(Add((new List<long>(new long[]{(long)4L, (long)0L, (long)6L, (long)7L}))) == (0L)); Debug.Assert(Add((new List<long>(new long[]{(long)4L, (long)4L, (long)6L, (long)8L}))) == (12L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_85_add.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列を引数として受け取り、その「順序付けられたバージョン」を返す関数を作成してください。 // 順序付けられたバージョンとは、各単語(空白で区切られた)の文字がASCII値に基づいて昇順に // 並べ替えられた新しい単語に置き換えられた文字列です。 // 注意:文章内の単語と空白の順序はそのまま保ってください。 // 例えば: // >>> AntiShuffle(("Hi")) // ("Hi") // >>> AntiShuffle(("hello")) // ("ehllo") // >>> AntiShuffle(("Hello World!!!")) // ("Hello !!!Wdlor") public static string AntiShuffle(string s) {
reworded
transform
HumanEval_86_anti_shuffle
} public static void Main(string[] args) { Debug.Assert(AntiShuffle(("Hi")).Equals(("Hi"))); Debug.Assert(AntiShuffle(("hello")).Equals(("ehllo"))); Debug.Assert(AntiShuffle(("number")).Equals(("bemnru"))); Debug.Assert(AntiShuffle(("abcd")).Equals(("abcd"))); Debug.Assert(AntiShuffle(("Hello World!!!")).Equals(("Hello !!!Wdlor"))); Debug.Assert(AntiShuffle(("")).Equals((""))); Debug.Assert(AntiShuffle(("Hi. My name is Mister Robot. How are you?")).Equals((".Hi My aemn is Meirst .Rboot How aer ?ouy"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_86_anti_shuffle.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 2次元のデータがネストされたリストとして与えられる。これは行列に似ているが、 // 列とは異なり、各行は異なる数の列を含むことができる。 // lstと整数xが与えられたとき、リスト内の整数xを見つけ、各タプルが0から始まる // 座標(行、列)であるようなタプルのリスト[(x1, y1), (x2, y2) ...]を返す。 // 座標を最初は行の昇順でソートする。 // また、行の座標を列の降順でソートする。 // 例: // >>> GetRow((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)) // (new List<Tuple<long, long>>(new Tuple<long, long>[]{(Tuple<long, long>)Tuple.Create(0L, 0L), (Tuple<long, long>)Tuple.Create(1L, 4L), (Tuple<long, long>)Tuple.Create(1L, 0L), (Tuple<long, long>)Tuple.Create(2L, 5L), (Tuple<long, long>)Tuple.Create(2L, 0L)})) // >>> GetRow((new List<List<long>>()), (1L)) // (new List<Tuple<long, long>>()) // >>> GetRow((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(), (List<long>)new List<long>(new long[]{(long)1L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L})})), (3L)) // (new List<Tuple<long, long>>(new Tuple<long, long>[]{(Tuple<long, long>)Tuple.Create(2L, 2L)})) public static List<Tuple<long, long>> GetRow(List<List<long>> lst, long x) {
reworded
transform
HumanEval_87_get_row
} public static void Main(string[] args) { Debug.Assert(GetRow((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List<Tuple<long, long>>(new Tuple<long, long>[]{(Tuple<long, long>)Tuple.Create(0L, 0L), (Tuple<long, long>)Tuple.Create(1L, 4L), (Tuple<long, long>)Tuple.Create(1L, 0L), (Tuple<long, long>)Tuple.Create(2L, 5L), (Tuple<long, long>)Tuple.Create(2L, 0L)})))); Debug.Assert(GetRow((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L})})), (2L)).Equals((new List<Tuple<long, long>>(new Tuple<long, long>[]{(Tuple<long, long>)Tuple.Create(0L, 1L), (Tuple<long, long>)Tuple.Create(1L, 1L), (Tuple<long, long>)Tuple.Create(2L, 1L), (Tuple<long, long>)Tuple.Create(3L, 1L), (Tuple<long, long>)Tuple.Create(4L, 1L), (Tuple<long, long>)Tuple.Create(5L, 1L)})))); Debug.Assert(GetRow((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)1L, (long)3L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)1L, (long)4L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)1L, (long)5L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)1L, (long)6L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L, (long)1L})})), (1L)).Equals((new List<Tuple<long, long>>(new Tuple<long, long>[]{(Tuple<long, long>)Tuple.Create(0L, 0L), (Tuple<long, long>)Tuple.Create(1L, 0L), (Tuple<long, long>)Tuple.Create(2L, 1L), (Tuple<long, long>)Tuple.Create(2L, 0L), (Tuple<long, long>)Tuple.Create(3L, 2L), (Tuple<long, long>)Tuple.Create(3L, 0L), (Tuple<long, long>)Tuple.Create(4L, 3L), (Tuple<long, long>)Tuple.Create(4L, 0L), (Tuple<long, long>)Tuple.Create(5L, 4L), (Tuple<long, long>)Tuple.Create(5L, 0L), (Tuple<long, long>)Tuple.Create(6L, 5L), (Tuple<long, long>)Tuple.Create(6L, 0L)})))); Debug.Assert(GetRow((new List<List<long>>()), (1L)).Equals((new List<Tuple<long, long>>()))); Debug.Assert(GetRow((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(new long[]{(long)1L})})), (2L)).Equals((new List<Tuple<long, long>>()))); Debug.Assert(GetRow((new List<List<long>>(new List<long>[]{(List<long>)new List<long>(), (List<long>)new List<long>(new long[]{(long)1L}), (List<long>)new List<long>(new long[]{(long)1L, (long)2L, (long)3L})})), (3L)).Equals((new List<Tuple<long, long>>(new Tuple<long, long>[]{(Tuple<long, long>)Tuple.Create(2L, 2L)})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_87_get_row.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 非負の整数からなる配列が与えられた場合、配列をソートしたコピーを返してください。 // 配列の最初の要素と最後の要素の和が奇数であれば、配列を昇順(小さい順)にソートします。 // その和が偶数であれば、配列を降順(大きい順)にソートします。 // 注意点: // * 与えられた配列自体を変更しないでください。 // : // >>> SortArray((new List<long>())) // (new List<long>()) // >>> SortArray((new List<long>(new long[]{(long)5L}))) // (new List<long>(new long[]{(long)5L})) // >>> SortArray((new List<long>(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L}))) // (new List<long>(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L, (long)5L})) // >>> SortArray((new List<long>(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L, (long)6L}))) // (new List<long>(new long[]{(long)6L, (long)5L, (long)4L, (long)3L, (long)2L, (long)1L, (long)0L})) public static List<long> SortArray(List<long> array) {
reworded
transform
HumanEval_88_sort_array
} public static void Main(string[] args) { Debug.Assert(SortArray((new List<long>())).Equals((new List<long>()))); Debug.Assert(SortArray((new List<long>(new long[]{(long)5L}))).Equals((new List<long>(new long[]{(long)5L})))); Debug.Assert(SortArray((new List<long>(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L}))).Equals((new List<long>(new long[]{(long)0L, (long)1L, (long)2L, (long)3L, (long)4L, (long)5L})))); Debug.Assert(SortArray((new List<long>(new long[]{(long)2L, (long)4L, (long)3L, (long)0L, (long)1L, (long)5L, (long)6L}))).Equals((new List<long>(new long[]{(long)6L, (long)5L, (long)4L, (long)3L, (long)2L, (long)1L, (long)0L})))); Debug.Assert(SortArray((new List<long>(new long[]{(long)2L, (long)1L}))).Equals((new List<long>(new long[]{(long)1L, (long)2L})))); Debug.Assert(SortArray((new List<long>(new long[]{(long)15L, (long)42L, (long)87L, (long)32L, (long)11L, (long)0L}))).Equals((new List<long>(new long[]{(long)0L, (long)11L, (long)15L, (long)32L, (long)42L, (long)87L})))); Debug.Assert(SortArray((new List<long>(new long[]{(long)21L, (long)14L, (long)23L, (long)11L}))).Equals((new List<long>(new long[]{(long)23L, (long)21L, (long)14L, (long)11L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_88_sort_array.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列を引数にとり、アルファベットを回転させて暗号化した // 文字列を返す関数encryptを作成せよ。 // アルファベットは、文字位置が2を2倍した4文字分だけ後ろにシフトされるように // 回転する。 // 例: // >>> Encrypt(("hi")) // ("lm") // >>> Encrypt(("asdfghjkl")) // ("ewhjklnop") // >>> Encrypt(("gf")) // ("kj") // >>> Encrypt(("et")) // ("ix") public static string Encrypt(string s) {
reworded
transform
HumanEval_89_encrypt
} public static void Main(string[] args) { Debug.Assert(Encrypt(("hi")).Equals(("lm"))); Debug.Assert(Encrypt(("asdfghjkl")).Equals(("ewhjklnop"))); Debug.Assert(Encrypt(("gf")).Equals(("kj"))); Debug.Assert(Encrypt(("et")).Equals(("ix"))); Debug.Assert(Encrypt(("faewfawefaewg")).Equals(("jeiajeaijeiak"))); Debug.Assert(Encrypt(("hellomyfriend")).Equals(("lippsqcjvmirh"))); Debug.Assert(Encrypt(("dxzdlmnilfuhmilufhlihufnmlimnufhlimnufhfucufh")).Equals(("hbdhpqrmpjylqmpyjlpmlyjrqpmqryjlpmqryjljygyjl"))); Debug.Assert(Encrypt(("a")).Equals(("e"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_89_encrypt.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 整数のリストが与えられる。 // リストの2番目に小さい要素を返す関数 next_smallest() を書きなさい。 // そのような要素がない場合は null を返す。 // >>> NextSmallest((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))) // 2L // >>> NextSmallest((new List<long>(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L}))) // 2L // >>> NextSmallest((new List<long>())) // null // >>> NextSmallest((new List<long>(new long[]{(long)1L, (long)1L}))) // null public static Nullable<long> NextSmallest(List<long> lst) {
reworded
transform
HumanEval_90_next_smallest
} public static void Main(string[] args) { Debug.Assert(NextSmallest((new List<long>(new long[]{(long)1L, (long)2L, (long)3L, (long)4L, (long)5L}))).Equals(2L)); Debug.Assert(NextSmallest((new List<long>(new long[]{(long)5L, (long)1L, (long)4L, (long)3L, (long)2L}))).Equals(2L)); Debug.Assert(NextSmallest((new List<long>())).Equals(null)); Debug.Assert(NextSmallest((new List<long>(new long[]{(long)1L, (long)1L}))).Equals(null)); Debug.Assert(NextSmallest((new List<long>(new long[]{(long)1L, (long)1L, (long)1L, (long)1L, (long)0L}))).Equals(1L)); Debug.Assert(NextSmallest((new List<long>(new long[]{(long)1L, (long)1L}))).Equals(null)); Debug.Assert(NextSmallest((new List<long>(new long[]{(long)-35L, (long)34L, (long)12L, (long)-45L}))).Equals(-35L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_90_next_smallest.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 単語の文字列が与えられ、あなたのタスクは退屈指数を数える // ことである。退屈指数とは、"I "で始まる文のことである。 // 文は'.'、’?’、'!'のいずれかで区切られる。 // 例えば: // >>> IsBored(("Hello world")) // (0L) // >>> IsBored(("The sky is blue. The sun is shining. I love this weather")) // (1L) public static long IsBored(string S) {
reworded
transform
HumanEval_91_is_bored
} public static void Main(string[] args) { Debug.Assert(IsBored(("Hello world")) == (0L)); Debug.Assert(IsBored(("Is the sky blue?")) == (0L)); Debug.Assert(IsBored(("I love It !")) == (1L)); Debug.Assert(IsBored(("bIt")) == (0L)); Debug.Assert(IsBored(("I feel good today. I will be productive. will kill It")) == (2L)); Debug.Assert(IsBored(("You and I are going for a walk")) == (0L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_91_is_bored.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 3つの数値を受け取る関数を作る。 // 1つの数値が他の2つの数値の和と等しく、すべての数値が整数である場合にtrueを返す。 // それ以外の場合はfalseを返す。 // 例 // >>> AnyInt((float)5L, (float)2L, (float)7L) // (true) // >>> AnyInt((float)3L, (float)2L, (float)2L) // (false) // >>> AnyInt((float)3L, (float)-2L, (float)1L) // (true) // >>> AnyInt((3.6f), (-2.2f), (float)2L) // (false) public static bool AnyInt(float x, float y, float z) {
reworded
transform
HumanEval_92_any_int
} public static void Main(string[] args) { Debug.Assert(AnyInt((float)2L, (float)3L, (float)1L) == (true)); Debug.Assert(AnyInt((2.5f), (float)2L, (float)3L) == (false)); Debug.Assert(AnyInt((1.5f), (float)5L, (3.5f)) == (false)); Debug.Assert(AnyInt((float)2L, (float)6L, (float)2L) == (false)); Debug.Assert(AnyInt((float)4L, (float)2L, (float)2L) == (true)); Debug.Assert(AnyInt((2.2f), (2.2f), (2.2f)) == (false)); Debug.Assert(AnyInt((float)-4L, (float)6L, (float)2L) == (true)); Debug.Assert(AnyInt((float)2L, (float)1L, (float)1L) == (true)); Debug.Assert(AnyInt((float)3L, (float)4L, (float)7L) == (true)); Debug.Assert(AnyInt((3.0f), (float)4L, (float)7L) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_92_any_int.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // メッセージを受け取り、すべての文字の大文字と小文字を入れ替え、 // メッセージ中のすべての母音を英語の母音の2つ前に現れる文字に置 // き換えるようにエンコードする関数を書きなさい。 // 文字だけを想定する。 // 例: // >>> Encode(("test")) // ("TGST") // >>> Encode(("This is a message")) // ("tHKS KS C MGSSCGG") public static string Encode(string message) {
reworded
transform
HumanEval_93_encode
} public static void Main(string[] args) { Debug.Assert(Encode(("TEST")).Equals(("tgst"))); Debug.Assert(Encode(("Mudasir")).Equals(("mWDCSKR"))); Debug.Assert(Encode(("YES")).Equals(("ygs"))); Debug.Assert(Encode(("This is a message")).Equals(("tHKS KS C MGSSCGG"))); Debug.Assert(Encode(("I DoNt KnOw WhAt tO WrItE")).Equals(("k dQnT kNqW wHcT Tq wRkTg"))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_93_encode.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 整数のリストが与えらる。 // 最大の素数を求め、その桁数の和を返す必要がある。 // 例: // >>> Skjkasdkd((new List<long>(new long[]{(long)0L, (long)3L, (long)2L, (long)1L, (long)3L, (long)5L, (long)7L, (long)4L, (long)5L, (long)5L, (long)5L, (long)2L, (long)181L, (long)32L, (long)4L, (long)32L, (long)3L, (long)2L, (long)32L, (long)324L, (long)4L, (long)3L}))) // (10L) // >>> Skjkasdkd((new List<long>(new long[]{(long)1L, (long)0L, (long)1L, (long)8L, (long)2L, (long)4597L, (long)2L, (long)1L, (long)3L, (long)40L, (long)1L, (long)2L, (long)1L, (long)2L, (long)4L, (long)2L, (long)5L, (long)1L}))) // (25L) // >>> Skjkasdkd((new List<long>(new long[]{(long)1L, (long)3L, (long)1L, (long)32L, (long)5107L, (long)34L, (long)83278L, (long)109L, (long)163L, (long)23L, (long)2323L, (long)32L, (long)30L, (long)1L, (long)9L, (long)3L}))) // (13L) // >>> Skjkasdkd((new List<long>(new long[]{(long)0L, (long)724L, (long)32L, (long)71L, (long)99L, (long)32L, (long)6L, (long)0L, (long)5L, (long)91L, (long)83L, (long)0L, (long)5L, (long)6L}))) // (11L) // >>> Skjkasdkd((new List<long>(new long[]{(long)0L, (long)81L, (long)12L, (long)3L, (long)1L, (long)21L}))) // (3L) // >>> Skjkasdkd((new List<long>(new long[]{(long)0L, (long)8L, (long)1L, (long)2L, (long)1L, (long)7L}))) // (7L) public static long Skjkasdkd(List<long> lst) {
reworded
transform
HumanEval_94_skjkasdkd
} public static void Main(string[] args) { Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)0L, (long)3L, (long)2L, (long)1L, (long)3L, (long)5L, (long)7L, (long)4L, (long)5L, (long)5L, (long)5L, (long)2L, (long)181L, (long)32L, (long)4L, (long)32L, (long)3L, (long)2L, (long)32L, (long)324L, (long)4L, (long)3L}))) == (10L)); Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)1L, (long)0L, (long)1L, (long)8L, (long)2L, (long)4597L, (long)2L, (long)1L, (long)3L, (long)40L, (long)1L, (long)2L, (long)1L, (long)2L, (long)4L, (long)2L, (long)5L, (long)1L}))) == (25L)); Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)1L, (long)3L, (long)1L, (long)32L, (long)5107L, (long)34L, (long)83278L, (long)109L, (long)163L, (long)23L, (long)2323L, (long)32L, (long)30L, (long)1L, (long)9L, (long)3L}))) == (13L)); Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)0L, (long)724L, (long)32L, (long)71L, (long)99L, (long)32L, (long)6L, (long)0L, (long)5L, (long)91L, (long)83L, (long)0L, (long)5L, (long)6L}))) == (11L)); Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)0L, (long)81L, (long)12L, (long)3L, (long)1L, (long)21L}))) == (3L)); Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)0L, (long)8L, (long)1L, (long)2L, (long)1L, (long)7L}))) == (7L)); Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)8191L}))) == (19L)); Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)8191L, (long)123456L, (long)127L, (long)7L}))) == (19L)); Debug.Assert(Skjkasdkd((new List<long>(new long[]{(long)127L, (long)97L, (long)8192L}))) == (10L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_94_skjkasdkd.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 辞書が与えられたとき、すべてのキーが小文字であればtrueを、 // すべてのキーが大文字の文字列であればfalseを返す。 // 与えられた辞書が空の場合、この関数は false を返す。 // 例: // >>> CheckDictCase((new Dictionary<string,string>(){{"a", "apple"}, {"b", "banana"}})) // (true) // >>> CheckDictCase((new Dictionary<string,string>(){{"a", "apple"}, {"A", "banana"}, {"B", "banana"}})) // (false) // >>> CheckDictCase((new Dictionary<string,string>(){{"a", "apple"}, {8L, "banana"}, {"a", "apple"}})) // (false) // >>> CheckDictCase((new Dictionary<string,string>(){{"Name", "John"}, {"Age", "36"}, {"City", "Houston"}})) // (false) // >>> CheckDictCase((new Dictionary<string,string>(){{"STATE", "NC"}, {"ZIP", "12345"}})) // (true) public static bool CheckDictCase(Dictionary<string,string> dict) {
reworded
transform
HumanEval_95_check_dict_case
} public static void Main(string[] args) { Debug.Assert(CheckDictCase((new Dictionary<string,string>(){{"p", "pineapple"}, {"b", "banana"}})) == (true)); Debug.Assert(CheckDictCase((new Dictionary<string,string>(){{"p", "pineapple"}, {"A", "banana"}, {"B", "banana"}})) == (false)); Debug.Assert(CheckDictCase((new Dictionary<string,string>(){{"p", "pineapple"}, {"5", "banana"}, {"a", "apple"}})) == (false)); Debug.Assert(CheckDictCase((new Dictionary<string,string>(){{"Name", "John"}, {"Age", "36"}, {"City", "Houston"}})) == (false)); Debug.Assert(CheckDictCase((new Dictionary<string,string>(){{"STATE", "NC"}, {"ZIP", "12345"}})) == (true)); Debug.Assert(CheckDictCase((new Dictionary<string,string>(){{"fruit", "Orange"}, {"taste", "Sweet"}})) == (true)); Debug.Assert(CheckDictCase((new Dictionary<string,string>())) == (false)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_95_check_dict_case.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 非負整数を受け取り、素数でnより小さい最初のn個の // 整数の配列を返す関数を実装せよ。 // 例えば: // >>> CountUpTo((5L)) // (new List<long>(new long[]{(long)2L, (long)3L})) // >>> CountUpTo((11L)) // (new List<long>(new long[]{(long)2L, (long)3L, (long)5L, (long)7L})) // >>> CountUpTo((0L)) // (new List<long>()) // >>> CountUpTo((20L)) // (new List<long>(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L})) // >>> CountUpTo((1L)) // (new List<long>()) // >>> CountUpTo((18L)) // (new List<long>(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L})) public static List<long> CountUpTo(long n) {
reworded
transform
HumanEval_96_count_up_to
} public static void Main(string[] args) { Debug.Assert(CountUpTo((5L)).Equals((new List<long>(new long[]{(long)2L, (long)3L})))); Debug.Assert(CountUpTo((6L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)5L})))); Debug.Assert(CountUpTo((7L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)5L})))); Debug.Assert(CountUpTo((10L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)5L, (long)7L})))); Debug.Assert(CountUpTo((0L)).Equals((new List<long>()))); Debug.Assert(CountUpTo((22L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L})))); Debug.Assert(CountUpTo((1L)).Equals((new List<long>()))); Debug.Assert(CountUpTo((18L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L})))); Debug.Assert(CountUpTo((47L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L})))); Debug.Assert(CountUpTo((101L)).Equals((new List<long>(new long[]{(long)2L, (long)3L, (long)5L, (long)7L, (long)11L, (long)13L, (long)17L, (long)19L, (long)23L, (long)29L, (long)31L, (long)37L, (long)41L, (long)43L, (long)47L, (long)53L, (long)59L, (long)61L, (long)67L, (long)71L, (long)73L, (long)79L, (long)83L, (long)89L, (long)97L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_96_count_up_to.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 2つの整数を受け取り、その1の位の数の積を返す関数を完成させよ。 // 入力は常に有効範囲にあるとする。 // 例: // >>> Multiply((148L), (412L)) // (16L) // >>> Multiply((19L), (28L)) // (72L) // >>> Multiply((2020L), (1851L)) // (0L) // >>> Multiply((14L), (-15L)) // (20L) public static long Multiply(long a, long b) {
reworded
transform
HumanEval_97_multiply
} public static void Main(string[] args) { Debug.Assert(Multiply((148L), (412L)) == (16L)); Debug.Assert(Multiply((19L), (28L)) == (72L)); Debug.Assert(Multiply((2020L), (1851L)) == (0L)); Debug.Assert(Multiply((14L), (-15L)) == (20L)); Debug.Assert(Multiply((76L), (67L)) == (42L)); Debug.Assert(Multiply((17L), (27L)) == (49L)); Debug.Assert(Multiply((0L), (1L)) == (0L)); Debug.Assert(Multiply((0L), (0L)) == (0L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_97_multiply.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 文字列 s が与えられたとき、偶数のインデックスに含まれる大文字の母音の数を数える。 // 例えば: // >>> CountUpper(("aBCdEf")) // (1L) // >>> CountUpper(("abcdefg")) // (0L) // >>> CountUpper(("dBBE")) // (0L) public static long CountUpper(string s) {
reworded
transform
HumanEval_98_count_upper
} public static void Main(string[] args) { Debug.Assert(CountUpper(("aBCdEf")) == (1L)); Debug.Assert(CountUpper(("abcdefg")) == (0L)); Debug.Assert(CountUpper(("dBBE")) == (0L)); Debug.Assert(CountUpper(("B")) == (0L)); Debug.Assert(CountUpper(("U")) == (1L)); Debug.Assert(CountUpper(("")) == (0L)); Debug.Assert(CountUpper(("EEEE")) == (2L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_98_count_upper.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 数値を表す文字列valueを受け取り、それに最も近い整数を返す関数を作る。 // その数値が2つの整数から等距離にある場合は、ゼロから四捨五入する。 // 例 // >>> ClosestInteger(("10")) // (10L) // >>> ClosestInteger(("15.3")) // (15L) // Note: // Rounding away from zero means that if the given number is equidistant // from two integers, the one you should return is the one that is the // farthest from zero. For example closest_integer("14.5") should // return 15 and closest_integer("-14.5") should return -15. public static long ClosestInteger(string value) {
reworded
transform
HumanEval_99_closest_integer
} public static void Main(string[] args) { Debug.Assert(ClosestInteger(("10")) == (10L)); Debug.Assert(ClosestInteger(("14.5")) == (15L)); Debug.Assert(ClosestInteger(("-15.5")) == (-16L)); Debug.Assert(ClosestInteger(("15.3")) == (15L)); Debug.Assert(ClosestInteger(("0")) == (0L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_99_closest_integer.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // 正の整数nが与えられたとき、n段の石の山を作らなければならない。 // 最初の段にはn個の石がある。 // 次の段の石の数は: // - nが奇数なら次の奇数。 // - nが偶数なら次の偶数。 // 各段の石の数をリストで返す。インデックス i の要素は、段 (i+1) の石の // 数を表すものとする。 // 例: // >>> MakeAPile((3L)) // (new List<long>(new long[]{(long)3L, (long)5L, (long)7L})) public static List<long> MakeAPile(long n) {
reworded
transform
HumanEval_100_make_a_pile
} public static void Main(string[] args) { Debug.Assert(MakeAPile((3L)).Equals((new List<long>(new long[]{(long)3L, (long)5L, (long)7L})))); Debug.Assert(MakeAPile((4L)).Equals((new List<long>(new long[]{(long)4L, (long)6L, (long)8L, (long)10L})))); Debug.Assert(MakeAPile((5L)).Equals((new List<long>(new long[]{(long)5L, (long)7L, (long)9L, (long)11L, (long)13L})))); Debug.Assert(MakeAPile((6L)).Equals((new List<long>(new long[]{(long)6L, (long)8L, (long)10L, (long)12L, (long)14L, (long)16L})))); Debug.Assert(MakeAPile((8L)).Equals((new List<long>(new long[]{(long)8L, (long)10L, (long)12L, (long)14L, (long)16L, (long)18L, (long)20L, (long)22L})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_100_make_a_pile.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // カンマまたは空白で区切られた単語の文字列が与えられる。あなたのタスクは、 // 文字列を単語に分割し、単語の配列を返すことである。 // 例えば: // >>> WordsString(("Hi, my name is John")) // (new List<string>(new string[]{(string)"Hi", (string)"my", (string)"name", (string)"is", (string)"John"})) // >>> WordsString(("One, two, three, four, five, six")) // (new List<string>(new string[]{(string)"One", (string)"two", (string)"three", (string)"four", (string)"five", (string)"six"})) public static List<string> WordsString(string s) {
reworded
transform
HumanEval_101_words_string
} public static void Main(string[] args) { Debug.Assert(WordsString(("Hi, my name is John")).Equals((new List<string>(new string[]{(string)"Hi", (string)"my", (string)"name", (string)"is", (string)"John"})))); Debug.Assert(WordsString(("One, two, three, four, five, six")).Equals((new List<string>(new string[]{(string)"One", (string)"two", (string)"three", (string)"four", (string)"five", (string)"six"})))); Debug.Assert(WordsString(("Hi, my name")).Equals((new List<string>(new string[]{(string)"Hi", (string)"my", (string)"name"})))); Debug.Assert(WordsString(("One,, two, three, four, five, six,")).Equals((new List<string>(new string[]{(string)"One", (string)"two", (string)"three", (string)"four", (string)"five", (string)"six"})))); Debug.Assert(WordsString(("")).Equals((new List<string>()))); Debug.Assert(WordsString(("ahmed , gamal")).Equals((new List<string>(new string[]{(string)"ahmed", (string)"gamal"})))); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_101_words_string.py
cs
[ "\n }\n" ]
using System; using System.Numerics; using System.Diagnostics; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Cryptography; class Problem { // この関数は2つの正の数xとyを受け取り、範囲[x, y](両端を含む)に含まれる // 最大の偶数整数を返す。そのような数がない場合、関数は-1を返す。 // 例えば: // >>> ChooseNum((12L), (15L)) // (14L) // >>> ChooseNum((13L), (12L)) // (-1L) public static long ChooseNum(long x, long y) {
reworded
transform
HumanEval_102_choose_num
} public static void Main(string[] args) { Debug.Assert(ChooseNum((12L), (15L)) == (14L)); Debug.Assert(ChooseNum((13L), (12L)) == (-1L)); Debug.Assert(ChooseNum((33L), (12354L)) == (12354L)); Debug.Assert(ChooseNum((5234L), (5233L)) == (-1L)); Debug.Assert(ChooseNum((6L), (29L)) == (28L)); Debug.Assert(ChooseNum((27L), (10L)) == (-1L)); Debug.Assert(ChooseNum((7L), (7L)) == (-1L)); Debug.Assert(ChooseNum((546L), (546L)) == (546L)); } }
/work/arjunguha-research-group/arjun/repos/nuprl/MultiPL-E/datasets/../datasets/originals-with-cleaned-doctests/HumanEval_102_choose_num.py
cs
End of preview. Expand in Data Studio

Dataset Card for "JMultiPL-E-cs"

More Information needed

Downloads last month
6