parser-tech commited on
Commit
848c6b1
·
verified ·
1 Parent(s): a701b65

Upload reports/code_report.json with huggingface_hub

Browse files
Files changed (1) hide show
  1. reports/code_report.json +207 -0
reports/code_report.json ADDED
@@ -0,0 +1,207 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "code_vault_docs": 18694,
3
+ "japanese_coding_suite": {
4
+ "passed": 16,
5
+ "total": 16,
6
+ "accuracy_pct": 100,
7
+ "cases": [
8
+ {
9
+ "category": "動的計画法/反復",
10
+ "question": "フィボナッチ数列の第n項を返すPython関数を書いて",
11
+ "verified": true,
12
+ "tests_passed": 4,
13
+ "tests_total": 4,
14
+ "source": "PrismMind-Verified-Algo",
15
+ "code": "def fibonacci(n: int) -> int:\n if n < 0:\n raise ValueError(\"n must be non-negative\")\n a, b = 0, 1\n for _ in range(n):\n a, b = b, a + b\n return a",
16
+ "latency_ms": 187.8063
17
+ },
18
+ {
19
+ "category": "数論",
20
+ "question": "与えられた整数が素数かどうか判定するPython関数を実装して",
21
+ "verified": true,
22
+ "tests_passed": 4,
23
+ "tests_total": 4,
24
+ "source": "PrismMind-Verified-Algo",
25
+ "code": "def is_prime(n: int) -> bool:\n if n < 2:\n return False\n if n % 2 == 0:\n return n == 2\n d = 3\n while d * d <= n:\n if n % d == 0:\n return False\n d += 2\n return True",
26
+ "latency_ms": 116.533
27
+ },
28
+ {
29
+ "category": "数論",
30
+ "question": "整数を素因数分解してリストで返すPython関数を書いて",
31
+ "verified": true,
32
+ "tests_passed": 2,
33
+ "tests_total": 2,
34
+ "source": "PrismMind-Verified-Algo",
35
+ "code": "def prime_factors(n: int) -> list[int]:\n factors = []\n d = 2\n while d * d <= n:\n while n % d == 0:\n factors.append(d)\n n //= d\n d += 1 if d == 2 else 2\n if n > 1:\n factors.append(n)\n return factors",
36
+ "latency_ms": 121.6569
37
+ },
38
+ {
39
+ "category": "文字列",
40
+ "question": "文字列が回文かどうか判定するPython関数を書いて",
41
+ "verified": true,
42
+ "tests_passed": 3,
43
+ "tests_total": 3,
44
+ "source": "PrismMind-Verified-Algo",
45
+ "code": "def is_palindrome(s: str) -> bool:\n cleaned = \"\".join(ch.lower() for ch in s if ch.isalnum())\n return cleaned == cleaned[::-1]",
46
+ "latency_ms": 126.2367
47
+ },
48
+ {
49
+ "category": "スタック",
50
+ "question": "括弧の対応が正しいか判定するPython関数を作って",
51
+ "verified": true,
52
+ "tests_passed": 4,
53
+ "tests_total": 4,
54
+ "source": "PrismMind-Verified-Algo",
55
+ "code": "def is_valid_brackets(s: str) -> bool:\n pairs = {')': '(', ']': '[', '}': '{', '」': '「', ')': '('}\n stack = []\n for ch in s:\n if ch in pairs.values():\n stack.append(ch)\n elif ch in pairs:\n if not stack or stack.pop() != pairs[ch]:\n return False\n return not stack",
56
+ "latency_ms": 115.9873
57
+ },
58
+ {
59
+ "category": "探索",
60
+ "question": "ソート済み配列から二分探索を行うPython関数を書いて",
61
+ "verified": true,
62
+ "tests_passed": 2,
63
+ "tests_total": 2,
64
+ "source": "PrismMind-Verified-Algo",
65
+ "code": "def binary_search(arr: list[int], target: int) -> int:\n lo, hi = 0, len(arr) - 1\n while lo <= hi:\n mid = (lo + hi) // 2\n if arr[mid] == target:\n return mid\n elif arr[mid] < target:\n lo = mid + 1\n else:\n hi = mid - 1\n return -1",
66
+ "latency_ms": 121.1641
67
+ },
68
+ {
69
+ "category": "ソート",
70
+ "question": "配列をクイックソートするPython関数を実装して",
71
+ "verified": true,
72
+ "tests_passed": 2,
73
+ "tests_total": 2,
74
+ "source": "PrismMind-Verified-Algo",
75
+ "code": "def quicksort(arr: list) -> list:\n if len(arr) <= 1:\n return list(arr)\n pivot = arr[len(arr) // 2]\n left = [x for x in arr if x < pivot]\n mid = [x for x in arr if x == pivot]\n right = [x for x in arr if x > pivot]\n return quicksort(left) + mid + quicksort(right)",
76
+ "latency_ms": 120.653
77
+ },
78
+ {
79
+ "category": "2ポインタ",
80
+ "question": "ソート済みの2つの配列をマージするPython関数を書いて",
81
+ "verified": true,
82
+ "tests_passed": 2,
83
+ "tests_total": 2,
84
+ "source": "PrismMind-Verified-Algo",
85
+ "code": "def merge_sorted(a: list, b: list) -> list:\n res = []\n i = j = 0\n while i < len(a) and j < len(b):\n if a[i] <= b[j]:\n res.append(a[i]); i += 1\n else:\n res.append(b[j]); j += 1\n res.extend(a[i:])\n res.extend(b[j:])\n return res",
86
+ "latency_ms": 119.2883
87
+ },
88
+ {
89
+ "category": "ハッシュ集合",
90
+ "question": "リストの重複を順序を保って削除するPython関数を書いて",
91
+ "verified": true,
92
+ "tests_passed": 2,
93
+ "tests_total": 2,
94
+ "source": "PrismMind-Verified-Algo",
95
+ "code": "def remove_duplicates(items: list) -> list:\n seen = set()\n out = []\n for x in items:\n if x not in seen:\n seen.add(x)\n out.append(x)\n return out",
96
+ "latency_ms": 122.038
97
+ },
98
+ {
99
+ "category": "文字列",
100
+ "question": "2つの文字列がアナグラムかどうか判定するPython関数を書いて",
101
+ "verified": true,
102
+ "tests_passed": 2,
103
+ "tests_total": 2,
104
+ "source": "PrismMind-Verified-Algo",
105
+ "code": "from collections import Counter\n\ndef is_anagram(a: str, b: str) -> bool:\n ca = Counter(ch.lower() for ch in a if ch.isalnum())\n cb = Counter(ch.lower() for ch in b if ch.isalnum())\n return ca == cb",
106
+ "latency_ms": 124.9456
107
+ },
108
+ {
109
+ "category": "数論",
110
+ "question": "2つの整数の最大公約数を求めるPython関数を書いて",
111
+ "verified": true,
112
+ "tests_passed": 2,
113
+ "tests_total": 2,
114
+ "source": "PrismMind-Verified-Algo",
115
+ "code": "def gcd(a: int, b: int) -> int:\n a, b = abs(a), abs(b)\n while b:\n a, b = b, a % b\n return a",
116
+ "latency_ms": 118.1081
117
+ },
118
+ {
119
+ "category": "数論",
120
+ "question": "非負整数の階乗を計算するPython関数を書いて",
121
+ "verified": true,
122
+ "tests_passed": 3,
123
+ "tests_total": 3,
124
+ "source": "PrismMind-Verified-Algo",
125
+ "code": "def factorial(n: int) -> int:\n if n < 0:\n raise ValueError(\"n must be non-negative\")\n res = 1\n for k in range(2, n + 1):\n res *= k\n return res",
126
+ "latency_ms": 118.6706
127
+ },
128
+ {
129
+ "category": "行列",
130
+ "question": "2次元行列を転置するPython関数を書いて",
131
+ "verified": true,
132
+ "tests_passed": 1,
133
+ "tests_total": 1,
134
+ "source": "PrismMind-Verified-Algo",
135
+ "code": "def transpose(matrix: list[list]) -> list[list]:\n if not matrix:\n return []\n return [list(row) for row in zip(*matrix)]",
136
+ "latency_ms": 116.245
137
+ },
138
+ {
139
+ "category": "ハッシュマップ",
140
+ "question": "配列の中から合計がターゲットになる2つの要素のインデックスを返すTwo SumのPython関数を書いて",
141
+ "verified": true,
142
+ "tests_passed": 2,
143
+ "tests_total": 2,
144
+ "source": "PrismMind-Verified-Algo",
145
+ "code": "def two_sum(nums: list[int], target: int) -> tuple[int, int] | None:\n seen = {}\n for i, x in enumerate(nums):\n need = target - x\n if need in seen:\n return (seen[need], i)\n seen[x] = i\n return None",
146
+ "latency_ms": 131.6688
147
+ },
148
+ {
149
+ "category": "集計",
150
+ "question": "文字列中の各文字の出現回数を辞書で返すPython関数を書いて",
151
+ "verified": true,
152
+ "tests_passed": 1,
153
+ "tests_total": 1,
154
+ "source": "PrismMind-Verified-Algo",
155
+ "code": "from collections import Counter\n\ndef char_frequency(s: str) -> dict[str, int]:\n return dict(Counter(s))",
156
+ "latency_ms": 120.4019
157
+ },
158
+ {
159
+ "category": "文字列",
160
+ "question": "文字列を反転して返すPython関数を書いて",
161
+ "verified": true,
162
+ "tests_passed": 2,
163
+ "tests_total": 2,
164
+ "source": "PrismMind-Verified-Algo",
165
+ "code": "def reverse_string(s: str) -> str:\n return s[::-1]",
166
+ "latency_ms": 116.2763
167
+ }
168
+ ]
169
+ },
170
+ "mbpp_heldout_test": {
171
+ "passed": 22,
172
+ "total": 100,
173
+ "pass_at_10_pct": 22,
174
+ "solved_examples": [
175
+ {
176
+ "task_id": 17,
177
+ "prompt": "Write a function to find the perimeter of a square.",
178
+ "source": "mbpp",
179
+ "code": "def square_perimeter(a):\r\n perimeter=4*a\r\n return perimeter"
180
+ },
181
+ {
182
+ "task_id": 19,
183
+ "prompt": "Write a function to find whether a given array of integers contains any duplicate element.",
184
+ "source": "codeinst122k",
185
+ "code": "def test_duplicate(arr): \n # Create a new array to store the elements \n result = [] \n\n # Iterate over the given array \n for i in range(len(arr)): \n # If element is already present in the result array, the element is duplicate \n if arr[i] in result: \n return True \n else: \n # If the element is not present, add it to the result array \n result.append(arr[i]) \n\n # If all elements are unique, return False \n return False"
186
+ },
187
+ {
188
+ "task_id": 20,
189
+ "prompt": "Write a function to check if the given number is woodball or not.",
190
+ "source": "codeinst122k",
191
+ "code": "def is_woodall(n):\n # check if 2 or greater \n if n >= 2:\n # check for factors \n for i in range(2, int(n**0.5) + 1):\n if n % i == 0:\n # number is not prime \n return False\n # number is prime \n return True\n # number is not prime \n return False"
192
+ },
193
+ {
194
+ "task_id": 24,
195
+ "prompt": "Write a function to convert the given binary number to its decimal equivalent.",
196
+ "source": "codealpaca",
197
+ "code": "def binary_to_decimal(number):\n result = 0\n power = 0\n for digit in str(number)[::-1]:\n if digit == '1':\n result += 2 ** power\n power += 1\n return result"
198
+ },
199
+ {
200
+ "task_id": 28,
201
+ "prompt": "Write a python function to find binomial co-efficient.",
202
+ "source": "mbpp",
203
+ "code": "def binomial_Coeff(n,k): \r\n C = [0] * (k + 1); \r\n C[0] = 1; # nC0 is 1 \r\n for i in range(1,n + 1): \r\n for j in range(min(i, k),0,-1): \r\n C[j] = C[j] + C[j - 1]; \r\n return C[k]; \r\ndef sum_Of_product(n): \r\n return binomial_Coeff(2 * n,n - 1);"
204
+ }
205
+ ]
206
+ }
207
+ }