链接:https://www.nowcoder.com/acm/contest/205/G
来源:牛客网

题目描述

终于活成了自己讨厌的样子。
充钱能让你变得更强。
在暖婊这个游戏里面,如果你充了x元钱,那么你能获得10x个钻石。同时暖婊也有m档VIP,如果你往暖婊里面充了ai个钻石,那么你能成为第i档贵族用户。当你成为第i档贵族用户之后,那么你可以获得的优惠。
你需要k件材料合成衣服,其中第i件材料原价为di个钻石,你一共需要ci件这种材料。当你获得p的优惠时,这个材料的真实价格为
请问栗子米最少需要氪多少钱,这里我们规定只能氪整数的钱。

输入描述:

第一行一个整数T(T≤ 1000),表示数据组数。
每组数据第一行两个整数m,k(1≤ m,k≤ 15)。
接下来m行每行两个正整数1≤ a

i

≤ 10

5

, 1≤ p

i

≤ 100,保证a

ii+1,pi≤ pi+1
接下来k行每行两个正整数1≤ ci, di≤ 1000。

输出描述:

对于每组数据,输出一个整数,表示至少要氪多少钱。

输入例子:
1
1 1
100 100
100 100
输出例子:
10

-->

示例1

输入

复制

1
1 1
100 100
100 100

输出

复制

10

题目意思不是太好懂,冲会员算是预存?懂了意思模拟就好了

模拟题竟然没有看,最近风气不行呀。以后态度要认真了

 #include <iostream>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <sstream>
#include <stack>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define FO freopen("in.txt", "r", stdin);
#define debug(x) cout << "&&" << x << "&&" << endl;
#define lowbit(x) (x&-x)
#define mem(a,b) memset(a, b, sizeof(a));
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll mod=;
const int inf = 0x3f3f3f3f;
ll powmod(ll a,ll b) {ll res=;a%=mod;for(;b;b>>=){if(b&)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
//head const int maxn=;
int a[maxn],p[maxn],c[maxn],d[maxn];
int _,m,k;
int main() {
for(scanf("%d",&_);_;_--) {
scanf("%d%d",&m,&k);
rep(i,,m+) scanf("%d%d",a+i,p+i);
rep(i,,k+) scanf("%d%d",c+i,d+i);
int ans=inf;
rep(i,,m+) {//枚举会员类型
int cur=;
rep(j,,k+) {
int temp=(int)ceil(d[j]*(-p[i])/100.0);//会员单价
cur+=temp*c[j];
}
if(cur<a[i]) cur=a[i];//如果花的钻石比买会员少,就按会员的钻石
ans=min(ans,cur);
}
ans=(int)ceil(ans*0.1);//转成钱
printf("%d\n",ans);
}
}

牛客国庆集训day5 G 贵族用户 (模拟)的更多相关文章

  1. 牛客国庆集训day5 B 电音之王 (大数乘模)

    链接:https://www.nowcoder.com/acm/contest/205/B来源:牛客网 题目描述 终于活成了自己讨厌的样子. 听说多听电音能加快程序运行的速度. 定义一个数列,告诉你a ...

  2. 牛客国庆集训day6 B Board (模拟标记思维或找规律或分块???)

    链接:https://www.nowcoder.com/acm/contest/206/B来源:牛客网 题目描述 恬恬有一个nx n的数组.她在用这个数组玩游戏: 开始时,数组中每一个元素都是0. 恬 ...

  3. 2019牛客国庆集训派对day5

    2019牛客国庆集训派对day5 I.Strange Prime 题意 \(P=1e10+19\),求\(\sum x[i] mod P = 0\)的方案数,其中\(0 \leq x[i] < ...

  4. 牛客国庆集训派对Day6 A Birthday 费用流

    牛客国庆集训派对Day6 A Birthday:https://www.nowcoder.com/acm/contest/206/A 题意: 恬恬的生日临近了.宇扬给她准备了一个蛋糕. 正如往常一样, ...

  5. 牛客国庆集训派对Day5 Solution

    A    璀璨光滑 留坑. B    电音之王 蒙特马利大数乘模运算 #include <bits/stdc++.h> using namespace std; typedef long ...

  6. 牛客国庆集训派对Day_4~6

    Day_4 A.深度学习 题目描述 小 A 最近在研究深度学习,他自己搭建了一个很牛逼的神经网络,现在他手头一共有 n 组训练数据,一开始他会给自己的神经网络设置一个 batch size,假设为 B ...

  7. 牛客国庆集训派对Day2 Solution

    A    矩阵乘法 思路: 1° 牛客机器太快了,暴力能过. #include <bits/stdc++.h> using namespace std; #define N 5000 in ...

  8. 2018 牛客国庆集训派对Day4 - H 树链博弈

    链接:https://ac.nowcoder.com/acm/contest/204/H来源:牛客网 题目描述 给定一棵 n 个点的树,其中 1 号结点是根,每个结点要么是黑色要么是白色 现在小 Bo ...

  9. 牛客国庆集训派对Day1 L-New Game!(最短路)

    链接:https://www.nowcoder.com/acm/contest/201/L 来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 1048576K,其他语言20 ...

随机推荐

  1. 有关Backgroundworker

    (一)Backgroundworker取消时应该用的有关代码: CancelAsync方法是在前台主线程用的,CancellationPending属性是在后台子线程用的.实际的使用方式应该是这样的: ...

  2. When install ”matplotlib” with ”pip”, if you get the following error, it means the “freetype” and “png” libraries needed by matplotlib are not installed:

    ============================================================================ * The following require ...

  3. 使用NDK编译 libyuv <转>

    官方源码:http://code.google.com/p/libyuv/简介: libyuv is an open source project that includes YUV scaling ...

  4. EF CODEFIRST WITH ORACLE

    摸索了半天,运行通过了,但是还是有一点坑的,对于初次使用的人来说,可能会遇到几个问题 首先安装两个dll 如果你已经下载好了dll Oracle.ManagedDataAccess.dll Oracl ...

  5. Linux 压缩文件 和解压文件

    .zip 解压:unzip FileName.zip 压缩:zip FileName.zip DirName .rar 解压:rar -x FileName.zip 压缩:rar -a FileNam ...

  6. PTA 估值一亿的AI核心代码

    题面 比赛时被模拟题打自闭了,本来以为是个比较麻烦的模拟,实际上只要会C++的regex不到40行就能把这个题过掉了(orz smz) regex是用来处理正则表达式,里面有个函数regex_repl ...

  7. STM32 C++编程 003 USART(串口)类

    使用 C++ 语言给 STM32 编写一个 Usart 类 我使用的STM32芯片:STM32F103ZET6 我们使用的STM32库版本:V3.5.0 注意: 想学习本套 STM32 C++编程 的 ...

  8. Luogu 4409 [ZJOI2006]皇帝的烦恼

    BZOJ 1863 lyd口中的夹B递推. 挺妙的解法. 第一个感觉是找到一个最大的相邻的$a_i + a_{i - 1}$就可以了,但是这个想法大概只对了一半,一半的意思是说只有在$n$为偶数的时候 ...

  9. input与字符串格式化

    # Auther: Aaron Fan #字符转格式化: name = input("Enter your name: ")age = int(input("Enter ...

  10. 树莓派研究笔记(10)-- Retropie 模拟器

    前面介绍过lakka模拟器,小巧,轻便,支持中文.其实最著名的游戏系统还是要属于Retropie啊.虽然笨重了一点,但是很多树莓派系统的原汁原味还是保留的很好.这样就不需要我们自己还要对lakka的源 ...