链接:


A - Vanya and Fence - [水]

AC代码:

#include<bits/stdc++.h>
using namespace std;
const int maxn=1e3+;
int n,h;
int main()
{
cin>>n>>h;
int ans=;
for(int i=,a;i<=n;i++)
{
cin>>a;
if(a<=h) ans++;
else ans+=;
}
cout<<ans<<endl;
}

B - Vanya and Food Processor - [模拟]

应该就是https://www.cnblogs.com/dilthey/p/6804187.html我这篇远古文章中记录的这道题目的来源。

模拟的时候注意不要一秒一秒的模拟,并且注意使用long long类型,就可以了。

AC代码:

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=1e5+;
ll n,h,k,a[maxn];
int main()
{
ios::sync_with_stdio();
cin.tie(), cout.tie(); cin>>n>>h>>k;
for(int i=;i<=n;i++) cin>>a[i]; int p=;
ll t=, cnt=a[];
while(p<=n)
{
while(p+<=n && cnt+a[p+]<=h) cnt+=a[++p];
if(cnt>k) t+=cnt/k, cnt%=k;
else cnt=, t++; if(p==n && cnt==) break;
}
cout<<t<<endl;
}

C - Vanya and Label - [快速幂]

题意:给你一个 $64$ 进制的数字,让你找出所有等长的两个 $64$ 进制数对,使得他们的按位与结果和给出的这个数字相同。

题解:转成二进制观察一下,给定的数字其所有为 $0$ 的位置,对应到数对可以产生三种选择:“$0,1$”、“$1,1$”、“$1,0$”,所以就统计一下二进制下 $0$ 出现的次数,记为 $x$,求 $3^x$ 即可。

AC代码:

#include<bits/stdc++.h>
using namespace std;
typedef bitset<> B;
typedef long long ll;
const int mod=1e9+;
string s;
int num[];
void init()
{
for(char i='';i<='';i++) num[i]=i-'';
for(char i='A';i<='Z';i++) num[i]=i-'A'+;
for(char i='a';i<='z';i++) num[i]=i-'a'+;
num['-']=, num['_']=;
}
ll fpow(ll a,ll n)
{
ll res=, base=a%mod;
while(n)
{
if(n&) res*=base, res%=mod;
base*=base, base%=mod;
n>>=;
}
return res%mod;
}
int main()
{
init();
cin>>s;
ll res=;
for(int i=;i<s.size();i++) res+=6LL-((B)num[s[i]]).count();
cout<<fpow(,res)<<endl;
}

D - Vanya and Treasure- [DP+优先队列BFS]


E - Vanya and Balloons - (Undone)

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

  1. Codeforces 785 - A/B/C/D/E - (Undone)

    链接:https://codeforces.com/contest/785 A - Anton and Polyhedrons #include<bits/stdc++.h> using ...

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

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

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

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

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

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

  5. codeforces div2 677 D

    http://codeforces.com/problemset/problem/677/D 题目大意: 给你一个n*m的图,上面有p种钥匙(p<=n*m),每种钥匙至少有一个,期初所有为1的钥 ...

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

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

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

    链接:http://codeforces.com/contest/1114 A - Got Any Grapes? 题意:甲乙丙三个人吃葡萄,总共有三种葡萄:绿葡萄.紫葡萄和黑葡萄,甲乙丙三个人至少要 ...

  8. Codeforces 1043 - A/B/C/D/E/F - (Undone)

    链接:http://codeforces.com/contest/1043 A - Elections - [水水水水题] 题意: 我和另一个人竞争选举,共有 $n$ 个人投票,每个人手上有 $k$ ...

  9. Codeforces Round #677 (Div. 3) 题解

    Codeforces Round #677 (Div. 3) 题解 A. Boring Apartments 题目 题解 简单签到题,直接数,小于这个数的\(+10\). 代码 #include &l ...

随机推荐

  1. Windows中读写ini文件

    .ini 文件是Initialization File的缩写,即初始化文件,是windows的系统配置文件所采用的存储格式,来配置应用软件以实现不同用户的要求.配置文件有很多种如ini配置文件,XML ...

  2. fiddle扩展

    扩展地址:http://www.telerik.com/fiddler/add-ons 证书选择 ios设置证书生成 (CertMaker for iOS and Android) 证书查看 (Fid ...

  3. SQL SERVER 批量生成编号

    开始: 在testing中,为了模拟orders,有个要求给数据库dba,如何通过后台数据库脚本快速批量生成orders. 分析 站在数据库角度,批量生成orders,也就是批量生成表中的行数据. s ...

  4. ETF计划Q&A

    ETF计划Q&A 2018-07-16 参考:详解ETF计划.ETF计划Q&A(2017版) 目录 问1:ETF计划是什么?问2:ETF计划适合什么人参加?问3:我想参考你的计划,但告 ...

  5. input文件上传(上传单个文件/多选文件/文件夹、拖拽上传、分片上传)

    //上传单个/多个文件 <input title="点击选择文件" id="h5Input1" multiple="" accept= ...

  6. TF的模型文件

    TF的模型文件 标签(空格分隔): TensorFlow Saver tensorflow模型保存函数为: tf.train.Saver() 当然,除了上面最简单的保存方式,也可以指定保存的步数,多长 ...

  7. Sql Server 中将由逗号“,”分割的一个字符串转换为一个表集,并应用到 in 条件中

    Sql Server 中将由逗号“,”分割的一个字符串,转换为一个表,并应用与 in 条件 ,,) 这样的语句和常用,但是如果in 后面的 1,2,3是变量怎么办呢,一般会用字符串连接的方式构造sql ...

  8. Java多线程系列——计数器 CountDownLatch

    简介: CountDownLatch 是一个非常实用的多线程控制工具类,通常用来控制线程的等待,它可以让某个线程等待直到倒计时结束 CountDownLatch 提供了两个主要的方法,await(). ...

  9. C++ 函数模板重载

    函数模板可以像普通函数那样重载. C++ 编译器会从不同的候选中匹配一个并进行调用. 即使不涉及到模板,这种匹配的规则也很复杂,现在还有加上模板一起匹配. 先来个小例子: #include <i ...

  10. mvc 根据模板导出excel,直接导出文件流

    1.c# /// <summary> /// 导出员工 /// </summary> /// <returns></returns> [HttpGet] ...