Codeforces 376B. Coupons and Discounts】的更多相关文章

B. Coupons and Discounts time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The programming competition season has already started and it's time to train for ICPC. Sereja coaches his teams for…
题目链接 Coupons and Discounts 逐步贪心即可. 若当前位为奇数则当前位的下一位减一,否则不动. #include <bits/stdc++.h> using namespace std; #define rep(i,a,b) for(int i(a); i <= (b); ++i) ]; int n; int main(){ memset(a, , sizeof a); scanf("%d", &n); rep(i, , n) scanf…
题意:有n个队参加CCPC,然后有两种优惠方式,一种是一天买再次,一种是买两天,现在让你判断能不能找到一种方式,使得优惠不剩余. 析:直接模拟,如果本次是奇数,那么就得用第二种,作一个标记,再去计算下一个. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #inclu…
time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The programming competition season has already started and it's time to train for ICPC. Sereja coaches his teams for a number of year and he know…
Coupons and Discounts time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output The programming competition season has already started and it's time to train for ICPC. Sereja coaches his teams for a…
http://codeforces.com/contest/731 不发题面了,自己点链接 总结一下 考场上 原以为这次要加很多raiting... 但FST狗记邓,只加了58rating 总结一下 ABC切得很快(保持) B题WA了2发不应该,没有想清楚 F题写了大暴力,但不优美,虽然过了P,但就没有想了,很严重问题,得意忘形,虽然知道FST,但有侥幸心里,真正考试就完了 以为拿到了分就不干事了,严重问题,真正考试一定要写暴力拍 后来没有干事,既没有hack又没有去写DE不应该 A Night…
A. Night at the Museum time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Grigoriy, like the hero of one famous comedy film, found a job as a night security guard at the museum. At first night…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output All our characters have hobbies. The same is true for Fedor. He enjoys shopping in the neighboring supermarket. The goods in the supermarket hav…
D. Fedor and coupons time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output All our characters have hobbies. The same is true for Fedor. He enjoys shopping in the neighboring supermarket. The goo…
题目链接:http://codeforces.com/contest/161/problem/B 题意: 有n个商品和k辆购物车,给出每个商品的价钱c和类别t(1表示凳子,2表示铅笔),如果一辆购物车中有凳子,那么这辆购物车中最便宜的那个物品的价格能减少50%,问你如何放这些物品才能使总价钱最少. 思路: 简单贪心,判断凳子数量是否大于等于k行. #include <bits/stdc++.h> using namespace std; typedef long long LL; typede…