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

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&…
Problem A : Electric Bill 题目大意:进行电量分级制收费,1000kwh及以下一档收费,1000kwh以上按另一档收费,给出每个人的电量总额,问每人应支付多少钱. 思路:基础if else题,对于每个电量判断是否大于1000,再分别计算≤1000的价格和>1000的价格,最后相加并输出. #include<algorithm> #include<iostream> #include<cstring> #include<cstdio&g…
题目链接如下: https://nanti.jisuanke.com/t/43321 思路: 显然我们要采用二分的方法来寻找答案,给定一个高度如果能确定在这个高度时是否可以安全到达终点,那我们就可以很快二分出最大可行的高度.在判断一个高度是否可行时,搜索从起点开始,在限制的高度下所有可以到达的坐标位置,检验是否经过终点即可. /************************************************ ┆ ┏┓ ┏┓ ┆ ┆┏┛┻━━━┛┻┓ ┆ ┆┃ ┃ ┆ ┆┃ ━ ┃…
A. Majestic 10 题意:三个数均大于10则输出"triple-double",如果两个数大于10则输出"double-double",如果一个大于10则输出"double",如果没有数大于10则输出"zilch" #include<stdio.h> int main(){ int n,a,b,c; scanf("%d",&n); while(n--){ scanf("…
B Breaking Branches 题意:两个人比赛折枝,谁剩下最后1,无法折出整数即为输 思路:树枝长n,若是奇数,则Bob胜出,若是偶数,则Alice胜出,且需要输出1: 1 #include<stdio.h> 2 int main(){ 3 int n; 4 scanf("%d",&n); 5 if(n%2==0){ 6 printf("Alice\n"); 7 printf("1\n"); 8 }else{ 9 p…
A.Majestic 10 签到题. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<bitset> #include<cassert> #include<cctype> #include<cmath> #include<cstdlib> #include<ctime>…
NAIPC 2017 Yin and Yang Stones 75.39% 1000ms 262144K   A mysterious circular arrangement of black stones and white stones has appeared. Ming has been tasked with balancing the stones so that only one black and one white stone remain. Ming has two ope…
ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2017)- K. Poor Ramzi -dp+记忆化搜索 [Problem Description] 给你一串\(01\)字符串,将其划分,使得划分后,分别求出每组\(01\)之和后是回文的,求划分的方案数, [Solution] 定义\(dp[l][r]\)表示,区间\([l,r]\)中满足条件的方案数是多少.…
链接:http://codeforces.com/gym/101116 学弟写的,以后再补 #include <iostream> #include <algorithm> #include <stdio.h> #include <cstring> #include <map> #include <vector> using namespace std; map<string,int>v,ans; vector<in…
链接:http://codeforces.com/gym/101116 题意:给出n个点,要求一个矩形框将(n/2)+1个点框住,要面积最小 解法:先根据x轴选出i->j之间的点,中间的点(包括两边)按照y排序,固定一边X=(xj-xi),Y就枚举点两端的Y坐标,细节是注意要取(n/2)+1个点 事实上这样取里面一定符合要求 #include <iostream> #include <cstdio> #include <algorithm> #include &l…