J - VAT Man Gym - 102040J】的更多相关文章

题意:纸牌顺子:连续的3张或连续的4张或连续的5张为顺子.手中的牌共有n个数字,每个数字是a[i]个,能不能把手中所有的牌都是属于顺子. 1 ≤ T ≤ 100. 1 ≤ N ≤ 2 × 105. 0 ≤ ai ≤ 109. . #include <bits/stdc++.h> #define rep(i, a, b) for(int i = a; i <= b; i++) #define ll long long using namespace std; const int maxn…
跟一个博客刷: http://blog.csdn.net/cc_again/article/details/25866971 一.简单基础dp 1.递推 HDU 2084 #include <bits/stdc++.h> using namespace std; ; int dp[MAXN][MAXN]; int towel[MAXN][MAXN]; int main(){ int t; scanf("%d", &t); while(t--){ memset(tow…
赛后补了几道 赛中我就写了两个... A - Altruistic AmphibiansGym - 101933A 看了眼榜没几个人做.就没看. 最后发现就是一个DP(但是我觉得复杂度有点迷) 题意:$n$只青蛙有参数$l,w,h$分别表示弹跳力,体重,身高,在一口深为$d$的井里 一只青蛙不能承受比他重的重量,问最多有多少只能出去(达到高度严格大于d) 重的肯定比轻的晚出去,那么轻的肯定由重的来转移,所以先排序,从重到轻的排 $dp_{i}$表示体重为i最高能叠多高 瞎jb转移一下就好了 #i…
B .Counting Inversion 题意:给定L,R,求这个区间的逆序对数之和.(L,R<1e15) 思路:一看这个范围就知道是数位DP. 只是维护的东西稍微多一点,需要记录后面的各种数字的个数cnt,以及逆序对和sum,以及出现了多少种后缀num. 那么枚举到当前位时,假设为i ,那么sum+=cnt[i+1]+cnt[i+2]+....cnt[9];  cnt[i]+=num; 可以参考CF1073E. #include<bits/stdc++.h> #define rep(…
http://codeforces.com/problemset/problem/429/B 可以参考这篇文章: http://blog.csdn.net/pure_lady/article/details/46764839 因为有断点,所以可以预处理四个顶点到任意点的距离最大值,通过拼接得到断点后的距离 然后就是枚举断点的情况,发现断点不可能在边缘,就可以开始写了 #include <iostream> #include <string> #include <cstring…
暑期热身赛 BAPC 2014 The 2014 Benelux Algorithm Programming Contest 题目网址:https://odzkskevi.qnssl.com/365547ace19a71fae35ca0cfb5a843b3?v=1534772800   B Button Bashing #include<stdio.h> #include<bits/stdc++.h> #include<algorithm> #include<ma…
目录 Contest Info Solutions B. Counting Inversion C. Divisors of the Divisors of An Integer E. Helping the HR F. Path Intersection G. Techland H. Tile Game J. VAT Man Contest Info Practice Link Solved A B C D E F G H I J 7/10 - O O - O O O Ø - O O 在比赛中…
J. Deck Shuffling Time Limit: 2   Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/J Description The world famous scientist Innokentiy continues his innovative experiments with decks of cards. Now he has a deck of n cards and k…
Problem J. Triatrip Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100342/attachments Description The travel agency “Four Russians” is offering the new service for their clients. Unlike other agencies that only suggest one-way…
题目链接: http://codeforces.com/gym/100342 题意: 求三元环的个数 题解: 用bitset分别统计每个点的出度的边和入度的边. 枚举每一条边(a,b),计算以b为出度的边的终点构成的点集和以a为入度的边的起点够成的点集的交集,更新答案. 代码: #include<iostream> #include<cstring> #include<cstdio> #include<bitset> using namespace std;…