UVA
badgre
这个作者很懒,什么都没留下…
展开
-
UVA 12563 Jin Ge Jin Qu hao
#include #include using namespace std; const int M = 10000; struct node{ int x, y; node(int _x = 0, int _y = 0):x(_x), y(_y){} }; int v[M]; node dp[M]; int main() { int s, t, cas = 1, n; cin >>原创 2016-08-06 16:00:35 · 129 阅读 · 0 评论 -
UVA - 11584 Partitioning by Palindromes
#include #include #include using namespace std; const int M = 1200; char Ma[M*2]; int Mp[M*2]; void Manacher(char s[], int len){//预处理 int l = 0; Ma[l++] = '$'; Ma[l++] = '#'; for(int i = 0; i原创 2016-08-07 11:36:01 · 101 阅读 · 0 评论 -
UVA 437 巴比伦塔
#include #include #include #include using namespace std; struct node{ int a[4]; node(){} void Sort(){sort(a, a+3);} }p[1200]; bool g[120][4][120][4]; bool vis[120][4]; int n, dp[120][4]; bool原创 2016-08-07 11:39:57 · 139 阅读 · 0 评论 -
UVA 11987 Almost Union-Find 虚拟跟节点的并查集
#include #include using namespace std; const int M = 1e5 +20; int Rank[M*2], sum[M*2], p[M*2]; int find(int x){ if(x == p[x]) return x; return p[x] = find(p[x]); } int main() { int x,原创 2016-08-10 10:01:56 · 98 阅读 · 0 评论 -
UVA 10692 Huge Mods 指数循环节
#include #include #include #include using namespace std; typedef long long LL; int a[120], n; LL u, m; LL phi(LL n){ LL ans = n; for(int i = 2; i*i <= n; i++){ if(n%i == 0){原创 2016-08-11 11:26:20 · 149 阅读 · 0 评论