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

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. 谈谈你对 Struts 2 的理解

    谈谈你对Struts的理解. struts是一个按MVC模式设计的Web层框架,其实它就是一个大大的servlet,这个Servlet名为ActionServlet,或是ActionServlet的子 ...

  2. Python2.7.6标准库内建函数

        Built-in Functions     abs() divmod() input() open() staticmethod() all() enumerate() int() ord( ...

  3. 学python

    1.*和** def sum(*x): ans=0 for i in x: ans+=i return ans def haha(one,two): print(one,' ',two) print( ...

  4. Tp缓存

    系统默认的缓存方式是采用File方式缓存,我们可以在项目配置文件里面定义其他的缓存方式,例如,修改默认的缓存方式为Xcache(当然,你的环境需要支持Xcache) 对于File方式缓存下的缓存目录下 ...

  5. 【UOJ #14】【UER #1】DZY Loves Graph

    http://uoj.ac/problem/14 题解很好的~ 不带路径压缩的并查集能保留树的原本形态. 按秩合并并查集可以不用路径压缩,但是因为此题要删除,如果把深度当为秩的话不好更新秩的值,所以把 ...

  6. nginx 报错 HTTP ERROR 500 (PHP数组简写模式)

    同样的代码放在Apache上执行可以执行,在nginx上面就报错了. 百度出来一堆结果貌似都不对,然后只有注释代码->运行程序,一步步找到问题所在 $buffer = []; 这一步报错了 原来 ...

  7. RabbitMQ 消息确认机制

    消息确认机制 在之前异常处理部分就已经写了,对于consumer的异常退出导致消息丢失,可以时候consumer的消息确认机制.重复的就不说了,这里说一些不一样的. consumer的消息确认机制 当 ...

  8. CSS DIV自动适应高度

    当div需要设定自适应高度时,可用到的css属性,min-height:200px;代表的是当div的内容超出了200px时,就会自动适应高度,兼容所有浏览器(IE6除外),如果是IE6则需要设置&q ...

  9. C# GUID转换成16位字符串或19位数字并确保唯一

    /// <summary> /// 根据GUID获取16位的唯一字符串 /// </summary> /// <param name=\"guid\" ...

  10. CSS3实现阴阳鱼

    直接上代码: <!doctype html> <html> <head> <meta charset="utf-8" /> < ...