题目 题目链接:http://codeforces.com/problemset/problem/1511/D 定义一个字符串 \(s\) 的花费为满足 \(s_i=s_j\) 且 \(s_{i+1}=s_{j+1}\) 的数对 \((i,j)\) 的数量(\(0 \leq i<j<|s|-1\)) ...
分类:
其他好文 时间:
2021-04-30 12:45:53
阅读次数:
0
利用pycharm创建一个新的工程, Files-Settings-Project-Project Interpreter 右上角设置中,选择Add,添加新的解释器。 apply之后,可以看到本地安装的库添加进工程内。 ...
分类:
编程语言 时间:
2021-04-30 12:44:52
阅读次数:
0
1 package com.pingfan.array; 2 3 import java.util.Arrays; 4 5 public class ArrayDemo6 { 6 public static void main(String[] args) { 7 int[] a = {1,2,3, ...
分类:
其他好文 时间:
2021-04-30 12:43:27
阅读次数:
0
Collection stvos=(Collection) dao.retrieveByClause(SyntaskVO.class, " instanceid='"+billid+"' order by vdef3 desc"); SyntaskVO stvo=new SyntaskVO(); i ...
分类:
其他好文 时间:
2021-04-30 12:39:34
阅读次数:
0
类中多个Synchronized方法 下面给出一个例子,说明一个class中有两个方法synchronized的情况。它们互相阻挡的用法和上面的“一个方法有synchronized”的情况是一样的。例1.9.5:class A { public synchronized void f1() { fo ...
分类:
编程语言 时间:
2021-04-30 12:36:54
阅读次数:
0
序列化:把python中的对象转成json格式字符串 反序列化:把json格式字符串转成python中的对象 drf的序列化组件(序列化器):把对象转成字典。因为有字典,直接丢到Response中就可以了 序列化器的使用 1 写一个序列化的类,继承Serializer 2 在类中写要序列化的字段 f ...
分类:
其他好文 时间:
2021-04-30 12:36:16
阅读次数:
0
两个视图基类 1 APIView # 基础类 from rest_framework.views import APIView 2 GenericAPIView # 封装一些有关数据库操作 # GenericAPIView(APIView) from rest_framework.generics ...
分类:
其他好文 时间:
2021-04-30 12:36:05
阅读次数:
0
有时候需要做个某些服务的状态监控,用钉钉机器人发通知挺方便的。可以用shell脚本配合crontab检测状态,检测到异常就调用python脚本发起告警。 python内容 此处用的python3,需要先安装requests模块。pip install requests -i https://mirr ...
分类:
编程语言 时间:
2021-04-30 12:35:08
阅读次数:
0
1 package com.pingfan.array; 2 3 public class ArrayDemo2 { 4 public static void main(String[] args) { 5 //静态初始化:创建 + 赋值 6 int[] a ={1,2,3,4,5,6,7,8}; ...
分类:
其他好文 时间:
2021-04-30 12:34:23
阅读次数:
0
实验任务1 #include <stdio.h> long long fun(int n); // 函数声明 int main() { int n; long long f; while(scanf("%d", &n) != EOF) { f = fun(n); // 函数调用 printf("n ...
分类:
编程语言 时间:
2021-04-30 12:31:46
阅读次数:
0