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

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. 状态栏消息提示——使用Notification

    什么是Notification Notification用于在状态栏显示信息.这些信息一般来源于app的消息推送,或应用的一些功能控制(如播放器) Notification的两种视图 普通视图 借用官 ...

  2. 前端代码目录结构、常用 piugin、元素补充用法及其它注意事项

    目录结构: app:  .html文件 css: .css文件 script: 脚本文件 plugin: 插件  (此目录放一些通用代码) 注意事项: 1.在IE浏览器下img会显示边框,为了保证兼容 ...

  3. 递推 HDU 1143

    n%2==1 0 n%2==0 右边和左边没影响 右边的 * 左边的 z[n]=3*z[n-2]+2*z[n-4]+...2*z[0]; z[n-2]=3*z[n-4]+2*z[n-6]+...2*z ...

  4. 线段树 poj 1436

    题目大意:给出n条垂直于x轴的线段的数据y1,y2,x,求出有几个三条线段一组的三元组并且他们兩兩能相见的.思路:对y轴建树,将x排序,然后按顺序边询问边擦入,用mark[i][j]表示j往左可以看到 ...

  5. C#中中文编码的问题(StreamWriter和StreamReader默认编码)

    在使用StreamWriter和StreamReader时产生了这样的疑问,在不指定的情况下,他们使用什么编码方式? 查看MSDN,请看下图: 注意红色区域  这让我以为构造函数参数不同时使用不一样的 ...

  6. 分布式服务框架dubbo原理解析(转)

    libaba有好几个分布式框架,主要有:进行远程调用(类似于RMI的这种远程调用)的(dubbo.hsf),jms消息服务(napoli.notify),KV数据库(tair)等.这个框架/工具/产品 ...

  7. gulp watch出现Error: watch null EPERM的问题解释

    出现这样的问题,一般是第一次运行导致的,而且任务上有删除文件的操作. 我观察发现,只要把输出目录的文件删除,然后重新运行watch就一些ok,后者再运行一次gulp watch就一切正常.

  8. Linux下查看软件的安装路径

    一.which 命令 Shell 的which 命令可以找出相关命令是否已经在搜索路径中. $ which git/usr/bin/git 二.whereis 命令 whereis 命令搜索更大范围的 ...

  9. jQuery中 pageX,clientX,offsetX,layerX的区别

    一.PageX和clientXPageX和clientX ,这个两个比较容易搞混,PageX:鼠标在页面上的位置,从页面左上角开始,即是以页面为参考点,不随滑动条移动而变化.可以理解为:相对#(0.0 ...

  10. php桥接设计模式

    <?php //桥接模式 abstract class info{ protected $send=null; public function __construct($send){ $this ...