题目描述 Farmer John has installed a new system of pipes to transport milk between the stalls in his barn (), conveniently numbered . Each pipe connects a pair of stalls, and all stalls are connected to each-other via paths of pipes. FJ is pumping milk…
Description Give a tree with n vertices,each edge has a length(positive integer less than 1001). Define dist(u,v)=The min distance between node u and v. Give an integer k,for every pair (u,v) of vertices is called valid if and only if dist(u,v) not e…
题意:定义K[x]为元素x在区间[l,r]内出现的次数,那么它的贡献为K[x]*K[x]*x 给定一个序列,以及一些区间询问,求每个区间的贡献 算是莫队算法膜版题,不带修改的 Code #include <cstdio> #include <algorithm> #include <cmath> #define N 200010 #define ll long long using namespace std; int n,m,A[N],bl[N],k[N*5]; ll…
A. Generous Kefa 题意:n个气球分给k个人,问每个人能否拿到的气球都不一样 解法:显然当某种气球的个数大于K的话,就GG了. #include <bits/stdc++.h> using namespace std; int cnt[110]; char s[110]; int main() { int n,k; scanf("%d%d",&n,&k); scanf("%s", s); int len = strlen(s…
UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There Was One / POJ 3517 And Then There Was One / Aizu 1275 And Then There Was One (动态规划,思维题) Description Let's play a stone removing game. Initially, n ston…
[Writeup]二维码的一个题 瓜皮感觉难出题眼,恶魔暴力膜法初现 看题 一个二维码,扫出来是where is the flag?(where is my mind?) 先感觉 用binwalk扫一下,发现有压缩包,-e分离后发现一个zip,一个zlib,一个空key文本,压缩包需要密码. winhex发现最后有管理员用自己qq号加密字样. 尝试qq号对应的5151BA,改为十进制后,解压失败. 恶魔雨田暴力破解 雨田东游(从609逛到607),见东方李sin便问:你看啥咧.李sin答:你看这…