点个赞再走呗
L

#include<bits/stdc++.h>
int cnt=0;
using namespace std;int cmp(int a,int b)
{return a>b;
}
typedef long long ll;
const int maxn=1e6+199;
int len1,len2,len3;
double a[maxn];
double b[maxn]={0};
char c[maxn];
double k;
int n,m;
int sum=0;int main(){cin>>n;for(int i=1;i<=n;i++)  cin>>a[i];for(int i=1;i<=n;i++)  b[i]=b[i-1]+a[i];for(int i=0;i<=n;i++){for(int j=i+2;j<=n;j++){k=(b[j]-b[i])/(j*1.0-i*1.0);for(int l=i+1;l<=j;l++){if(a[l]==k){sum++;break;}}}}cout<<sum+n;return 0;
}

F

Alice, Bob and Charlie are playing Card Game for Three, as below:

At first, each of the three players has a deck consisting of some number of cards. Each card has a letter a, b or c written on it. The orders of the cards in the decks cannot be rearranged.
The players take turns. Alice goes first.
If the current player’s deck contains at least one card, discard the top card in the deck. Then, the player whose name begins with the letter on the discarded card, takes the next turn. (For example, if the card says a, Alice takes the next turn.)
If the current player’s deck is empty, the game ends and the current player wins the game.
You are given the initial decks of the players. More specifically, you are given three strings SA, SB and SC. The i-th (1≦i≦|SA|) letter in SA is the letter on the i-th card in Alice’s initial deck. SB and SC describes Bob’s and Charlie’s initial decks in the same way.

Determine the winner of the game.

Constraints
1≦|SA|≦100
1≦|SB|≦100
1≦|SC|≦100
Each letter in SA, SB, SC is a, b or c.
输入
The input is given from Standard Input in the following format:
SA
SB
SC
输出
If Alice will win, print A. If Bob will win, print B. If Charlie will win, print C.
样例输入 Copy
aca
accc
ca
样例输出 Copy
A
提示
The game will progress as below:
Alice discards the top card in her deck, a. Alice takes the next turn.
Alice discards the top card in her deck, c. Charlie takes the next turn.
Charlie discards the top card in his deck, c. Charlie takes the next turn.
Charlie discards the top card in his deck, a. Alice takes the next turn.
Alice discards the top card in her deck, a. Alice takes the next turn.
Alice’s deck is empty. The game ends and Alice wins the game.

#include<bits/stdc++.h>
int cnt=0;
using namespace std;int cmp(int a,int b)
{return a>b;
}
typedef long long ll;
const int maxn=1e6+199;
int len1,len2,len3;
char a[maxn];
char b[maxn];
char c[maxn];
int k,n,m;
int sum=0;
void zoua();
void zoub();
void zouc();
int s=0,ss=0,sss=0;void zoua()
{s++;if(len1<s){cout<<"A";return;}if(a[s-1]=='a'){zoua();}else if(a[s-1]=='b'){zoub();}else if(a[s-1]=='c'){zouc();}}void zoub()
{ss++;if(ss>len2){cout<<"B";return;}if(b[ss-1]=='a'){zoua();}else if(b[ss-1]=='b'){zoub();}else if(b[ss-1]=='c'){zouc();}
}void zouc()
{sss++;if(len3<sss){cout<<"C";return;}if(c[sss-1]=='a'){zoua();}else if(c[sss-1]=='b'){zoub();}else if(c[sss-1]=='c'){zouc();}
}
int main(){scanf("%s%s%s",a,b,c);len1=strlen(a);len2=strlen(b);len3=strlen(c);if(a[s]=='a'){s++;zoua();}else if(a[s]=='b'){s++;zoub();}else if(a[s]=='c'){s++;zouc();}return 0;
}

A
全排列问题
如果会全排列就小kiss了

#include<bits/stdc++.h>
int cnt=0;
using namespace std;
typedef long long ll;
const int maxn=1e6+199;
ll a[maxn];
int k,n,m;
void dop()
{for (k = n - 1; k >= 1; k--){if (a[k] < a[k + 1])break;}for (int i = n; i > k; i--){if (a[i] > a[k]){swap(a[i], a[k]);break;}}sort(a + k + 1, a + n + 1);
}
int main(){cin>>n;cin>>m;for(int i=1;i<=n;i++)cin>>a[i];int i=0;while(i<m){i++;dop();}for(int i=1;i<=n;i++){if(i==1)cout<<a[i];elsecout<<' '<<a[i];}return 0;
}

