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

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. WCF中的错误及解决办法

    一 .    HTTP 无法注册 URL http://+:8000/Users/.进程不具有此命名空间的访问权限今天按照网上的例子开始学习WCF程序,运行的时候却发现出如下问题:HTTP 无法注册 ...

  2. CSS基本知识4-CSS行模型

    display:inline.block.inline-block block元素的特点是: 总是在新行上开始: 高度,行高以及顶和底边距都可控制: 宽度缺省是它的容器的100%,除非设定一个宽度 i ...

  3. mac开机密码忘记了, 新建用户方法

    第一步:重启电脑,然后按住shift+commond+s; 第二步:输入: fsck -ymount -uaw /rm /var/db/.AppleSetupDone reboot 第三步:根据提示创 ...

  4. eclipse配置maven

  5. CSS-学习笔记一

    CSS(层叠样式表)做网页的外观 四种样式: 权重: 行内样式>内嵌式>链接式 1. 行内样式 <div style="color:red;font-size:30px&q ...

  6. 分析DH加密算法,一种适基于密钥一致协议的加密算法。

    DH Diffie-Hellman算法(D-H算法),密钥一致协议.是由公开密钥密码体制的奠基人Diffie和Hellman所提出的一种思想.简单的说就是允许两名用户在公开媒体上交换信息以生成&quo ...

  7. arcgis engine 监听element的添加、更新和删除事件(使用IMovePointFeedback)

    VB代码: 复制进程序稍作修改变量名和事件逻辑即可使用. Members   AllPropertiesMethodsInheritedNon-inherited Description Displa ...

  8. Web jquery表格组件 JQGrid 的使用 - 11.问题研究

    系列索引 Web jquery表格组件 JQGrid 的使用 - 从入门到精通 开篇及索引 Web jquery表格组件 JQGrid 的使用 - 4.JQGrid参数.ColModel API.事件 ...

  9. Java学习笔记13---一个循环程序的设计范例

    package welcome; import java.util.Scanner; /* * 一个循环程序的设计范例 * 首先编写仅执行一次的程序(当无循环时) * 循环的设计步骤: * 1.确定程 ...

  10. 百度编辑器 Ueditor 下拉处增加字体

    左百度,添加到同右钉邮那么多:                                               1.\ueditor\lang\zh-cn\zh-cn.js  文件中找到: ...