Phone List Description Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let's say th ...
分类:
其他好文 时间:
2016-06-13 17:15:12
阅读次数:
107
统计难题 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others) Problem Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单 ...
分类:
其他好文 时间:
2016-06-13 17:07:31
阅读次数:
154
题目链接:传送门 题目大意:中文题(大意略) 题目思路:tire入门题 用数组代替指针模拟字典树(代码易写,速度快) ...
分类:
其他好文 时间:
2016-06-12 10:47:14
阅读次数:
157
QAQ 以前一直觉得可持久化trie很难,今天强行写了一发觉得还是蛮简单的嘛 自己的模板是自己手写的,写了几道题目并没有出过错误 THUSC的第二题的解法五貌似就是可持久化trie,时间复杂度O(60*n*logn) 不过并没有正解优,听说考场上有人写可持久化树链剖分,也是6得不行QAQ 可持久化t ...
分类:
其他好文 时间:
2016-06-09 17:17:30
阅读次数:
262
看到异或就去想前缀和(⊙o⊙) 这个就是正反做一遍最大异或和更新答案 最大异或就是很经典的可持久化Trie,从高到低贪心 WA: val&(1<<(base-1))得到的并不直接是1/0 1 #include<bits/stdc++.h> 2 #define ll long long 3 #defi ...
分类:
其他好文 时间:
2016-06-08 00:22:08
阅读次数:
312
屌丝的字典树。。。醉了。。。#include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <queue> #include <cmath> #include <cstdlib> using ...
分类:
其他好文 时间:
2016-06-02 12:59:53
阅读次数:
172