A

弯腰

 #include<cstdio>
#include<cstring>
#include<iostream>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std;
#define clc(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
const int N=;
#define LL long long
// inline int r(){
// int x=0,f=1;char ch=getchar();
// while(ch>'9'||ch<'0'){if(ch=='-') f=-1;ch=getchar();}
// while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
// return x*f;
// } int main(){
int n,m;
int ans=;
scanf("%d%d",&n,&m);
for(int i=;i<n;i++){
int x;
cin>>x;
if(x<=m)
ans+=;
else
ans+=;
}
cout<<ans<<endl;
return ;
}

B

处理器一秒能处理k个东西,缓冲区最多不能超过h个,问几秒处理完

模拟,注意h很大,k很小的情况!!所以必须用除法避免超时

 #include<cstdio>
#include<cstring>
#include<iostream>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std;
#define clc(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
const int N=;
#define LL long long
void fre(){freopen("in.txt","r",stdin); }
// inline int r(){
// int x=0,f=1;char ch=getchar();
// while(ch>'9'||ch<'0'){if(ch=='-') f=-1;ch=getchar();}
// while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
// return x*f;
// }
int a[]; int main(){
// fre();
int n,h,k;
cin>>n>>h>>k;
for(int i=;i<=n;i++){
scanf("%d",&a[i]);
}
LL sum=;
LL ans=;
for(int i=;i<=n;i++){
sum+=a[i];
while(sum+a[i+]<=h){
sum+=a[i+];
i++;
if(i>n)
break;
}
// cout<<i<<" "<<sum<<endl;
while(){
int tem=sum;
sum%=k;
ans+=tem/k;
if(sum<=)
{
sum=;
break;
}
if(i<n){
if(sum+a[i+]<=h)
break;
}
if(sum<k&&sum>){
sum=;
ans++;
// cout<<sum<<" "<<ans<<endl;
break;
}
}
// cout<<i<<" "<<sum<<endl;
}
cout<<ans<<endl;
return ;
}

C

统计每个字符对应的数字有几个0,答案就是pow(3,n)。二进制是六位

 #include<cstdio>
#include<cstring>
#include<iostream>
#include<queue>
#include<stack>
#include<algorithm>
using namespace std;
#define clc(a,b) memset(a,b,sizeof(a))
#define inf 0x3f3f3f3f
const int N=;
const int MOD = 1e9+;
#define LL long long
void fre(){freopen("in.txt","r",stdin); }
// inline int r(){
// int x=0,f=1;char ch=getchar();
// while(ch>'9'||ch<'0'){if(ch=='-') f=-1;ch=getchar();}
// while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
// return x*f;
// }
LL pow_m(LL a,LL b)
{
LL ans = ;
a %= MOD;
while(b)
{
if(b & )
{
ans = ans * a % MOD;
b--;
}
b >>= ;
a = a * a % MOD;
}
return ans;
} int fun(int x){
int num=;
int cnt=;
while(cnt){
if((x&)==)
num++;
x>>=;
cnt--;
}
return num;
}
string s;
bool vis[];
int main(){
// freopen("in.txt","r",stdin);
getline(cin,s);
LL num=;
LL ans=;
clc(vis,false);
for(int i=;i<s.length();i++){
int x;
if(s[i]>=''&&s[i]<=''){
x=s[i]-'';
num+=fun(x);
}
else if(s[i]>='A'&&s[i]<='Z'){
x=s[i]-'A'+;
num+=fun(x);
}
else if(s[i]>='a'&&s[i]<='z'){
x=s[i]-'a'+;
num+=fun(x);
}
else if(s[i]=='-'){
num+=fun();
}
else{
num+=fun();
}
}
// cout<<num<<endl;
ans=pow_m(,num);
printf("%I64d\n",ans);
return ;
}

