E - The Unbearable Lightness of Weights 思路: 分组背包dp 每组最多只能选一个 一些优化可以快很多 代码: #pragma GCC optimize(2) #pragma GCC optimize(3) #pragma GCC optimize(4) #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define pi acos(-1.0)…
链接:http://codeforces.com/contest/1032/ 是真的真的真的忍不住想吐槽这题意是真的真的真的读不懂…… A - Kitchen Utensils - [简单数学题] 题意: 国王开宴会,总共有编号为 $1 \sim 100$ 种餐具用来组成一套餐具.组成一套餐具的要求是,每种餐具最多出现一只. 现在给 $k$ 个宾客每个人若干套餐具,给的每套餐具都是一模一样的:同时,每个人收到的餐具套数也都是相同的. 现在知道宴会开完后,还剩下 $n$ 个餐具,以及这 $n$ 个…
A. Kitchen Utensils Water. #include <bits/stdc++.h> using namespace std; #define N 110 int n, k, cnt[N]; int main() { while (scanf("%d%d", &n, &k) != EOF) { memset(cnt, , sizeof cnt); , x; i <= n; ++i) { scanf("%d", &a…
版权声明:凭栏处.潇潇雨歇. https://blog.csdn.net/IndexMan/article/details/28130961 近期在研究Oracle PLSQL中对于XML的系列操作.结合工作中使用的知识和參考资料整理出以下相关内容: 一 怎样生成XML文件: 1.使用dbms_xmlquery和utl_file内置包(scott用户运行) CREATE OR REPLACE DIRECTORY xml_dir AS 'd:\app\xml'; DROP SEQUENCE seq…
[codeforces 339]C. Xenia and Weights 试题描述 Xenia has a set of weights and pan scales. Each weight has an integer weight from 1 to 10 kilos. Xenia is going to play with scales and weights a little. For this, she puts weights on the scalepans, one by on…
http://codeforces.com/problemset/problem/489/D D. Unbearable Controversy of Being time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Tomash keeps wandering off and getting lost while he is wal…
Unbearable Controversy of Being 题目链接: http://acm.hust.edu.cn/vjudge/contest/121332#problem/B Description Tomash keeps wandering off and getting lost while he is walking along the streets of Berland. It's no surprise! In his home town, for any pair of…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Xenia and Weights Xenia has a set of weights and pan scales. Each weight has an integer weight from 1 to 10 kilos. Xenia is going to play with scales and weights a little. For this, she puts…
D. Unbearable Controversy of Being time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Tomash keeps wandering off and getting lost while he is walking along the streets of Berland. It's no surp…
题意: 给出一个n个节点m条边的有向图,求如图所示的菱形的个数. 这四个节点必须直接相邻,菱形之间不区分节点b.d的个数. 分析: 我们枚举每个a和c,然后求出所有满足a邻接t且t邻接c的节点的个数记为r. 那么分别以a.c为左右端点的菱形的个数就是r的二元组合. #include <cstdio> #include <vector> using namespace std; + ; bool G[maxn][maxn]; vector<int> nxt[maxn];…