{"id":19053573,"url":"https://github.com/open-compass/codebench","last_synced_at":"2026-02-28T12:13:25.206Z","repository":{"id":240933100,"uuid":"800319536","full_name":"open-compass/CodeBench","owner":"open-compass","description":null,"archived":false,"fork":false,"pushed_at":"2024-05-21T11:38:31.000Z","size":300,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T01:16:58.965Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/open-compass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-14T05:38:15.000Z","updated_at":"2024-08-29T08:24:21.000Z","dependencies_parsed_at":"2024-05-21T14:42:59.182Z","dependency_job_id":null,"html_url":"https://github.com/open-compass/CodeBench","commit_stats":null,"previous_names":["open-compass/codebench"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/open-compass/CodeBench","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FCodeBench","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FCodeBench/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FCodeBench/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FCodeBench/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-compass","download_url":"https://codeload.github.com/open-compass/CodeBench/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-compass%2FCodeBench/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284029385,"owners_count":26935274,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-12T02:00:06.336Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T23:32:21.933Z","updated_at":"2025-11-12T12:03:34.728Z","avatar_url":"https://github.com/open-compass.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# CodeBench\n\n## 介绍\n\nLCBench 由爬取的 Leetcode 中英周赛题目组成，具体为第 274 次至第 378 次周赛的全部题目，包括其中穿插的双周赛。\n\n## 数据格式\n\n数据储存在 [LCBench-v0.1](https://github.com/open-compass/CodeBench/tree/main/LCBench-v0.1) 文件夹下。样例如下：\n\n中文：\n\n```\n{\n    \"Contest id\": \"378/2982\",\n    \"text_name\": \"找出出现至少三次的最长特殊子字符串 II\",\n    \"text\": \"给你一个仅由小写英文字母组成的字符串 s 。\n    如果一个字符串仅由单一字符组成，那么它被称为 特殊 字符串。例如，字符串 \\\"abc\\\" 不是特殊字符串，而字符串 \\\"ddd\\\"、\\\"zz\\\" 和 \\\"f\\\" 是特殊字符串。\n    返回在 s 中出现 至少三次 的 最长特殊子字符串 的长度，如果不存在出现至少三次的特殊子字符串，则返回 -1 。\n    子字符串 是字符串中的一个连续 非空 字符序列。\",\n    \"canonical_solution\": \"\n    from collections import defaultdict\n        def maximumLength(s):\n            special_substrings = defaultdict(int)\n            start = 0\n            while start \u003c len(s):\n                curr = start\n                while curr \u003c len(s) - 1 and s[curr] == s[curr + 1]:\n                    curr += 1\n                window_size = curr + 1 - start\n                for length in range(1, window_size + 1):\n                    special_substrings[(s[start], length)] += window_size + 1 - length\n                start = curr + 1\n            res = -1\n            for k in special_substrings:\n                if special_substrings[k] \u003e= 3:\n                    res = max(res, k[1])\n            return res\n    \",\n    \"entry_point\": \"maximumLength\",\n    \"test_list\": [\n        \"assert maximumLength(\\\"aaaa\\\") == 2\",\n        \"assert maximumLength(\\\"abcdef\\\") == -1\",\n        \"assert maximumLength(\\\"abcaba\\\") == 1\"\n    ],\n    \"Difficulty\": \"MEDIUM\"\n}\n```\n\n英文：\n\n```\n{\n    \"Contest id\": \"378/2982\",\n    \"text_name\": \"Find Longest Special Substring That Occurs Thrice II\",\n    \"text\": \"You are given a string s that consists of lowercase English letters.\n    A string is called special if it is made up of only a single character. For example, the string \\\"abc\\\" is not special, whereas the strings \\\"ddd\\\", \\\"zz\\\", and \\\"f\\\" are special.\n    Return the length of the longest special substring of s which occurs at least thrice, or -1 if no special substring occurs at least thrice.\n    A substring is a contiguous non-empty sequence of characters within a string.\",\n    \"canonical_solution\": \"\n    from collections import defaultdict\n        def maximumLength(s):\n            special_substrings = defaultdict(int)\n            start = 0\n            while start \u003c len(s):\n                curr = start\n                while curr \u003c len(s) - 1 and s[curr] == s[curr + 1]:\n                    curr += 1\n                window_size = curr + 1 - start\n                for length in range(1, window_size + 1):\n                    special_substrings[(s[start], length)] += window_size + 1 - length\n                start = curr + 1\n            res = -1\n            for k in special_substrings:\n                if special_substrings[k] \u003e= 3:\n                    res = max(res, k[1])\n            return res\n    \",\n    \"entry_point\": \"maximumLength\",\n    \"test_list\": [\n        \"assert maximumLength(\\\"aaaa\\\") == 2\",\n        \"assert maximumLength(\\\"abcdef\\\") == -1\",\n        \"assert maximumLength(\\\"abcaba\\\") == 1\"\n    ],\n    \"Difficulty\": \"MEDIUM\"\n}\n```\n\n其中参考答案 `canonical_solution` 为排序最高的题解，测试样例 `test_list` 为题面中的样例数据，难度 `Difficulty` 为 LeetCode 官方所标记的难度。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-compass%2Fcodebench","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-compass%2Fcodebench","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-compass%2Fcodebench/lists"}