Codeforces Round #355 (Div. 2)的更多相关文章

  1. Codeforces Round #355 (Div. 2)-C

    C. Vanya and Label 题目链接:http://codeforces.com/contest/677/problem/C While walking down the street Va ...

  2. Codeforces Round #355 (Div. 2)-B

    B. Vanya and Food Processor 题目链接:http://codeforces.com/contest/677/problem/B Vanya smashes potato in ...

  3. Codeforces Round #355 (Div. 2)-A

    A. Vanya and Fence 题目连接:http://codeforces.com/contest/677/problem/A Vanya and his friends are walkin ...

  4. Codeforces Round #355 (Div. 2) D. Vanya and Treasure dp+分块

    题目链接: http://codeforces.com/contest/677/problem/D 题意: 让你求最短的从start->...->1->...->2->. ...

  5. E. Vanya and Balloons Codeforces Round #355 (Div. 2)

    http://codeforces.com/contest/677/problem/E 题意:有n*n矩形,每个格子有一个值(0.1.2.3),你可以在矩形里画一个十字(‘+’形或‘x’形),十字的四 ...

  6. D. Vanya and Treasure Codeforces Round #355 (Div. 2)

    http://codeforces.com/contest/677/problem/D 建颗新树,节点元素包含r.c.dis,第i层包含拥有编号为i的钥匙的所有节点.用i-1层更新i层,逐层更新到底层 ...

  7. Codeforces Round #355 (Div. 2) D. Vanya and Treasure 分治暴力

    D. Vanya and Treasure 题目连接: http://www.codeforces.com/contest/677/problem/D Description Vanya is in ...

  8. Codeforces Round #355 (Div. 2) C. Vanya and Label 水题

    C. Vanya and Label 题目连接: http://www.codeforces.com/contest/677/problem/C Description While walking d ...

  9. Codeforces Round #355 (Div. 2) B. Vanya and Food Processor 水题

    B. Vanya and Food Processor 题目连接: http://www.codeforces.com/contest/677/problem/B Description Vanya ...

  10. Codeforces Round #355 (Div. 2) A. Vanya and Fence 水题

    A. Vanya and Fence 题目连接: http://www.codeforces.com/contest/677/problem/A Description Vanya and his f ...

随机推荐

  1. No qualifying bean of type [com.shyy.web.service.TreeMapper] found for dependency

    异常信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.sp ...

  2. Python:使用threading模块实现多线程编程

    转:http://blog.csdn.net/bravezhe/article/details/8585437 Python:使用threading模块实现多线程编程一[综述] Python这门解释性 ...

  3. 如何让WIN32应用程序支持MFC类库

    参考链接:http://wenku.baidu.com/view/68fc340c79563c1ec5da714b.html

  4. HDU4756+Prim

    题意简单:去掉最小生成树的某一条边并补上一条,求MaxVal 思路:贪心(借鉴Yamidie的思路...) 分别求出最小生成树和次最小生成树,再在这两棵树上求最小生成树 #include<std ...

  5. 接口和JAVA设计模式

  6. 【转】notepad++ 应用学习 -- 列模式,十六进制模式

      Notepad++ 顾名思义,是一个比notepad(Windows下叫记事本)的功能更强的编辑器. 总以为notepad++小巧轻盈,而且开源,要比UE(UltraEdit)好用.因为她支持的视 ...

  7. Windbg调试命令详解(3)

    3 进程与线程 既可以显示进程和线程列表,又可以显示指定进程或线程的详细信息.调试命令可以提供比taskmgr更详尽的进程资料,在调试过程中不可或缺. 3.1 进程命令 进程命令包括这些内容:显示进程 ...

  8. PHP 简单的加密解密算法

    <?php /** * * @创建时间:2015-3-12 下午2:07:33 * @作者:YuMing * @描述:异或加密解密类 */ class Yihuo extends CI_Cont ...

  9. 25.allegro中模块复用[原创]

    一,Module reuse 1,打开原理图 ------------------- --------------------- ctrl+i过滤器 直选part ctrl+e 查看属性 查看: 是否 ...

  10. tlplayer 所有平台版本支持水印叠加

    tlplayer支持视频渲染前水印叠加,各个系统版本同样支持. 联系方式:weinyzhou86@gmail.com QQ:514540005 版权所有,禁止转载. 发布自:http://blog.c ...