inline char get() { static char buf[1024]; static int pos=0,size=0; if(pos==size) { size=fread(buf,1,1024,stdin); pos=0; if(!size) return EOF; else re ...
分类:
编程语言 时间:
2020-02-09 11:23:31
阅读次数:
89
s_gets函数的修改版本 1 char *s_get(char*st,int n) //输入,指针法替代数组表示 2 { 3 char *pt; 4 5 pt = fgets(st,n,stdin); 6 if(pt) 7 { 8 while( *st != '\n' && *st!= '\0') ...
分类:
其他好文 时间:
2020-02-06 20:22:11
阅读次数:
62
[Codeforces Round 617 (Div. 3)] 题解 A,B,C,D,E1,E2,F "1296A Array with Odd Sum" 思路: 如果一开始数组的sum和是奇数,那么直接YES, 否则:如果存在一个奇数和一个偶数,答案为YES,否则为NO 代码: B. Food B ...
分类:
其他好文 时间:
2020-02-06 01:21:07
阅读次数:
191
记录c primer plus上一个实用的字符串输入函数 char*s_gets(char*st,int n) //输入函数 { char *ret_val; int i=0; ret_val = fgets(st,n,stdin); if(ret_val) { while(st[i] != '\n ...
分类:
其他好文 时间:
2020-02-06 01:08:14
阅读次数:
77
#include <string.h> #include <iostream> using namespace std; int main() { char a[1000005],b[1000005],c[127]={0}; fgets(a,1000005,stdin); fgets(b,10000 ...
分类:
其他好文 时间:
2020-02-05 11:51:07
阅读次数:
48
「JSOI2014」学生选课 "传送门" 看到这题首先可以二分。 考虑对于当前的 $mid$ 如何 $\text{check}$ 我们用 $f_{i,j}$ 来表示 $i$ 对 $j$ 的好感度排名,那么对于两个人 $i$,$j$ 如果有 $\max\{f_{i, j}, f_{j, i}\} mi ...
分类:
Web程序 时间:
2020-02-04 20:25:17
阅读次数:
97
「AHOI2014/JSOI2014」拼图 "传送门" 看到 $n \times m \le 10^5$ ,考虑根号分治。 对于 $n define rg register define file(x) freopen(x".in", "r", stdin), freopen(x".out", "w ...
分类:
Web程序 时间:
2020-02-04 20:03:50
阅读次数:
80
本文主要介绍 python 解释器的基本用法,借 helloworld 来演示传入代码的四种方式:文件,字符串,stdin,module。同时介绍在 windows 下如何使用 py 启动器运行不同版本的 python。 ...
分类:
编程语言 时间:
2020-02-03 13:41:07
阅读次数:
91
这个需要使用到history命令。可以加数字,返回最近执行的几条命令。如果不加数字会返回所有的历史命令。 [root@localhost ~]# history 20 1015 rm stdin.log 1016 ll 1017 rm yy 1018 ll 1019 echo 'hello' 1>> ...
分类:
系统相关 时间:
2020-02-02 20:02:38
阅读次数:
202
题面:给出长度为n的数列,然后算出其区间和乘区间最小数所能得到的最大值,并且输出区间 样例输入: 6 3 1 6 4 5 2 样例输出: 60 3 5 原题链接:https://vjudge.net/problem/UVA-1619 分析: 这里有两种算法,一种是O(nlogn)的,用st表+递归, ...
分类:
其他好文 时间:
2020-02-01 19:29:46
阅读次数:
83