今天做的沈阳站重现赛,自己还是太水,只做出两道签到题,另外两道看懂题意了,但是也没能做出来。

1、

Thickest Burger

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0

Problem Description
ACM ICPC is launching a thick burger. The thickness (or the height) of a piece of club steak is A (1 ≤ A ≤ 100). The thickness (or the height) of a piece of chicken steak is B (1 ≤ B ≤ 100).  The chef allows to add just three pieces of meat into the burger and he does not allow to add three pieces of same type of meat. As a customer and a foodie, you want to know the maximum total thickness of a burger which you can get from the chef. Here we ignore the thickness of breads, vegetables and other seasonings.
 
Input
The first line is the number of test cases. For each test case, a line contains two positive integers A and B.
 
Output
For each test case, output a line containing the maximum total thickness of a burger.
 
Sample Input
10
68 42
1 35
25 70
59 79
65 63
46 6
28 82
92 62
43 96
37 28
 
Sample Output
178 71 165 217 193 98 192 246 235 102

Hint

Consider the first test case, since 68+68+42 is bigger than 68+42+42 the answer should be 68+68+42 = 178. Similarly since 1+35+35 is bigger than 1+1+35, the answer of the second test case should be 1+35+35 = 71.

 #include <iostream>

 #include <cstdio>

 using namespace std;

 int main(){

     int n;

     int a,b;

     int maxx;

     int minn;

     int ans;

     scanf("%d",&n);

     for(int j=;j<n;j++){

         scanf("%d %d",&a,&b);

         int maxx=a>b?a:b;

         int minn=a>b?b:a;

         int ans=maxx*+minn;

         printf("%d\n",ans);

     }

     return ;

 }

2、

Relative atomic mass

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 0    Accepted Submission(s): 0

Problem Description
Relative atomic mass is a dimensionless physical quantity, the ratio of the average mass of atoms of an element (from a single given sample or source) to 12of the mass of an atom of carbon-12 (known as the unified atomic mass unit). You need to calculate the relative atomic mass of a molecule, which consists of one or several atoms. In this problem, you only need to process molecules which contain hydrogen atoms, oxygen atoms, and carbon atoms. These three types of atom are written as ’H’,’O’ and ’C’ repectively. For your information, the relative atomic mass of one hydrogen atom is 1, and the relative atomic mass of one oxygen atom is 16 and the relative atomic mass of one carbon atom is 12. A molecule is demonstrated as a string, of which each letter is for an atom. For example, a molecule ’HOH’ contains two hydrogen atoms and one oxygen atom, therefore its relative atomic mass is 18 = 2 * 1 + 16.
 
Input
The first line of input contains one integer N(N ≤ 10), the number of molecules. In the next N lines, the i-th line contains a string, describing the i-th molecule. The length of each string would not exceed 10.
 
Output
For each molecule, output its relative atomic mass.
 
Sample Input
5
H
C
O
HOH
CHHHCHHOH
 
Sample Output
1
12
16
18
46
 #include <iostream>

 #include <cstdio>

 #include <cstring>

 using namespace std;

 int main(){

     int n;

     int ans=;

     char a[];

     scanf("%d",&n);

     for(int j=;j<n;j++){

         ans=;

         scanf("%s",a);

         int len=strlen(a);

         for(int i=;i<len;i++){

             if(a[i]=='H'){

                 ans+=;

             }

             if(a[i]=='C'){

                 ans+=;

             }

             if(a[i]=='O'){

                 ans+=;

             }

         }

         printf("%d\n",ans);

     }

     return ;

 }
 
 

#include <iostream>
#include <cstdio>
#include <cstring> using namespace std; int ans=;
char graph[][];
int N,M,S; void fun(int i,int l){
if(l==S){
ans++;
return ;
}else{
for(int j=;j<=N;j++){
if(graph[i][j]==''){
graph[i][j]='';
graph[j][i]='';
fun(j,l+);
graph[i][j]='';
graph[j][i]='';
}
}
}
} int main(){
int n; int a,b;
scanf("%d",&n);
for(int j=;j<n;j++){
ans=;
memset(graph,,sizeof(graph));
scanf("%d %d %d",&N,&M,&S);
for(int i=;i<=M;i++){
scanf("%d %d",&a,&b);
graph[a][b]='';
graph[b][a]='';
}
for(int ii=;ii<=N;ii++){
fun(ii,);
}
printf("%d\n",ans); }
return ;
}

