首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Codeforces Round #513 A. Phone Numbers(水题)

Codeforces Round #513 A. Phone Numbers(水题)

作者头像
Ch_Zaqdt
发布于 2019-01-10 08:56:30
发布于 2019-01-10 08:56:30
40500
代码可运行
举报
文章被收录于专栏:Zaqdt_ACMZaqdt_ACM
运行总次数:0
代码可运行

题目链接:http://codeforces.com/contest/1060/problem/A

       题意是输入n个数字,然后问这n个数字最多能组成多少个手机号,手机号是11位的,而且必须要8开头。

       思路很简单,求出n/11和8的个数的最小值就好了...


AC代码:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	string str;
	cin>>n;
	cin>>str;
	int len = str.length();
	int ans = 0;
	for(int i=0;i<len;i++){
		if(str[i] == '8'){
			ans++;
		}
	}
	int x = n / 11;
	cout<<min(x,ans)<<endl;
	return 0;
}
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2018年10月05日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
暂无评论
推荐阅读
编辑精选文章
换一批
Codeforces Round #526 (Div. 2) C. The Fair Nut and String(思维)
题目链接:http://codeforces.com/contest/1084/problem/C
Ch_Zaqdt
2019/01/10
5310
Codeforces Round #543 (Div. 2, based on Technocup 2019 Final Round) A. Technogoblet of Fire(思维)
题目链接:https://codeforces.com/contest/1121/problem/A
Ch_Zaqdt
2019/03/15
4750
Codeforces Round #535 (Div. 3) A. Two distinct points(水题)
题目链接:http://codeforces.com/contest/1108/problem/A
Ch_Zaqdt
2019/01/28
3640
Educational Codeforces Round 60 (Rated for Div. 2) A. Best Subsegment(思维)
版权声明:欢迎转载,若转载,请标明出处,如有错误,请指点,也欢迎大佬们给出优化方法 https://blog.csdn.net/Charles_Zaqdt/article/details/87669332
Ch_Zaqdt
2019/03/13
3760
Codeforces Round #519 A. Elections(水题)(1043A)
题目链接:http://codeforces.com/contest/1043/problem/A
Ch_Zaqdt
2019/01/10
3990
Codeforces Round #516 Div.2 A. Make a triangle!(水题)
题目链接:http://codeforces.com/contest/1064/problem/A
Ch_Zaqdt
2019/01/10
3630
Codeforces Round #514 (Div. 2) A. Cashier(水题)
题目链接:http://codeforces.com/contest/1059/problem/A
Ch_Zaqdt
2019/01/10
3680
Codeforces Round #513 B. Maximum Sum of Digits(思维)
题目链接:http://codeforces.com/contest/1060/problem/B
Ch_Zaqdt
2019/01/10
3960
Codeforces 1038A. Equality(水题)
题目链接:http://codeforces.com/problemset/problem/1038/A
Ch_Zaqdt
2019/01/11
4880
Codeforces Round #530 (Div. 2) C. Postcard(构造)
题目链接:http://codeforces.com/contest/1099/problem/C
Ch_Zaqdt
2019/01/10
4540
Codeforces Round #512 Div. 2 A,B,C Vasya and Golden Ticket
题目链接:http://codeforces.com/contest/1058/problem/A
Ch_Zaqdt
2019/01/11
5530
Codeforces Round #300(A.【字符串,多方法】,B.【思维题】,C.【贪心,数学】)
A. Cutting Banner time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output A large banner with word CODEFORCES was ordered for the 1000-th onsite round of Codeforcesω that takes place on the Miami beach.
Angel_Kitty
2018/04/09
9380
Codeforces Round #535 (Div. 3) C. Nice Garland(暴力)
题目链接:http://codeforces.com/contest/1108/problem/C
Ch_Zaqdt
2019/01/28
4200
Codeforces Round #534 (Div. 2) B. Game with string(stack具有纪念意义的一题)
题目链接:http://codeforces.com/contest/1104/problem/B
Ch_Zaqdt
2019/01/28
5930
Educational Codeforces Round 54 (Rated for Div. 2) A. Minimizing the String(思维)
题目链接:http://codeforces.com/contest/1076/problem/A
Ch_Zaqdt
2019/01/10
3690
Codeforces Round #527 (Div. 3) A. Uniform String(水题)
题目链接:http://codeforces.com/contest/1092/problem/A
Ch_Zaqdt
2019/01/10
4280
Codeforces Round #513 D. Social Circles(思维)
题目链接:http://codeforces.com/contest/1060/problem/D
Ch_Zaqdt
2019/01/11
3630
Codeforces Round #402 (Div. 2) D. String Game(二分)
题目链接:http://codeforces.com/contest/779/problem/D
Ch_Zaqdt
2019/01/10
4650
Codeforces Round #409 (rated, Div. 2, based on VK Cup 2017 Round 2)(A.思维题,B.思维题)
A. Vicious Keyboard time limit per test:2 seconds memory limit per test:256 megabytes input:standard input output:standard output Tonio has a keyboard with only two letters, "V" and "K". One day, he has typed out a string s with only these two letters. He
Angel_Kitty
2018/04/08
7720
Codeforces Round #540 (Div. 3) B. Tanya and Candies(思维)
版权声明:欢迎转载,若转载,请标明出处,如有错误,请指点,也欢迎大佬们给出优化方法 https://blog.csdn.net/Charles_Zaqdt/article/details/87774079
Ch_Zaqdt
2019/03/14
4250
推荐阅读
相关推荐
Codeforces Round #526 (Div. 2) C. The Fair Nut and String(思维)
更多 >
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
本文部分代码块支持一键运行,欢迎体验
本文部分代码块支持一键运行,欢迎体验