codeforces 1060 A
https://codeforces.com/contest/1060/problem/A
题意:电话号码是以8开头的11位数,给你n 个数问最多可以有多少个电话号码
题解:min(8的个数,n/11)
代码如下:
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <bitset>
#include <string>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <functional>
#define PI acos(-1)
#define eps 1e-8
#define fuck(x) cout<<#x<<" = "<<x<<endl;
#define FIN freopen("input.txt","r",stdin);
#define FOUT freopen("output.txt","w+",stdout);
//#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const int maxn = 1e5+;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+;
LL gcd(LL a,LL b){return b?gcd(b,a%b):a;}
LL lcm(LL a,LL b){return a/gcd(a,b)*b;}
LL powmod(LL a,LL b,LL MOD){LL ans=;while(b){if(b%)ans=ans*a%MOD;a=a*a%MOD;b/=;}return ans;}
double dpow(double a,LL b){double ans=1.0;while(b){if(b%)ans=ans*a;a=a*a;b/=;}return ans;} int main(){
#ifndef ONLINE_JUDGE
FIN
#endif
int n;
string str;
cin>>n>>str;
int k=n/;
int ans=;
for(int i=;i<n;i++){
if(str[i]==''){
ans++;
}
}
cout<<min(ans,k)<<endl;
}
codeforces 1060 A的更多相关文章
- codeforces 1060 D
https://codeforces.com/contest/1060/problem/D 题意:你可以用1个及以上的圆桌,给n个人排座位,每个人左边需要有Li个空凳子,右边需要有Ri个空凳子,问你最 ...
- codeforces 1060 C
https://codeforces.com/contest/1060/problem/C 题意:给你一个长度为n的数列a和长度为m的数列b,定义c(i,j)=ai*bj,得到c矩阵,给定值x,求c矩 ...
- codeforces 1060 B
https://codeforces.com/contest/1060/problem/B 题意:给你一个数C ,你要找到两个数A.B,使得A+B=C并且A的每个位的数的和最大,求最大的和是多少 题解 ...
- CodeForces 1060 B Maximum Sum of Digits
Maximum Sum of Digits You are given a positive integer n. Let S(x)S(x) be sum of digits in base 10 r ...
- Codeforces 1060 F. Shrinking Tree
题目链接 一道思维好题啊...感觉这种类型的题很检验基本功是否扎实(像我这样的就挂了). 题意:你有一棵\(n\)个点的树,每次随机选择一条边,将这条边的两个端点合并,并随机继承两个点标号中的一个,问 ...
- CodeForces Round #550 Div.3
http://codeforces.com/contest/1144 A. Diverse Strings A string is called diverse if it contains cons ...
- Codeforces 1060E(思维+贡献法)
https://codeforces.com/contest/1060/problem/E 题意 给一颗树,在原始的图中假如两个点连向同一个点,这两个点之间就可以连一条边,定义两点之间的长度为两点之间 ...
- Codeforces Round #513 by Barcelona Bootcamp C. Maximum Subrectangle(双指针+思维)
https://codeforces.com/contest/1060/problem/C 题意 给两个数组,a数组有n个元素,b数组有m个元素,两个数组元素互相相乘形成n*m的矩阵,找一个子矩阵,元 ...
- Codeforces Round #513-ABCD
ABC现场做出,涨了八十几分吧.D有点思路不知道怎么实现,赛后看题解发现巨简单,想得太复杂了.蓝瘦. A----http://codeforces.com/contest/1060/problem/A ...
随机推荐
- linux几条基本命令和解释
pwd 查看当前目录/ 根目录ls 查看当前目录所包含文件ls -l 查看当前目录所包含文件的详细信息d rwx rwx r-x 1 root root1 2 3 4 ...
- 【struts2】struts2的使用
1.使用步骤 1) 导入struts2的支持jar包 名称 说明 struts2-core-2.3.4.1.jar Structs2的核心类库 xwork-core-2.3.4.1.jar xwork ...
- Qt——菜单栏、工具栏、状态栏
1.菜单栏 菜单栏的意义是将可点击触发最终事件的集中在一起,所以菜单栏中是QAction 添加菜单栏是QMainWindow的行为 QMenubar *menubar = this->addMe ...
- 修改mysql root密码的方法
方法1: 用SET PASSWORD命令 首先登录MySQL. 格式:mysql> set password for 用户名@localhost = password('新密码'); 例子:my ...
- C# String函数
public static bool IsNullOrEmpty(string value) 如果 true 参数为 value 或空字符串 (""),则为 null:否则为 fa ...
- java堆内存模型
广泛地说,JVM堆内存被分为两部分——年轻代(Young Generation)和老年代(Old Generation). 年轻代 年轻代是所有新对象产生的地方.当年轻代内存空间被用完时,就会触发垃 ...
- Ubuntu 安装Qt
下载Qt,这里步骤略过 设置共享, 如果设置共享没有问题,可以不看下面的 如果设置共享,在Ubuntu中找不到共享文件的话,那安找下面的步骤在来一次. http://blog.csdn.net/z60 ...
- gitbash避免每次push都输入密码
gitbash每次提交都要输密码真有点头疼,所以就: 1 创建验证文件:touch .git-credentials(windows) 2 编辑验证文件:vim .git-credentials ...
- CS229作业之过拟合
一.使用循环: 1.1原始版逻辑回归: function g = sigmoid(z) g = zeros(size(z)); g = ./ ( + exp(-z)); end function [J ...
- UVA 11884 A Shooting Game(记忆化搜索)
A and B are playing a shooting game on a battlefield consisting of square-shaped unit blocks. The bl ...