这个还不对

 
 
 
 
 
 
 
 
 
 

2016ACM/ICPC亚洲区沈阳站-重现赛赛题的更多相关文章

  1. 2016ACM/ICPC亚洲区沈阳站-重现赛

    C.Recursive sequence 求ans(x),ans(1)=a,ans(2)=b,ans(n)=ans(n-2)*2+ans(n-1)+n^4 如果直接就去解...很难,毕竟不是那种可以直 ...

  2. HDU 5950 Recursive sequence 【递推+矩阵快速幂】 (2016ACM/ICPC亚洲区沈阳站)

    Recursive sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Other ...

  3. HDU 5952 Counting Cliques 【DFS+剪枝】 (2016ACM/ICPC亚洲区沈阳站)

    Counting Cliques Time Limit: 8000/4000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) ...

  4. HDU 5948 Thickest Burger 【模拟】 (2016ACM/ICPC亚洲区沈阳站)

    Thickest Burger Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)T ...

  5. HDU 5949 Relative atomic mass 【模拟】 (2016ACM/ICPC亚洲区沈阳站)

    Relative atomic mass Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Oth ...

  6. HDU 6227.Rabbits-规律 (2017ACM/ICPC亚洲区沈阳站-重现赛(感谢东北大学))

    Rabbits Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total S ...

  7. HDU 6225.Little Boxes-大数加法 (2017ACM/ICPC亚洲区沈阳站-重现赛(感谢东北大学))

    整理代码... Little Boxes Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/O ...

  8. 2016ACM/ICPC亚洲区大连站-重现赛

    题目链接:http://acm.hdu.edu.cn/search.php?field=problem&key=2016ACM%2FICPC%D1%C7%D6%DE%C7%F8%B4%F3%C ...

  9. 2016ACM/ICPC亚洲区大连站-重现赛(感谢大连海事大学)(7/10)

    1001题意:n个人,给m对敌对关系,X个好人,Y个坏人.现在问你是否每个人都是要么是好人,要么是坏人. 先看看与X,Y个人有联通的人是否有矛盾,没有矛盾的话咋就继续遍历那些不确定的人关系,随便取一个 ...

随机推荐

  1. iOS开发知识点总结

    main文件做了这几件事: 1. 创建当前的应用程序 2. 根据4个参数的最后为应用程序设置代理类(默认情况下是AppDelegate) 3. 将appDelegate 和 应用程序 建立关联(指定代 ...

  2. @Autowired的使用

    1.benas的xml文件中需要加入如下代码 <bean class="org.springframework.beans.factory.annotation.AutowiredAn ...

  3. NSURLConnection的使用

    一:NSURLConnection(IOS9.0已经弃用)是早期apple提供的http访问方式.以下列出了常用的几个场景:GET请求,POST请求,Response中带有json数据 对于NSURL ...

  4. 解决:dpkg:处理 xxx (--configure)或E: Sub-process /usr/bin/dpkg returned an error code (1)

    问题重现: 问题解决办法: #先备份原来的,然后重新新建 sudo mv /var/lib/dpkg/info /var/lib/dpkg/info.bak //现将info文件夹更名 sudo mk ...

  5. matlab进阶:常用功能的实现,常用函数的说明

    常用功能的实现 获取当前脚本所在目录 current_script_dir = fileparts(mfilename('fullpath')); % 结尾不带'/' 常用函数的说明 bsxfun m ...

  6. 【BZOJ-1426】收集邮票 概率与期望DP

    1426: 收集邮票 Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 261  Solved: 209[Submit][Status][Discuss] ...

  7. 【poj2065】 SETI

    http://poj.org/problem?id=2065 (题目链接) 题意 题意半天看不懂..给你一个素数P(P<=30000)和一串长为n的字符串str[].字母'*'代表0,字母a-z ...

  8. 【poj1737】 Connected Graph

    http://poj.org/problem?id=1737 (题目链接) 题意 求n个节点的无向连通图的方案数,不取模w(゚Д゚)w Solution 刚开始想了个第二类斯特林数,然而并不知道怎么求 ...

  9. Mysql 查询练习

    Mysql 查询练习 ---创建班级表 create table class( cid int auto_increment primary key, caption ) )engine=innodb ...

  10. 总结的JS数据类型判定(非常全面)

    用typeof 来检测数据类型 Javascript自带两套类型:基本数据类型(undefined,string,null,boolean,function,object)和对象类型. 但是如果尝试用 ...