A.Electric Bill

题意:简单计算题,超过1000部分额外算

 1 #include<stdio.h>
2 int main(){
3 int money1,money2;
4 long long int sum=0,n,num;
5 scanf("%d %d",&money1,&money2);
6 scanf("%lld",&n);
7 while(n--){
8 sum=0;
9 scanf("%lld",&num);
10 if(num>1000){
11 sum+=(num-1000)*money2;
12 sum+=1000*money1;
13 printf("%lld %lld\n",num,sum);
14 }else{
15 printf("%lld %lld\n",num,num*money1);
16 }
17 }
18 }

B.Simplified Keyboard

题目:判断是题目中说的哪一类

 1 #include<bits/stdc++.h>
2 using namespace std;
3 int pos[9] = {-10,-9,-8,-1,0,1,8,9,10};
4 char a[27] = "abcdefghijklmnopqrstuvwxyz";
5 int main()
6 {
7 int n;
8 scanf("%d",&n);
9 while(n--)
10 {
11 int i,j,k;
12 int flag = 3;
13 char s1[21],s2[21];
14 scanf("%s %s",s1,s2);
15 if(strcmp(s1,s2)==0)
16 flag=1;
17 else
18 {
19 if(strlen(s1)!=strlen(s2))
20 flag = 3;
21 else
22 {
23
24 flag = 2;
25 for(i = 0; i < strlen(s1); i++)
26 {
27 int isok = 0;
28 for(j = 0; j < 9; j++)
29 {
30 if(s2[i]-'a'+pos[j]>=0&&s2[i]-'a'+pos[j]<=25)
31 {
32 if(s1[i]==a[s2[i]-'a'+pos[j]])
33 {
34 isok = 1;
35 break;
36 }
37
38
39 }
40
41 }if(isok == 1)
42 continue;
43 else {flag = 3;break;}
44
45 }
46
47 }
48 }
49 printf("%d\n",flag);
50 }
51
52
53
54 }

C.Singin' in the Rain

题目:和上场比赛的CDs题有点相同,只是贪心找最小即可,把样例一列出来,找找规律即可

 1 #include<cstdio>
2 #include<cmath>
3 #include<algorithm>
4 #include<iostream>
5 using namespace std;
6 int main(){
7 int m,n,t,s;
8 long long int sum=0;
9 int a[1010];
10 scanf("%d",&n);
11 while(n--){
12 sum=0;
13 scanf("%d %d",&t,&s);
14 for(int i=0;i<s;i++){
15 scanf("%d",&a[i]);
16 }
17 for(int i=0;i<s-1;i++){
18 if(a[i]>a[i+1]){
19 sum+=min((a[i]-a[i+1]+1),(a[i+1]+t-1-a[i]));
20 }else if(a[i]==a[i+1]){
21 sum++;
22 }else if(a[i]+1==a[i+1]){
23 continue;
24 }else{
25 sum+=min((a[i+1]-a[i]-1),(a[i]+t-a[i+1]+1));
26 }
27 }
28 printf("%lld\n",sum);
29 }
30 }

E.Simple Darts

题目:进行区域判断,通过反三角函数和圆位置进行相对判断,从而确定分数

 1 #include<iostream>
2 #include<algorithm>
3 #include<cstdio>
4 #include<cmath>
5 #include<string>
6 #include<map>
7 #include<sstream>
8 #include<cstring>
9 #include<vector>
10 #include<queue>
11 #define LL long long
12 const double pi=3.1415926;
13 using namespace std;
14 int main(){
15 int n;
16 scanf("%d",&n);
17 while(n--){
18 int w,b,d,s;
19 cin >> w >> b >> d >> s;
20 int t;
21 cin >> t;
22 long long int ans = 0;
23 while(t--){
24 double x,y;
25 cin >> x >> y;
26 double r,jiao;
27 r = x*x + y*y;
28 double fen = 2*pi/w;
29 if(r < b*b){
30 ans+=50;
31 }else if(r > b*b && r < d*d){
32 if((y/x)>0&&y>0){
33 jiao=atan(y/x);
34 }else if((y/x)>0&&y<0){
35 jiao=atan(y/x)+pi;
36 }else if((y/x)<0&&y<0){
37 jiao=atan(y/x)+2*pi;
38 }else if((y/x)<0&&x<0){
39 jiao=atan(y/x)+pi;
40 }else if(x==0&&y>0){
41 jiao=pi/2;
42 }else if(x==0&&y<0){
43 jiao=(pi*3)/2;
44 }else if(y==0&&x<0){
45 jiao=pi;
46 }else if(y==0&&x>0){
47 jiao=0;
48 }
49 int j=jiao/fen;
50 ans+=((j+1)*2);
51 }else if(r > d*d && r < s*s){
52 if((y/x)>0&&y>0){
53 jiao=atan(y/x);
54 }else if((y/x)>0&&y<0){
55 jiao=atan(y/x)+pi;
56 }else if((y/x)<0&&y<0){
57 jiao=atan(y/x)+2*pi;
58 }else if((y/x)<0&&x<0){
59 jiao=atan(y/x)+pi;
60 }else if(x==0&&y>0){
61 jiao=pi/2;
62 }else if(x==0&&y<0){
63 jiao=(pi*3)/2;
64 }else if(y==0&&x<0){
65 jiao=pi;
66 }else if(y==0&&x>0){
67 jiao=0;
68 }
69 int j=jiao/fen;
70 ans+=(j+1);
71 }else{
72 ans += 0;
73 }
74 }
75 printf("%lld\n",ans);
76 }
77 }

