链接:https://codeforces.com/contest/785


A - Anton and Polyhedrons

#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+;
map<string,int> mp;
int n,sum;
string str;
int main()
{
ios::sync_with_stdio();
cin.tie(), cout.tie(); mp.clear();
mp["Tetrahedron"]=;
mp["Cube"]=;
mp["Octahedron"]=;
mp["Dodecahedron"]=;
mp["Icosahedron"]=; cin>>n, sum=;
while(n--) cin>>str, sum+=mp[str];
cout<<sum<<endl;
}

B - Anton and Classes

#include<bits/stdc++.h>
#define pb(x) push_back(x)
using namespace std;
typedef pair<int,int> P;
#define fi first
#define se second
#define mk(x,y) make_pair(x,y)
const int MAX=2e5+; int n,m,x,y;
vector<P> A;
P L,R; int main()
{
ios::sync_with_stdio();
cin.tie(), cout.tie(); cin>>n;
while(n--)
{
cin>>x>>y;
A.pb(mk(x,y));
} cin>>m;
L=mk(,(int)2e9), R=mk(,);
while(m--)
{
cin>>x>>y;
if(y<L.se) L=mk(x,y);
if(x>R.fi) R=mk(x,y);
}
// cout<<L.fi<<" "<<L.se<<endl;
// cout<<R.fi<<" "<<R.se<<endl; int res=;
for(auto x:A)
{
int now=;
if(x.fi>L.se) now=max(now,x.fi-L.se);
if(x.se<R.fi) now=max(now,R.fi-x.se);
res=max(res,now);
}
cout<<res<<endl;
}

C - Anton and Fairy Tale - [算术题]

#include<bits/stdc++.h>
using namespace std;
typedef long long ll; ll n,m; int main()
{
cin>>n>>m;
if(n<=m) cout<<n<<endl;
else
{
ll k=sqrt(*(n-m));
while(k*(k+)/<n-m) k++;
cout<<m+k<<endl;
}
}

D - Anton and School - 2 - [范德蒙德恒等式][快速幂+逆元]

Codeforces 785 - A/B/C/D/E - (Undone)的更多相关文章

  1. Codeforces 785 D.Anton and School - 2(组合数处理)

    Codeforces 785 D.Anton and School - 2 题目大意:从一串由"(",")"组成的字符串中,找出有多少个子序列满足:序列长度为偶 ...

  2. Codeforces 785 E. Anton and Permutation(分块,树状数组)

    Codeforces 785 E. Anton and Permutation 题目大意:给出n,q.n代表有一个元素从1到n的数组(对应索引1~n),q表示有q个查询.每次查询给出两个数l,r,要求 ...

  3. Codeforces 785 D. Anton and School - 2

    题目链接:http://codeforces.com/contest/785/problem/D 我们可以枚举分界点,易知分界点左边和右边分别有多少个左括号和右括号,为了不计算重复我们强制要求选择分界 ...

  4. Codeforces 1138 - A/B/C/D/E - (Undone)

    链接:https://codeforces.com/contest/1137 A - Skyscrapers 题解:对于每一段 $1$ 和每一段 $2$,统计他们的长度.因此对于相邻的两段长度求较小值 ...

  5. Codeforces 677 - A/B/C/D/E - (Undone)

    链接: A - Vanya and Fence - [水] AC代码: #include<bits/stdc++.h> using namespace std; ; int n,h; in ...

  6. Codeforces 1062 - A/B/C/D/E - (Undone)

    链接:http://codeforces.com/contest/1062 A - Prank - [二分] 题意: 给出长度为 $n(1 \le n \le 100)$ 的数组 $a[1 \sim ...

  7. Codeforces 1032 - A/B/C/D/E - (Undone)

    链接:http://codeforces.com/contest/1032/ 是真的真的真的忍不住想吐槽这题意是真的真的真的读不懂…… A - Kitchen Utensils - [简单数学题] 题 ...

  8. CodeForces 785 D Anton and School - 2 范德蒙恒等式

    Anton and School - 2 题解: 枚举每个左括号作为必选的. 那么方案数就应该是下面的 1 , 然后不断化简, 通过范德蒙恒等式 , 可以将其化为一个组合数. 代码: #include ...

  9. Codeforces 1154 - A/B/C/D/E/F/G - (Undone)

    链接:https://codeforces.com/contest/1154 A - Restoring Three Numbers - [水] #include<bits/stdc++.h&g ...

随机推荐

  1. monkeyrunner环境配置

    1.安装JDK.android  SDK.Python (安装完成后,配置环境变量:%JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;%ANDROID_HOME%\platfor ...

  2. SQL 两个表有关联,通过其中一个表的列,更新另一个表的列。

    换了工作又开始写SQL了. update dic_rate_package set post_next_day=t.post_next_day from dic_package t inner joi ...

  3. BETA 版冲刺前准备(团队)

    过去存在的问题 文档问题 未能事先做好设计文档,且小程序与后端数据库接口存在问题 界面问题 原型图设计花的时间较少,小程序设计界面仍相对粗糙,前端成员css元素应用经验不足 小程序界面之间对接存在问题 ...

  4. 【原创】大数据基础之Mesos(1)简介、安装、使用

    Mesos 1.7.1 官方:http://mesos.apache.org/ 一 简介 Program against your datacenter like it’s a single pool ...

  5. Java对象模型规约

      下面是我根据工作中项目的经验,总结的一套自己觉得比较方便的对象模型规约   model(实体模型)      -vo(与前端交互的对象模型,前端泛指页面.移动端和远程服务调用等)         ...

  6. nginx——location匹配流程图

    location匹配流程图 location理解 1.收到url请求后,nginx首先进行精确匹配(有“=”的为精确匹配),如果匹配成功,则直接返回精确匹配结果,如果没有命中则会继续向下进行普通匹配 ...

  7. C/C++的20个位运算技巧

    一提起位运算,人们往往想到它的高效性,无论是嵌入式编程还是优化系统的核心代码,适当的运用位运算总是一种迷人的手段,或者当您求职的时候,在代码中写入适当的位运算也会让您的程序增加一丝亮点,最初当我读&l ...

  8. socket.io中 connect与connection的区别

    参考网址:https://blog.csdn.net/sinat_18474835/article/details/80115961

  9. Python内置函数之-property

    property 是一个内置的装饰器函数,只在面向对象中使用 求一个圆的周长和面积 # 周长和面积都是通过类的方法得到from math import pi class Cricle: def __i ...

  10. C#学习-多态

    由于可以继承基类的所有成员,子类就都有了相同的行为,但是有时子类的某些行为需要相互区别,子类需要覆写父类中的方法来实现子类特有的行为. 多态即相同类型的对象调用相同的方法却表现出不同行为的现象. 只有 ...