翻译题目
开发中
POST
/problem/translate
请求参数
Header 参数
Authorization
string
可选
默认值:
Bearer 131Fa67D3C52f8d27BbDb777eC23dE3Bb68A24109Fb4c46Cd78471fAa3f9d529
Body 参数application/json
title
string
必需
description
string
必需
input
string
必需
output
string
必需
hint
string
必需
tags
array[string]
必需
target_lang
string
必需
示例
{
"title": "Herb Collection",
"description": "Chenchen is a gifted child with a dream of becoming the greatest physician. To test his potential, a renowned physician takes him to a cave filled with various herbs. Each herb requires a certain amount of time to harvest and has its own value. Given a limited time, Chenchen needs to maximize the total value of the herbs he collects. Can you help Chenchen achieve this task?",
"input": "The first line contains two integers $T$ (1 ≤ $T$ ≤ 1000) and $M$ (1 ≤ $M$ ≤ 100), where $T$ represents the total time available for collecting herbs, and $M$ represents the number of herbs in the cave. The next $M$ lines each contain two integers, representing the time required to harvest a particular herb and its value, both ranging from 1 to 100.",
"output": "Output the maximum total value of herbs that can be collected within the given time.",
"hint": "- For 30% of the data, $M$ ≤ 10;\n- For all data, $M$ ≤ 100.",
"tags": [
"Dynamic Programming",
"Knapsack"
],
"target_lang": "中文"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/problem/translate' \
--header 'Authorization: Bearer 131Fa67D3C52f8d27BbDb777eC23dE3Bb68A24109Fb4c46Cd78471fAa3f9d529' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "Herb Collection",
"description": "Chenchen is a gifted child with a dream of becoming the greatest physician. To test his potential, a renowned physician takes him to a cave filled with various herbs. Each herb requires a certain amount of time to harvest and has its own value. Given a limited time, Chenchen needs to maximize the total value of the herbs he collects. Can you help Chenchen achieve this task?",
"input": "The first line contains two integers $T$ (1 ≤ $T$ ≤ 1000) and $M$ (1 ≤ $M$ ≤ 100), where $T$ represents the total time available for collecting herbs, and $M$ represents the number of herbs in the cave. The next $M$ lines each contain two integers, representing the time required to harvest a particular herb and its value, both ranging from 1 to 100.",
"output": "Output the maximum total value of herbs that can be collected within the given time.",
"hint": "- For 30% of the data, $M$ ≤ 10;\n- For all data, $M$ ≤ 100.",
"tags": [
"Dynamic Programming",
"Knapsack"
],
"target_lang": "中文"
}'
返回响应
🟢200OK
application/json
Body
code
integer
必需
msg
string
必需
data
object
必需
title
string
必需
description
string
必需
input
string
必需
output
string
必需
hint
string
必需
tags
array[string]
必需
示例
{
"code": 0,
"msg": "string",
"data": {
"title": "string",
"description": "string",
"input": "string",
"output": "string",
"hint": "string",
"tags": [
"string"
]
}
}
修改于 2025-01-07 08:28:22