题目描述 将一个英文语句以单词为单位逆序排放。例如“I am a boy”,逆序排放后为“boy a am I”所有单词之间用一个空格隔开,语句中除了英文字母外,不再包含其他字符 接口说明 /** * 反转句子 * * @param sentence 原句子 * @return 反转后的句子 */p ...
分类:
其他好文 时间:
2020-08-26 17:18:30
阅读次数:
45
1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1e5+5; 4 bool isprime[maxn]; 5 int prime[maxn]; 6 int mu[maxn]; 7 int cnt=0; 8 void ...
分类:
其他好文 时间:
2020-08-24 16:36:48
阅读次数:
60
点击查看代码块 #include <bits/stdc++.h> #define ed end() #define bg begin() #define mkp make_pair #define pb push_back #define vv(T) v(v(T)) #define v(T) vec ...
分类:
其他好文 时间:
2020-08-21 16:38:12
阅读次数:
84
这道题的数据是不是有点水?还是题目描述有问题? #include<bits/stdc++.h> #define x first #define y second using namespace std; const int N=1005; typedef pair<int,int> PII; int ...
分类:
其他好文 时间:
2020-08-17 17:32:42
阅读次数:
60
打水问题: 删数问题: #include<bits/stdc++.h> #define MAXN 10000 using namespace std; int main() { string s; int len,k; cin>>s>>k; len=s.size(); for(int t=1;t<= ...
分类:
编程语言 时间:
2020-08-13 12:15:44
阅读次数:
59
今天在统计pv和ip时遇到之前没有遇到的查询操作,在这里先记录下... 1、使用nested嵌套后,聚合查询当前嵌套的字段与嵌套外的字段,建议在嵌套内添加嵌套外需要聚合的字段: 2、跳出嵌套: 1 "aggs": { 2 "rev": { 3 "reverse_nested": {}, //跳出嵌套 ...
分类:
其他好文 时间:
2020-08-13 12:13:05
阅读次数:
43
from numpy import * import operator def classify0(inX, dataSet, labels, k): dataSetSize = dataSet.shape[0]#获取数据集的行数 classify0()函数有4个参数:inX:用于分类的输入向量;d ...
分类:
编程语言 时间:
2020-08-10 17:30:49
阅读次数:
66
题目链接https://loj.ac/problem/6277 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 typedef long long ll; 5 const int maxn = 1e5 + 10; 6 const int in ...
分类:
其他好文 时间:
2020-08-08 21:23:31
阅读次数:
77
题意:n段木棍,每个长度为a[i],求切割K次后,使得的最长的木棍长度最短,输出此时最长的木棍长度。n<2e5,k<1e9 题解:切割次数越多,切割后的长度越短,满足单调性,可二分切割后,最长的木棍不大于多少,check判断切割次数是否小于K次即可。 #include <bits/stdc++.h> ...
分类:
其他好文 时间:
2020-08-08 11:47:52
阅读次数:
81
Prim算法 复杂度:O(N*N) #include<bits/stdc++.h> using namespace std; const int maxn = 1005; int n; int d[maxn], vis[maxn], mat[maxn][maxn]; int main(){ int ...
分类:
其他好文 时间:
2020-08-08 00:31:58
阅读次数:
61