什么什么期望的,不会! (题解http://blog.sina.com.cn/s/blog_140e100580102wj4e.html(看不懂)) #include<bits/stdc++.h> #define LL long long #define LD long double #define N 100005 using namespace std; inline int ra() { ,f=; char ch=getchar(); ; ch=getchar();} +ch-'; ch…
B. Maxim and Restaurant time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Maxim has opened his own restaurant! The restaurant has got a huge table, the table's length is p meters. Maxim has…
A. Roma and Lucky Numbers 暴力计算. B. Roma and Changing Signs 每次取最小值改变正负,优先队列维护. C. Maxim and Discounts 贪心,当买的个数等于最小\(q_i\)时,能拿就拿. D. Maxim and Restaurant 枚举最后一个不能上桌的人\(x\),\(f(i,j)\)表示i个人凑成长为\(j\)的方案数,当\(j+a[x] \gt p\)时,前\(i\)个人可以随意排列,而没上桌的人除了\(x\)外也随意…
A. Restaurant Tables time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In a small restaurant there are a tables for one person and b tables for two persons. It it known that n groups of peopl…