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. 【.NET 与树莓派】小风扇模块

    小风扇,其实就是一个电机(马达),然后轴子上套一个扇叶.扇叶有两叶的,也有三叶的.这种我们小时候没少玩,太阳能帽子上就有一个小风扇,骑着自行车上学,路上只要有太阳光照射到,小风扇就会转.当然还有装干电 ...

  2. RabbitMQ 入门 (Go) - 2. 发布和接收消息

    本文我将使用 Go 语言在 RabbitMQ 上发布和接收消息. Go 的标准库本身并没有 RabbitMQ 的原生绑定,但是有一个第三方库确能够支持 RabbitMQ,它的源码在 https://g ...

  3. limanmanExp数据库审计设计思路与重要代码

    目的 在代码审计的时候经常会想看看某个访问会触发哪些数据库操作.目前已知的数据库审计有多家大型厂商的设备,还有seay源码审计系统中的数据库监控1.0 但是.开源的已知的就只有seay源码审计系统中的 ...

  4. 计划任务统一集中管理系统cronsun(替代crontab)

    一.背景 crontab 是 Linux 系统里面最简单易用的定时任务管理工具,相信绝大多数开发和运维都用到过,很多业务系统的定时任务都是通过 crontab 来定义的,时间长了后会发现存在很多问题: ...

  5. 「HTML+CSS」--自定义加载动画【010】

    前言 Hello!小伙伴! 首先非常感谢您阅读海轰的文章,倘若文中有错误的地方,欢迎您指出- 哈哈 自我介绍一下 昵称:海轰 标签:程序猿一只|C++选手|学生 简介:因C语言结识编程,随后转入计算机 ...

  6. [BFS]最小转弯问题

    最小转弯问题 Description 给出一张地图,这张地图被分为 n×m(n,m<=100)个方块,任何一个方块不是平地就是高山.平地可以通过,高山则不能.现在你处在地图的(x1,y1)这块平 ...

  7. 201871030131-谢林江 实验二 个人项目—《D{0-1} KP》项目报告

    项目 内容 课程班级博客链接 班级博客 这个作业要求链接 作业要求 我的课程学习目标 1.学习编写PSP2.完成个人项目实验要求3.在Github建仓 这个作业在哪些方面帮助我实现学习目标 1.首次编 ...

  8. Go+gRPC-Gateway(V2) 微服务实战,小程序登录鉴权服务(五):鉴权 gRPC-Interceptor 拦截器实战

    拦截器(gRPC-Interceptor)类似于 Gin 中间件(Middleware),让你在真正调用 RPC 服务前,进行身份认证.参数校验.限流等通用操作. 系列 云原生 API 网关,gRPC ...

  9. 3. Mybatis Insert

    案例: <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC &qu ...

  10. AI数学基础之:P、NP、NPC问题

    目录 简介 P问题 NP问题 NP问题的例子 有些NP问题很难解决 NPC问题 NP-hard P和NP问题 简介 我们在做组合优化的时候需要去解决各种问题,根据问题的复杂度不同可以分为P.NP.NP ...