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. P1208 [USACO1.3]混合牛奶 Mixing Milk(JAVA语言)

    思路 按单价排序然后贪心 题目描述 由于乳制品产业利润很低,所以降低原材料(牛奶)价格就变得十分重要.帮助Marry乳业找到最优的牛奶采购方案. Marry乳业从一些奶农手中采购牛奶,并且每一位奶农为 ...

  2. 打造云原生大型分布式监控系统系列文章-腾讯工程师roc

    附上本系列文章链接 打造云原生大型分布式监控系统(一): 大规模场景下 Prometheus 的优化手段 打造云原生大型分布式监控系统(二): Thanos 架构详解 打造云原生大型分布式监控系统(二 ...

  3. [Fundamental of Power Electronics]-PART I-5.不连续导电模式-5.3 Boost变换器实例

    5.3 Boost变换器实例 作为第二个示例,考虑图5.12的Boost变换器.让我们来确定不同模式的边界并且求解DCM下的电压变换比.此前在2.3节中分析了在CCM工作的Boost变换器的特性,并确 ...

  4. 6.1vector用法

    目录 一.用法介绍 二.基本用法 三.PAT A1039 一.用法介绍 vector<typename>name; 按照这样的格式进行定义与书写. 注意定义成双数组的情况要加上空格. ve ...

  5. libnet的使用详解

    最近搬砖需要对libnet进行介绍在这里对知识进行汇总. 1.libnet简介 在libnet出现以前,如果要构造数据包并发送到网络中,程序员要通过一些复杂的接口来处理.libnet的出现,为程序员提 ...

  6. Windows命令行学习(系统信息收集)

    echo off :关闭回显 echo on :开启回显 net user :显示主机的电脑用户 ipconfig /displaydns:后面的 /displaydns是显示当前电脑所缓存的dns信 ...

  7. Day15_86_通过反射机制获取所有方法(method)

    通过反射机制获取所有方法(method) import java.lang.reflect.Field; import java.lang.reflect.Method; import java.la ...

  8. 模拟退火算法Python编程(3)整数规划问题

    1.整数规划问题 整数规划问题在工业.经济.国防.医疗等各行各业应用十分广泛,是指规划中的变量(全部或部分)限制为整数,属于离散优化问题(Discrete Optimization). 线性规划问题的 ...

  9. 小白学PID-以大疆M3508、M2006为例

    前言: 最近用到了大疆的直流无刷(BLDC)减速电机M3508和M2006.做RoboMaster比赛的同学应该对它们很熟悉,这两款电机质量都不错,配套电调C620.C610功能强大,应用场景广泛.当 ...

  10. 869. Reordered Power of 2

    Starting with a positive integer N, we reorder the digits in any order (including the original order ...