请定义一个函数quadratic(a, b, c),接收3个参数,返回一元二次方程 ax^2+bx+c=0ax2+bx+c=0 的两个解。 提示: 一元二次方程的求根公式为: 计算平方根可以调用math.sqrt()函数: #!/usr/bin/env python3 import math def ...
分类:
编程语言 时间:
2020-10-20 16:27:52
阅读次数:
35
Prime digit replacements 枚举每一位放数字还是放未知的,如果为止的就拿1代替单独存 因为要有8个,所以我们可知未知的一定是三的倍数,末尾一定是1,3,7,然后暴力搞一搞(剪枝跑得飞快) 1 #include<bits/stdc++.h> 2 #define reg regis ...
分类:
其他好文 时间:
2020-10-19 22:57:02
阅读次数:
18
Link 题意描述: 有一棵 \(n\) 个节点的树,每个点有一个权值 \(a_i\)。 定义 \(\operatorname{dist}(u,v)\) 为 \(u,v\) 两点间距离。 您要找到一个点 \(u\),使得 \(\displaystyle\sum_{i=1}^n\operatornam ...
分类:
其他好文 时间:
2020-10-18 16:13:43
阅读次数:
19
题目链接:https://codeforces.com/problemset/problem/868/C 如果有方案,那么肯定可以用两道题目完成 这是证明 #include<cstdio> #include<cstring> #include<algorithm> #include<iostream ...
分类:
其他好文 时间:
2020-10-18 10:20:12
阅读次数:
30
Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by ...
分类:
其他好文 时间:
2020-10-18 10:19:49
阅读次数:
29
所谓年轻,就是意识不到自己的年轻 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; unsigned long long n,m; unsigned long ...
分类:
其他好文 时间:
2020-10-18 10:06:40
阅读次数:
20
#include<bits/stdc++.h>包含了目前c++所包含的所有头文件 对比: #include <iostream> #include <cstdio> #include <fstream> #include <algorithm> #include <cmath> #include < ...
分类:
编程语言 时间:
2020-10-18 09:59:50
阅读次数:
17
给定一个 \(n\) 个点 \(m\) 条边的边带权简单连通无向图,在 $0$ 时刻你在点 $1$ 上。 假设当前是 \(t\) 时刻,你在点 \(v\) 上,你可以选择两种操作: 仍停留在点 \(v\) 上,操作后到 \(t+1\) 时刻。 选择一条边 \((a,b,w)\) 满足 \(a=v\) ...
分类:
其他好文 时间:
2020-10-18 09:37:30
阅读次数:
14
html <input class="ipt space" placeholder="请输入您的手机号码" type="text" id="phone"> <p id="phone-wrong" class="form-checking">请输入正确的手机号码</p> css .ipt-checki ...
分类:
移动开发 时间:
2020-10-16 10:59:28
阅读次数:
36
【转】 Vuex模块化 上图是vuex的结构图vuex即 store, 包含State,Action,Mutations, 每一个vue项目都需要使用vuex做组件之间的数据共享 使用场景: 数据最终存放在store的State中, 但是也会面临问题, 比如,login.vue和dept.vue这俩 ...
分类:
其他好文 时间:
2020-10-14 20:28:27
阅读次数:
22