[TOC] API serializers.Serializer 序列化 read_only = True choice字段 一对多 & 多对多 先把其他序列化类(publisherserializer,authorserializer)写完 通过有没有many = True来区分 一对多和多对多 ...
分类:
其他好文 时间:
2020-04-21 15:37:06
阅读次数:
60
题意:给你n个由小写字母组成的字符串S,求出能找到k个S的新字符串,并且尽量短 考察nxt数组的含义 #include <iostream> #include <cstring> #include <cstdio> #include <algorithm> using namespace std; ...
分类:
其他好文 时间:
2020-04-21 10:11:00
阅读次数:
66
"传送门" 题意: 给定$n$个小球,标号为$1,2,...,n$,现在要从中选出$m$组。每一组只能包含一个小球或者两个标号相邻的小球。 给定$k$,求出所有分组为$m,1\leq m\leq k$的方案数。 思路: 考虑直接暴力$dp:dp_{i,j}$表示前$i$个球划分$j$个组的方案数,那 ...
分类:
数据库 时间:
2020-04-17 23:57:29
阅读次数:
160
作用 用于求一个串的字典序最小的循环串 原理 详见 "oi wiki 最小表示法" 算法思想是贪心。 例题 "HDU2609 How many" ...
分类:
其他好文 时间:
2020-04-14 01:16:07
阅读次数:
211
Many years ago Berland was a small country where only nn people lived. Each person had some savings: the ii -th one had aiai burles. The government co ...
分类:
编程语言 时间:
2020-04-11 12:55:51
阅读次数:
113
题目大意:有一个区间,长度为n,然后跟着m个子区间,每个字区间的格式为x,y,z表示[x,y]的和为z。如果当前区间和与前面的区间和发生冲突,当前区间和会被判错,问:有多少个区间和会被判错。 题解:x,y,z表示从x开始到y的所有数字的和,那么x-1就表示从(x-1,y]的区间和。我们可以对区间的左 ...
分类:
其他好文 时间:
2020-04-06 20:45:33
阅读次数:
53
训练赛上一题,当时没做出来,Orz太弱了 The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c ...
分类:
其他好文 时间:
2020-04-06 19:02:19
阅读次数:
77
Problem : Given an array, rotate the array to the right by k steps, where k is non negative. Example 1: Example 2: Note: Try to come up as many soluti ...
分类:
其他好文 时间:
2020-04-06 18:59:35
阅读次数:
67
题目 Farmer John has arranged his N (1 ≤ N ≤ 5,000) cows in a row and many of them are facing forward, like good cows. Some of them are facing backward, ...
分类:
其他好文 时间:
2020-04-06 17:13:28
阅读次数:
68
题面 The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C ...
分类:
编程语言 时间:
2020-04-06 13:38:34
阅读次数:
66