def solution(s): s=s.strip() if(s): l=len(s) first_n=-1 b_n=-1 last_n=-1 f_n=-1 for i in range(l): if(s[i].isdigit()): ... ...
分类:
其他好文 时间:
2019-03-09 23:58:33
阅读次数:
277
~~带花树,那是啥?~~ 每次复杂度 $O(nm)$ 随机5次似乎就卡不掉(起码现在uoj上没有能卡掉这个的 cpp include using namespace std; int read() { int x = 0, c = getchar(); while (!isdigit(c)) c = ...
分类:
其他好文 时间:
2019-03-04 20:37:09
阅读次数:
174
```java
inline int read(){ int s = 0,f = 1; char ch; ch = getchar(); while(!isdigit(ch)){ if(ch == '-') f = - 1; ch = getcahr(); } while(isdigit(ch)){... ...
分类:
其他好文 时间:
2019-02-13 17:00:25
阅读次数:
181
#include <iostream> #include <algorithm> using namespace std; typedef long long ll; inline ll read(){ ll x=0,f=1; char ch=getchar(); while(!isdigit(ch ...
分类:
其他好文 时间:
2019-02-02 20:37:07
阅读次数:
169
s为字符串s.isalnum() 所有字符都是数字或者字母s.isalpha() 所有字符都是字母s.isdigit() 所有字符都是数字s.islower() 所有字符都是小写s.isupper() 所有字符都是大写s.istitle() 所有单词都是首字母大写,像标题s.isspace() 所有 ...
分类:
编程语言 时间:
2019-01-31 22:59:51
阅读次数:
254
#include #include #include #include #include #include using namespace std; inline int read() { int x=0,f=1;char ch=getchar(); while (!isdigit(ch)){if ... ...
分类:
其他好文 时间:
2019-01-24 17:17:26
阅读次数:
211
s = "Sorting1234"print("".join(sorted(s, key=lambda x: (x.isdigit(), x.isdigit() and int(x) % 2 == 0, x.isupper(), x.islower(), x)))) sorted通过元祖进行比较 t ...
分类:
其他好文 时间:
2019-01-23 23:27:55
阅读次数:
140
视图函数: pages = request.GET.get('page','1') if pages.isdigit() == False: pages = '1' pages = int(pages) PERPAGE = 10 MAXPAGE = 11 half_max_page = MAXPAG ...
分类:
其他好文 时间:
2019-01-19 16:26:25
阅读次数:
234
1. str.isdigit( ) 作用:检测字符串是否有数字组成 2. strip( ) 作用:除去首尾指定的字符,包括空格,换行符,不能除去中间的字符 3. slice( ) 作用:以指定参数切割,参数: 起始,结束,间距 4. save( ) 作用:保存 5. load( ) 作用:读取 6. ...
分类:
编程语言 时间:
2019-01-18 18:38:47
阅读次数:
192
线段树维护矩阵 直接维护矩阵 摒弃之前难看的代码,换上清真的 cpp include using namespace std; using LL = long long; template T mian(){ T s=0,f=1;char ch; while(!isdigit(ch=getchar( ...
分类:
其他好文 时间:
2019-01-15 17:47:42
阅读次数:
169