04.06 UCF Local Programming Contest 2017的更多相关文章

  1. 2020.4.6--UCF Local Programming Contest 2017的正式赛

    Problem A : Electric Bill 题目大意:进行电量分级制收费,1000kwh及以下一档收费,1000kwh以上按另一档收费,给出每个人的电量总额,问每人应支付多少钱. 思路:基础i ...

  2. UCF Local Programming Contest 2016 J题(二分+bfs)

    题目链接如下: https://nanti.jisuanke.com/t/43321 思路: 显然我们要采用二分的方法来寻找答案,给定一个高度如果能确定在这个高度时是否可以安全到达终点,那我们就可以很 ...

  3. 03.28,周六,12:00-17:00,ICPC训练联盟周赛,选用试题:UCF Local Programming Contest 2016正式赛。

    A. Majestic 10 题意:三个数均大于10则输出"triple-double",如果两个数大于10则输出"double-double",如果一个大于1 ...

  4. 03.21 ICPC训练联盟周赛:UCF Local Programming Contest 2018正式赛

    B Breaking Branches 题意:两个人比赛折枝,谁剩下最后1,无法折出整数即为输 思路:树枝长n,若是奇数,则Bob胜出,若是偶数,则Alice胜出,且需要输出1: 1 #include ...

  5. 2020.3.28-ICPC训练联盟周赛,选用试题:UCF Local Programming Contest 2016

    A.Majestic 10 签到题. #include<iostream> #include<cstdio> #include<cstring> #include& ...

  6. The North American Invitational Programming Contest 2017 题目

    NAIPC 2017 Yin and Yang Stones 75.39% 1000ms 262144K   A mysterious circular arrangement of black st ...

  7. ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2017)- K. Poor Ramzi -dp+记忆化搜索

    ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2017)- K. ...

  8. 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) E

    链接:http://codeforces.com/gym/101116 学弟写的,以后再补 #include <iostream> #include <algorithm> # ...

  9. 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 (2016 Stanford Local Programming Contest, Extended) J

    链接:http://codeforces.com/gym/101116 题意:给出n个点,要求一个矩形框将(n/2)+1个点框住,要面积最小 解法:先根据x轴选出i->j之间的点,中间的点(包括 ...

随机推荐

  1. java例题_47 读取 7 个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*

    1 /*47 [程序 47 打印星号] 2 题目:读取 7 个数(1-50)的整数值,每读取一个值,程序打印出该值个数的*. 3 */ 4 5 /*分析 6 * 1.多次读取---for循环 7 * ...

  2. Kubernetes中Deployment部署故障排除

    Kubernetes中Deployment部署故障排除 字符型思维导图 排查pod状态(带标签):kubectl get pods,是否有等待处理的pod? 是?kubectl describe po ...

  3. Java(133-151)【String类、static、Arrays类、Math类】

    1.字符串概述和特点 string在lang包里面,因此可以直接使用 字符串的内容不可变 2.字符串的构造方法和直接创建 三种构造方法 package cn.itcast.day08.demo01; ...

  4. 火爆外网的 DGS 框架使用

    Netflix 已开放其 Domain Graph Service(DGS)框架的源代码 ,该框架是为了方便整合 GraphQL 使用,用于简化 GraphQL 的实现. GraphQL 主要是作用于 ...

  5. Zookeeper基础原理&应用场景详解

    简单了解Zookeeper Tips: 如果之前对Zookeeper不了解的话,这里大概留个印象就好了 Zookeeper是一个分布式协调服务,可以用于元数据管理.分布式锁.分布式协调.发布订阅.服务 ...

  6. Score UVA - 1585

    ​ There is an objective test result such as "OOXXOXXOOO". An 'O' means a correct answer of ...

  7. 3、带你一步一步学习ASP.NET Core中的配置之Configuration

    如果你是刚接触ASP.NET Core的学习的话,你会注意到:在ASP.NET Core项目中,看不到.NET Fraemwork时代中的web.config文件和app.config文件了.那么你肯 ...

  8. 前端数据渲染及mustache模板引擎的简单实现

    早期数据渲染的几种方式 在模板引擎没有诞生之前,为了用JS把数据渲染到页面上,诞生了一系列数据渲染的方式. 最最基础的,莫过于直接使用DOM接口创建所有节点. <div id="roo ...

  9. NumPy之:结构化数组详解

    目录 简介 结构化数组中的字段field 结构化数据类型 创建结构化数据类型 从元组创建 从逗号分割的dtype创建 从字典创建 操作结构化数据类型 Offsets 和Alignment Field ...

  10. 11- APP性能测试GT工具的使用

    对性能测试来说有服务端的性能与客户端(APP)的性能. GT简介 1.GT(随身调)是APP的随身调测平台,它是直接运行在手机上的"集成调试环境"(IDTE) 2.利用GT,仅凭一 ...