A

C++ Example

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <cctype>
using namespace std;
int main(){
int a,b;
cin>>a>>b;
if(a+b==15)puts("+");
else if(a*b==15)puts("*");
else puts("x");
return 0;
}

B

C++ Example

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <cctype>
using namespace std;
const int maxn=100000;
char str[maxn];
int main(){
int w;
scanf("%s",str);
scanf("%d",&w);
if(w==1){printf("%s",str);return 0;}
for(int i=0;i<strlen(str);i++){
if(i%w==0){
putchar(str[i]);
}
}
return 0;
}

C

这题画风突变啊喂

这题我比较SB打表没找出规律还是yjw学长点醒了我 \(yjw\)学长 \(orz\)

这题其实是个概率题,长度为\(m\),则最多有\(m-1\)对数字,显然每一对之间是互相不影响的,于是我们先来研究一对数字的情况:

首先每个数字都有n个数字与之配对,总计\(n × n\)种情况,再考虑对答案做贡献的,假设那一对数字是\(x,y (y>x)\),则能做贡献的情况有\(n-d\)种.当然我们这只是\(x<y\)的情况,所以共\(2×(n-d)\)种。当然\(d==0\)时,就无关大小,只有\((n-d)\)种,这需要特判.

然后交上去还是\(WA\)了,发现强制类型转换写在括号外导致会爆\(int\),比较坑

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <cctype>
#include <cmath>
#define ri register int
using namespace std;
template <class T>void read(T &x){
x=0;int ne=0;char c;
while(!isdigit(c=getchar()))ne=c=='-';
x=c-48;
while(isdigit(c=getchar()))x=(x<<3)+(x<<1)+c-48;
x=ne?-x:x;
return ;
}
int n,m,d;
int main(){
read(n),read(m),read(d);
if(d==0)printf("%.10Lf\n",(long double)(m-1)/n);
else if(n<=d)printf("0.0000000\n");
else printf("%.10Lf\n",(long double)(1.00*2*(n-d)*(m-1))/n/n);
return 0;
}

D

这题解法很有意思,比较考验智商

求两个最短路,一个是\(s\)到\(x (x \in [1,n])\)的用\(yen\)衡量的最短路\(dis_1(s,x)\),一个是从\(t\)到\(x (x \in [1,n])\)的最短路\(dis_2(t,x)\),用\(snuuk\)衡量的最短路

然后我们想,最后\(n-1\)年出发的时候只用\(n\)这个点可以交换货币,所以\(val[n-1]=dis_1(s,n)+dis_2(t,n)\)

再向下想,在\(n-2\)年出发时,要么继续到\(n\)这个点交换货币,要么到\(n-1\)这个点交换货币,以此类推得到

\(val[p]=min(val[p+1],dis_1(s,p)+dis_2(t,p)) p \in [0,n-1]\)

最后初始钱数\(-val\)值就是对应答案

E

我太菜不知道怎么做,等待咕咕咕的题解吧

Atcoder-SoundHound Inc.Contest 2018 -Masters Tournament-比赛报告的更多相关文章

  1. AtCoder SoundHound Inc. Programming Contest 2018 E + Graph (soundhound2018_summer_qual_e)

    原文链接https://www.cnblogs.com/zhouzhendong/p/AtCoder-SoundHound-Inc-Programming-Contest-2018-E.html 题目 ...

  2. ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2018) Syria, Lattakia, Tishreen University, April, 30, 2018

    ACM International Collegiate Programming Contest, Tishreen Collegiate Programming Contest (2018) Syr ...

  3. German Collegiate Programming Contest 2018​ B. Battle Royale

    Battle Royale games are the current trend in video games and Gamers Concealed Punching Circles (GCPC ...

  4. The North American Invitational Programming Contest 2018 D. Missing Gnomes

    A family of nn gnomes likes to line up for a group picture. Each gnome can be uniquely identified by ...

  5. The North American Invitational Programming Contest 2018 H. Recovery

    Consider an n \times mn×m matrix of ones and zeros. For example, this 4 \times 44×4: \displaystyle \ ...

  6. The North American Invitational Programming Contest 2018 E. Prefix Free Code

    Consider nn initial strings of lower case letters, where no initial string is a prefix of any other ...

  7. [AtCoder] NIKKEI Programming Contest 2019 (暂缺F)

    [AtCoder] NIKKEI Programming Contest 2019   本来看见这一场的排名的画风比较正常就来补一下题,但是完全没有发现后两题的AC人数远少于我补的上一份AtCoder ...

  8. [AtCoder] Yahoo Programming Contest 2019

    [AtCoder] Yahoo Programming Contest 2019   很遗憾错过了一场 AtCoder .听说这场是涨分场呢,于是特意来补一下题. A - Anti-Adjacency ...

  9. ACM-ICPC Asia Beijing Regional Contest 2018 Reproduction hihocoder1870~1879

    ACM-ICPC Asia Beijing Regional Contest 2018 Reproduction hihocoder1870~1879 A 签到,dfs 或者 floyd 都行. #i ...

随机推荐

  1. linux编辑文本(vim)时跳转到最后一行和第一行及相关指令

    vi操作 1.跳到文本的最后一行:按“G”,即“shift+g” 2.跳到最后一行的最后一个字符 : 先重复1的操作即按“G”,之后按“$”键,即“shift+4”. 3.跳到第一行的第一个字符:先按 ...

  2. quartz 定时器时间表达式

    按顺序依次为 秒(~) 分钟(~) 小时(~) 天(月)(~,但是你需要考虑你月的天数) 月(~) 天(星期)(~ =SUN 或 SUN,MON,TUE,WED,THU,FRI,SAT) .年份(-) ...

  3. smaller programs should improve performance RISC(精简指令集计算机)和CISC(复杂指令集计算机)是当前CPU的两种架构 区别示例

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION In this section, we l ...

  4. JVM内存管理 + GC垃圾回收机制

    2.JVM内存管理 JVM将内存划分为6个部分:PC寄存器(也叫程序计数器).虚拟机栈.堆.方法区.运行时常量池.本地方法栈 PC寄存器(程序计数器):用于记录当前线程运行时的位置,每一个线程都有一个 ...

  5. linux服务之redis

    redis wget http://download.redis.io/releases/redis-4.0.6.tar.gzcd redis-4.0.6makecd src/./redis-serv ...

  6. 异步发送表单数据到JavaBean,并响应JSON文本返回

    1)  提交表单后,将JavaBean信息以JSON文本形式返回到浏览器 <form> 编号:<input type="text" name="id&q ...

  7. Tween(补间)动画

    视图动画,也叫Tween(补间)动画可以在一个视图容器内执行一系列简单变换(位置.大小.旋转.透明度).譬如,如果你有一个TextView对象,您可以移动.旋转.缩放.透明度设置其文本,当然,如果它有 ...

  8. Lucence简单学习---1

    package cn.itheima.lucene; import java.io.File; import java.util.ArrayList; import java.util.List; i ...

  9. 树莓派上安装Samba实现树莓派与Windows间的文件共享

    我是参考这篇文章的: https://www.jianshu.com/p/ead92b06318e 安装samba和common-bin库(具有smbpasswd效用) sudo apt-get in ...

  10. 转:OPC协议解析-OPC UA OPC统一架构

    1    什么是OPC UA 为了应对标准化和跨平台的趋势,为了更好的推广OPC,OPC基金会近些年在之前OPC成功应用的基础上推出了一个新的OPC标准-OPC UA.OPC UA接口协议包含了之前的 ...