Contest2676 - 2021ACM俱乐部后备营个人训练赛第14场A(全排列) F(扑克牌) L题解相关推荐

  1. Contest2656 - 2021ACM俱乐部后备营个人训练赛第4场

    10356 Problem A 包裹托运 题目描述 春节快到了,小红和爸爸一起来到邮局,打算给家住外地的爷爷.奶奶家里捎点年货.邮局的阿姨介绍,托运包裹的运费标准是:包裹重量不大于15公斤时,每公斤6 ...

  2. 2020ACM俱乐部后备营个人训练赛第七、八、九场

    第七场 问题 B: 数字塔 思路 简单的递推 例如: a1 a2 a3 ( a1 + a2 ) % 10 = a3 如果我们已知 a3 , a2 求 a1 怎么求 因为数字都是 0 - 9 的,所以 ...

  3. Contest3121 - 2021级新生个人训练赛第26场_问题 F: 乐乐的数字

    // 问题 F: 乐乐的数字 时间限制: 1.000 Sec 内存限制: 128 MB题目描述 乐乐做完数学作业,突发奇想定义了一种新的数:乐乐数.乐乐把n个数排成一行,一个数的"乐乐数&q ...

  4. Contest3125 - 2021级新生个人训练赛第27场_问题 F: 兔子

    //问题 F: 兔子 时间限制: 1.000 Sec 内存限制: 128 MB题目描述 从左往右有100000001个整数点,分别是整数点0至整数点100000000.有n只兔子,第i只兔子在整数点d ...

  5. 2021年度训练联盟热身训练赛第四场 H - Rock Paper Scissors(字符串匹配,FFT)

    整理的算法模板合集: ACM模板 点我看算法全家桶系列!!! 实际上是一个全新的精炼模板整合计划 2021年度训练联盟热身训练赛第四场 H - Rock Paper Scissors(字符串匹配,FF ...

  6. 19级算法训练赛第七场

    19级算法训练赛第七场 传送门:https://vjudge.net/contest/362412#problem/J A - 程序设计:合并数字 蒜头君得到了 n 个数,他想对这些数进行下面这样的操 ...

  7. 2021年度训练联盟热身训练赛第五场

    2021年度训练联盟热身训练赛第五场 链接:https://ac.nowcoder.com/acm/contest/13926 A Binary Seating #include<bits/st ...

  8. 2021年度训练联盟热身训练赛第八场

    目录 2021年度训练联盟热身训练赛第八场 A-Fire on Field 题意 思路 代码 B-Gene Tree 题意 思路 代码 I-Thread Knots 题意 思路 代码 J-Triang ...

  9. 2021UPC个人训练赛第47场

    个人训练赛第47场 A: 加工零件(最短路) 问题 A: 加工零件时间限制: 1 Sec 内存限制: 128 MB 题目描述 凯凯的工厂正在有条不紊地生产一种神奇的零件,神奇的零件的生产过程自然也很神 ...

最新文章

  1. 使用Aspose.Pdf for .NET实现PDF文档到Excel、EPS、SVG等的转换
  2. C++ 和 Java,你选哪个? | 每日趣闻
  3. 用c# 实现设计器 DesignSurface
  4. 学习笔记-4.1用户管理命令
  5. js实现modbus_nodejs中使用modbus-serial库创建Modbus TCP读取设备的数据
  6. 并发编程总结4-JUC-REENTRANTLOCK-2(公平锁)
  7. 【渝粤教育】电大中专Windows操作系统作业 题库
  8. 大数据应用之金融行业-互联网金融对传统银行业的冲击,狼真的来了
  9. 上网时间监控软件_电脑监控系统软件有哪些作用?主要功能有哪些?
  10. spring mvc 原理及应用
  11. C/C++网络编程工作笔记0002---网络编程流程
  12. 【深入理解JS核心技术】13. 什么是高阶函数
  13. 使用Foxmail登录阿里企业邮箱(钉钉邮箱)
  14. 编程实践(Pandas)Task08
  15. mysql 丢失msvcr120.dll_安装MySQL数据库提示计算机中丢失MSVCR120.dll文件
  16. 快递电子面单接口php,快递电子面单
  17. [C/C++]宽字符与控制台输出
  18. 小米linux平板触摸屏驱动安装方法,windows10系统怎样安装触摸屏的驱动
  19. VMware Workstation虚拟机设置联网(Linux)
  20. 如何一键解决图片无损放大

热门文章

  1. php三行情书,文案得看看这些三行情书
  2. 禅道怎么启动mysql_解决禅道(ZenTao)Mysql启动不了的有关问题_mysql
  3. 表格检测识别技术的发展历程
  4. 韩国制造集团选择SQream平台进行异常检测
  5. 微服务核心---服务的注册与发现,它们是什么?
  6. 001 Arduino硬件知识
  7. 请将磁盘插入“U盘(H)“的情况无法访问 磁盘结构损坏且无法读取
  8. iso20000认证一般要多少费用
  9. 现在市面上苹果手机试玩有比无限刷更好的技术吗如何解决封号问题
  10. MySQL 用于汉字要使用二进码