1.题目描述:点击打开链接
2.解题思路:本题是四色定理的模板题,不过有几种情况要提前特判一下:n==1直接输出,1
3.代码:
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#...
分类:
其他好文 时间:
2015-08-18 11:54:11
阅读次数:
158
1.题目描述:点击打开链接
2.解题思路:本题是一道模拟题,输入一个串,要求判断是否形如“ABABA”或“ABABCAB”。只需要对两种情况逐一尝试即可。然而这道题有诸多细节需要考虑。这里说一下我自己的方法。
首先,如果输入的串长度
3.代码:
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
#include
#...
分类:
其他好文 时间:
2015-08-17 15:32:54
阅读次数:
135
使用impala做大数据量查询distinct的时候报如下错误WARNINGS:Createfile/tmp/impala-scratch/24414dab2c19caca:e54b206c5ab149d_24414dab2c19caca:e54b206c5ab149f_91001337-9d70-4c93-84ce-e7916c1ae804failedwitherrno=2description=Error(2):Nosuchfileordirectory
Backend4..
分类:
其他好文 时间:
2015-08-17 12:17:33
阅读次数:
315
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
//处理空格
void delspace(char *str)
{
char *p1 = str;
char *p2 = str;
while ((*p1 = *(p2++)) != '\0')
{
if (*p1 != ' ')
{
p1++;
...
分类:
其他好文 时间:
2015-08-16 15:20:31
阅读次数:
112
使用哈希,实现6428633条CSDN账户数据的简单查询
#define _CRT_SECURE_NO_WARNINGS
#include
#include
char path[256] = "E:\\Big_Data\\csdn.txt";
#define N 6428633
unsigned int BKDRHash(char *str);
struct beitai
{
char...
分类:
其他好文 时间:
2015-08-15 00:12:36
阅读次数:
170
题意:问小于n且不与n互质的数的和是多少。容斥原理求出和n互质的和,然后用 n*(n-1)/2 减以下,注意溢出。#pragma comment(linker,"/STACK:102400000,102400000") #define _CRT_SECURE_NO_WARNINGS#include#...
分类:
其他好文 时间:
2015-08-13 21:52:05
阅读次数:
155
人在(0,0)点,问n*m的矩阵上的点有多少可以与人直接可见,其实就是矩阵上点与(0,0)点的形成的斜率种类数。#pragma comment(linker,"/STACK:102400000,102400000") #define _CRT_SECURE_NO_WARNINGS#include#i...
分类:
其他好文 时间:
2015-08-13 11:43:49
阅读次数:
108
题意:求第k个与m互质的数。容斥原理求出[1,L]与m互质的数,然后二分k即可。#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#include#include#include#include#include#includ...
分类:
其他好文 时间:
2015-08-13 11:19:22
阅读次数:
153
求A到B之间有多少个数能与N互质。学了下容斥原理的写法, 想将N分解质因数,然后容斥原理,N - 单个质因数倍数个数+2个质因数倍数的个数-3个质因数的个数......#define _CRT_SECURE_NO_WARNINGS#include#include#include#include#in...
分类:
其他好文 时间:
2015-08-11 21:04:17
阅读次数:
210
1.题目描述:点击打开链接
2.解题思路:本题是一道简单的排序题,按照题意排序计算即可。
3.代码:
#define _CRT_SECURE_NO_WARNINGS
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#inclu...
分类:
其他好文 时间:
2015-08-07 13:26:46
阅读次数:
137