A.CodeForces-124A

(简单数学题)

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int a,b,n;
scanf("%d %d %d",&n,&a,&b);
if((n-a)>b){
printf("%d",b+1);
}else{
printf("%d",n-a);
}
}

D.cAPS

要么只包含大写字母,要么除了第一个字母外都是大写,才进行变化,否则输出原来字符串

多注意题目要求,仔细读题。

 1 #include<stdio.h>
2 #include<string.h>
3 int main(){
4 char s[110];
5 gets(s);
6 int len;
7 len=strlen(s);
8 int flag=0;
9 for(int i=1;i<len;i++){
10 if(s[i]>='a'&&s[i]<='z'){
11 flag=1;
12 break;
13 }
14 }
15 if(flag==1){
16 puts(s);
17
18 }else{
19 for(int i=0;i<len;i++){
20 if(s[i]>='a'&&s[i]<='z'){
21 printf("%c",s[i]-'a'+'A');
22 }else{
23 printf("%c",s[i]-'A'+'a');
24 }
25 }
26 }
27
28 }

E.Opposites Attract

数学问题,相反数的个数相乘即可,但是注意0需要特判,数字和数组也要开__int64

 1 #include<cstdio>
2 #include<cstring>
3 #include<algorithm>
4 #include<cmath>
5 using namespace std;
6 __int64 a[11]={0},b[11]={0};
7 int main(){
8 __int64 n,m,sum=0;
9 scanf("%I64d",&n);
10
11 for(int i=0;i<n;i++){
12 scanf("%I64d",&m);
13 if(m>0){
14 a[m]++;
15 }else{
16 b[-m]++;
17 }
18 }
19 for(int i=0;i<=10;i++){
20 sum+=(a[i]*b[i]);
21 }
22 if(b[0]>1){
23 sum+=(b[0]*(b[0]-1))/2;
24 }
25 printf("%I64d",sum);
26 }

F.The World IS A Theatre

组合数学问题

 1 #include<cstdio>
2 #include<cstring>
3 #include<algorithm>
4 #include<cmath>
5 using namespace std;
6 __int64 calcu(__int64 a,__int64 b);
7 int main(){
8 __int64 m,n,sum=0,t;
9 scanf("%I64d %I64d %I64d",&n,&m,&t);
10 for(int i=4;i<=t-1;i++){
11 sum+=(calcu(n,i)*calcu(m,t-i));
12 }
13 printf("%I64d",sum);
14
15 }
16 __int64 calcu(__int64 a,__int64 b){
17 __int64 i,item=1;
18 if(b>a) return 0;
19 int j=min(a-b,b);
20 for(i=1;i<=j;i++){
21 item*=a;
22 a--;
23 item/=i;
24
25 }
26 return item;
27
28 }

QFNU-ACM 2020.04.05个人赛补题的更多相关文章

  1. 2020.12.3--vj个人赛补题

    A Vasya studies music.He has learned lots of interesting stuff. For example, he knows that there are ...

  2. 2020.10.30--vj个人赛补题

    D - D CodeForces - 743A Vladik is a competitive programmer. This year he is going to win the Interna ...

  3. 2020.10.23-vj个人赛补题

    B - B Polycarp loves lowercase letters and dislikes uppercase ones. Once he got a string s consistin ...

  4. 2020.10.16--vj个人赛补题

    D - Drinks Choosing Old timers of Summer Informatics School can remember previous camps in which eac ...

  5. 2020.10.9--vj个人赛补题

    B - A Tide of Riverscape 题意:给出一组字符串,由'0','1',' . '组成,' . '可以换成 0或1,判断第 i  个和第 i+p 个字符是否可以不相等,如果可以则输出 ...

  6. LCCUP 2020 秋季编程大赛 补题

    果然是力扣杯,难度较于平时周赛提高了不少,个人感觉最后两题并不太容易QAQ LCP 18.早餐组合 #二分思想 题目链接 题意 你获得了每种主食的价格,及每种饮料的价格,你需要选择一份主食和一份饮料, ...

  7. Technocup 2020 - Elimination Round 1补题

    慢慢来. 题目册 题目 A B C D tag math strings greedy dp 状态 √ √ √ √ //∅,√,× 想法 A. CME res tp A 题意:有\(n\)根火柴,额外 ...

  8. 第十届山东省acm省赛补题(1)

    今天第一场个人训练赛的题目有点恐怖啊,我看了半个小时多硬是一道都不会写.我干脆就直接补题去了.... 先补的都是简单题,难题等我这周末慢慢来吧... A Calandar Time Limit: 1 ...

  9. 【补题记录】ZJU-ICPC Summer Training 2020 部分补题记录

    补题地址:https://zjusummer.contest.codeforces.com/ Contents ZJU-ICPC Summer 2020 Contest 1 by Group A Pr ...

随机推荐

  1. ImportError: No module named site

    cmd中执行python提示:ImportError: No module named site 运行python.exe Fatal Python error: initfsencoding: un ...

  2. 对象存储服务-Minio

    Mino 目录 Mino 对象存储服务 Minio 参考 Minio 架构 为什么要用 Minio 存储机制 纠删码 MinIO概念 部署 单机部署: Docker 部署Minio 分布式Minio ...

  3. Android Studio 之 通过 Intent 完成点击按钮实现页面跳转

    •Intent 简介 Intent 是 Android 程序中各组件之间进行交互的一种重要方式: 它不仅可以指明当前组件想要执行的动作,还可以在不同组件之间传递数据. Intent 有多个构造函数,其 ...

  4. 【分布式】SpringCloud(3)--Eureka服务注册与发现

    1.Eureka概述 1.1.什么是Eureka Eureka是Netflix的一个子模块.基于REST的服务,用于定位服务,以实现云端中间层服务发现和故障转移. 只需要使用服务的标识符,就可以访问到 ...

  5. [Fundamental of Power Electronics]-PART II-8. 变换器传递函数-8.5 交流传递函数以及阻抗的测量/8.6 本章小结

    8.5 交流传递函数以及阻抗的测量 测量原型变换器和变换器系统的传递函数是非常好的工程实践过程.这样的实践可以验证系统是否被正确地建模和设计.此外,通过测量单个电路元件的端阻抗来表征其特性也是非常有用 ...

  6. 软工AI Bot NABCD分析

    目标: 打造一个基于大数据的 IT 问答机器人服务,通过运用人工和AI 技术,极大提高问答产品的用户满意度. 适合高校<软件工程>,<人工智能>课程作为结对编程或者团队项目. ...

  7. 记一次踩坑之路之Ubuntu未导入镜像前配置docke/docker-composer

    更新 apt 包索引与升级 sudo apt-get update sudo apt-get upgrade 安装 apt 依赖包,用于通过HTTPS来获取仓库: sudo apt-get insta ...

  8. HTML前世今生

    HTML贯穿了整个互联网的发展史,就目前来看,它还会继续下去,因为HTTP和HTTPS协议在互联网中传输的主要内容,也是用户浏览的最终页面管理内容,接下来就来扒一扒HTML的前世今生. 历史舞台已交给 ...

  9. PAT A1025 考生排名问题

    题目要求:有n个考场,每个考场有若干个考生,现给出各个考场中考生的准考证号与分数,按照分数从高到低排序,并按顺序输出所有考生的准考证号,排名,考场号以及所在的考场排名 #include<cstd ...

  10. 铁人三项(第五赛区)_2018_seven

    铁人三项(第五赛区)_2018_seven 先来看看保护 保护全开,IDA分析 首先申请了mmap两个随机地址的空间,一个为rwx,一个为rw 读入的都shellcode长度小于等于7,且这7个字符不 ...