UESTC 2016 Summer Training #1 Div.2
最近意志力好飘摇..不知道坚不坚持得下去..
这么弱还瞎纠结...可以滚了..
水题都不会做..
水
没有看题
水
不会捉
水
水
没看题
感觉题意理解得有问题啊
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int n,f[],c[],b[],cnt[]; int check(int x){
for(int i = ;i >= ;i--){
int cc = x/b[i];
if(cc > cnt[b[i]]) return ;
cnt[b[i]] -= cc;
x -= b[i]*cc;
}
return ;
} void solve(){
int tot;
b[]=;b[]=;b[]=;b[]=;b[]=;
memset(c,,sizeof(c));
memset(cnt,,sizeof(cnt));
int ok = ;
for(int i = ;i <= n;i++){
scanf("%d",&tot);
int tmp = ,yu = ;
for(int j = ;j <= ;j++){
scanf("%d",&c[j]);
tmp += c[j]*b[j];
cnt[b[j]] += c[j];
}
yu = tmp-tot;
if(!check(yu)) ok = ;
} if(ok == ) puts("no");
else puts("yes");
} int main(){
while(scanf("%d",&n) != EOF){
solve();
}
return ;
}
没读题
觉得很难写,,而且不会写...可是过的人很多啊
没有看出来是个dfs...
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
int n,m,a[];
vector<int> g[]; void dfs(int u,int cnt){
for(int i = ;i < cnt-;i++) printf(" ");
if(g[u].size()){
if(a[u]) printf("- ");
else printf("+ ");
}
else printf(" ");
if(u == ) printf("project\n");
else printf("object%d\n",u);
if(a[u]){
for(int i = ;i < g[u].size();i++){
int v = g[u][i];
dfs(v,cnt+);
}
}
} int main(){
scanf("%d",&n);
memset(a,,sizeof(a));
for(int i = ;i <= n;i++) g[i].clear();
char s[];
for(int i = ;i <= n;i++){
scanf("%s %d",s,&m);
int x;
for(int j = ;j < m;j++){
scanf("%d",&x);
g[i].push_back(x);
}
if(s[] == '-') a[i] = ;
}
dfs(,);
return ;
}
没看题
水
没看题
没看题
我好菜啊...............................................
UESTC 2016 Summer Training #1 Div.2的更多相关文章
- The Solution of UESTC 2016 Summer Training #1 Div.2 Problem C
Link http://acm.hust.edu.cn/vjudge/contest/121539#problem/C Description standard input/output After ...
- UESTC 2016 Summer Training #6 Div.2
我好菜啊.. UVALive 6434 给出 n 个数,分成m组,每组的价值为最大值减去最小值,每组至少有1个,如果这一组只有一个数的话,价值为0 问 最小的价值是多少 dp[i][j] 表示将 前 ...
- The Solution of UESTC 2016 Summer Training #1 Div.2 Problem B
Link http://acm.hust.edu.cn/vjudge/contest/121539#problem/B Description standard input/output Althou ...
- The Solution of UESTC 2016 Summer Training #1 Div.2 Problem A
Link http://acm.hust.edu.cn/vjudge/contest/121539#problem/A Description standard input/output Haneen ...
- UESTC 2016 Summer Training #1 J - Objects Panel (A) 按条件遍历树
#include <iostream> #include <cstdio> #include <vector> using namespace std; typed ...
- 2016 Multi-University Training Contests
2016 Multi-University Training Contest 1 2016 Multi-University Training Contest 2 2016 Multi-Univers ...
- 2016 Multi-University Training Contest 2 D. Differencia
Differencia Time Limit: 10000/10000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Tot ...
- 2016 Multi-University Training Contest 1 G. Rigid Frameworks
Rigid Frameworks Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) ...
- 2016 Multi-University Training Contest 1
8/11 2016 Multi-University Training Contest 1 官方题解 老年选手历险记 最小生成树+线性期望 A Abandoned country(BH) 题意: 1. ...
随机推荐
- java乱码问题(转)
参考: http://blog.csdn.net/beijiguangyong/article/details/7414247 http://www.zhihu.com/question/202126 ...
- for循环的嵌套
循环的四要素:初始条件,循环条件,循环体,状态改变. 打印左下角是直角的三角形: 打印左上角为直角的三角形: 打印右上角为直角的三角形: 打印右下角为直角的三角形: 99口诀表:
- .net连接access操作类
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- (三)主控板生级uboot与内核
一.升级uboot 把我的电脑增加一个192.168.1.3的ip,方便升级boot. 1.连接串口,连接网口到GE1; 2.登陆电脑后到D:\MTG3000MAIN\first目录打开tftp32 ...
- Android APK混淆
APK混淆 1 修改project.properties文件 即可实现对项目进行全局混码将proguard.config=${sdk.dir}/tools/proguard/proguard-andr ...
- SSM框架——以注解形式实现事务管理
上一篇博文<SSM三大框架整合详细教程>详细说了如何整合Spring.SpringMVC和MyBatis这三大框架.但是没有说到如何配置mybatis的事务管理,在编写业务的过程中,会需要 ...
- Bootstrap的粗体和斜体
一.粗体 粗体就是给文本加粗,在普通的元素中我们一般通过font-weight设置为bold关键词给文本加粗. 在Bootstrap中,可以使用<b>和<strong>标签让文 ...
- 转!!JavaBean,List,Map转成json格式
public class User { private String username; private String password; public String getUsername() { ...
- hiho_1081_最短路径1
题目 最短路模板题目,纯练习手速. 实现 #include<iostream> #include<string.h> #include<iostream> #inc ...
- 深入理解PHP原理之变量分离/引用
19 Sep 08 深入理解PHP原理之变量分离/引用(Variables Separation) 作者: Laruence( ) 本文地址: http://www.laruence.com/20 ...