112 lines
4.4 KiB
Plaintext
112 lines
4.4 KiB
Plaintext
{
|
|
"cells": [
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 1,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"with open(\"../题库0.3/Problems.json\",\"r\",encoding = \"utf8\") as f:\n",
|
|
" database = f.read()\n",
|
|
"import json\n",
|
|
"pro_dict = json.loads(database)"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 2,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"# 输入目标列表\n",
|
|
"t = \"\"\"K0819001X\n",
|
|
"K0819002X\n",
|
|
"K0819003X\n",
|
|
"K0819004X\n",
|
|
"K0819005X\n",
|
|
"K0819006X\n",
|
|
"K0820001X\n",
|
|
"K0820002X\n",
|
|
"K0820003X\n",
|
|
"\"\"\""
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 3,
|
|
"metadata": {},
|
|
"outputs": [
|
|
{
|
|
"name": "stdout",
|
|
"output_type": "stream",
|
|
"text": [
|
|
"\"K0819002X\":\"000811,002619,003997,004192,007528,007541,007544,007545,007559,007563,007574,007575,007576,007582,007604,007663,007664,010877,010883,011369\",\n",
|
|
"\"K0819004X\":\"000837,002621\",\n",
|
|
"\"K0819005X\":\"000333,000340,000373,000385,000393,000398,000410,000418,000435,000439,000470,000483,000502,000521,000532,000539,000563,000568,000580,000600,000620,000640,000658,000694,000722,000735,000737,000753,000774,000800,000823,000828,000849,000866,000873,000885,000914,000929,000951,002612,002613,002614,002615,002616,002617,002618,002620,002622,002623,002633,003584,003594,003634,003654,003735,003759,003764,003867,004021,004030,004104,004127,004148,004170,004231,004250,004298,004430,004450,004475,004517,004536,004558,004663,004686,004727,004747,007527,007529,007530,007531,007532,007542,007543,007546,007547,007549,007552,007553,007554,007555,007556,007557,007560,007561,007562,007577,007578,007581,007586,007587,007588,007589,007590,007591,007592,007593,007594,007595,007596,007597,007598,007599,007601,007602,007603,007605,007606,007607,007623,007631,007659,007660,007679,009303,009304,009305,009306,009311,009315,009316,009320,009325,009334,009407,009411,009421,009945,010875,010876,010879,010880,010882,010990,011054,011137,011226,011269,011293,011308,011340,011347,011396,011415,011459,011498,011528,011628,011651,011703,011993,012011,030022\",\n",
|
|
"\"K0819006X\":\"002635,002637,004028,007539,007540,007585,007628,007638,007639,007640,007641,007642,007643,007644,007645,009308,009318,009319,009946,009990\",\n",
|
|
"\"K0820001X\":\"002626,002627,002628,002631,002634,002639,003573,003811,003942,003962,003991,004020,004027,004211,007533,007534,007535,007536,007537,007538,007550,007564,007565,007566,007567,007568,007569,007570,007571,007572,007573,007580,007584,007611,007612,007613,007614,007615,007617,007620,007621,007625,007626,007627,007629,007630,007633,007636,007637,007646,007647,007648,007651,007658,007661,007662,007676,007677,007678,009310,009312,009314,009343,009419,009947,011442,030071\",\n",
|
|
"\"K0820002X\":\"000359,003840,004019,004711,007618,007622,009339,009408\",\n",
|
|
"\"K0820003X\":\"002624,002629,002630,002636,003578,003851,003883,004342,004625,004678,007548,007551,007558,007608,009313,009948,010878,010881,012026\",\n"
|
|
]
|
|
}
|
|
],
|
|
"source": [
|
|
"dict1 = {}\n",
|
|
"for o in [l.strip() for l in t.split(\"\\n\") if len(l.strip())>0]:\n",
|
|
" dict1[o] = []\n",
|
|
"for id in pro_dict:\n",
|
|
" for o in dict1:\n",
|
|
" objs = pro_dict[id][\"objs\"]\n",
|
|
" flag = True\n",
|
|
" if not o in objs:\n",
|
|
" flag = False\n",
|
|
" for obj in objs:\n",
|
|
" if obj > o:\n",
|
|
" flag = False\n",
|
|
" break\n",
|
|
" if flag:\n",
|
|
" dict1[o].append(id)\n",
|
|
"for o in dict1:\n",
|
|
" if not dict1[o] == []:\n",
|
|
" print('\"'+o+'\":\"'+\",\".join(dict1[o])+'\",')"
|
|
]
|
|
},
|
|
{
|
|
"cell_type": "code",
|
|
"execution_count": 21,
|
|
"metadata": {},
|
|
"outputs": [],
|
|
"source": [
|
|
"\n"
|
|
]
|
|
}
|
|
],
|
|
"metadata": {
|
|
"kernelspec": {
|
|
"display_name": "Python 3.8.8 ('base')",
|
|
"language": "python",
|
|
"name": "python3"
|
|
},
|
|
"language_info": {
|
|
"codemirror_mode": {
|
|
"name": "ipython",
|
|
"version": 3
|
|
},
|
|
"file_extension": ".py",
|
|
"mimetype": "text/x-python",
|
|
"name": "python",
|
|
"nbconvert_exporter": "python",
|
|
"pygments_lexer": "ipython3",
|
|
"version": "3.8.8"
|
|
},
|
|
"orig_nbformat": 4,
|
|
"vscode": {
|
|
"interpreter": {
|
|
"hash": "d311ffef239beb3b8f3764271728f3972d7b090c974f8e972fcdeedf230299ac"
|
|
}
|
|
}
|
|
},
|
|
"nbformat": 4,
|
|
"nbformat_minor": 2
|
|
}
|