CodeForces 151B - Phone Numbers

图神经网络实战——利用节点回归预测网络流量 在机器学习中,回归指的是对连续值的预测。通常与分类形成鲜明对比,分类的目标是找到正确的类别(即离散值,而非连续值)。在图数据中,分类和回归分别对应于节点分类和节点回归。在本节中,我们将尝试预测每个节点的连续值,而非分类变量。 阅读详情

B. Phone Numbers
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

Winters are just damn freezing cold in Nvodsk! That's why a group of n friends prefers to take a taxi, order a pizza and call girls. The phone numbers in the city consist of three pairs of digits (for example, 12-34-56). Each friend has a phonebook of size si (that's the number of phone numbers). We know that taxi numbers consist of six identical digits (for example, 22-22-22), the numbers of pizza deliveries should necessarily be decreasing sequences of six different digits (for example, 98-73-21), all other numbers are the girls' numbers.

You are given your friends' phone books. Calculate which friend is best to go to when you are interested in each of those things (who has maximal number of phone numbers of each type).

If the phone book of one person contains some number two times, you should count it twice. That is, each number should be taken into consideration the number of times it occurs in the phone book.

Input

The first line contains an integer n (1 ≤ n ≤ 100) — the number of friends.

Then follow n data blocks that describe each friend's phone books. Each block is presented in the following form: first goes the line that contains integer si and string namei (0 ≤ si ≤ 100) — the number of phone numbers in the phone book of the i-th friend and the name of the i-th friend. The name is a non-empty sequence of uppercase and lowercase Latin letters, containing no more than 20 characters. Next si lines contain numbers as "XX-XX-XX", where X is arbitrary digits from 0 to 9.

Output

In the first line print the phrase "If you want to call a taxi, you should call: ". Then print names of all friends whose phone books contain maximal number of taxi phone numbers.

In the second line print the phrase "If you want to order a pizza, you should call: ". Then print names of all friends who have maximal number of pizza phone numbers.

In the third line print the phrase "If you want to go to a cafe with a wonderful girl, you should call: ". Then print names of all friends who have maximal number of girls' phone numbers.

Print the names in the order in which they are given in the input data. Separate two consecutive names with a comma and a space. Each line should end with exactly one point. For clarifications concerning the output form, see sample tests. It is necessary that youfollow the output form strictly. Extra spaces are not allowed.

Sample test(s)
input
4
2 Fedorov
22-22-22
98-76-54
3 Melnikov
75-19-09
23-45-67
99-99-98
7 Rogulenko
22-22-22
11-11-11
33-33-33
44-44-44
55-55-55
66-66-66
95-43-21
3 Kaluzhin
11-11-11
99-99-99
98-65-32
output
If you want to call a taxi, you should call: Rogulenko.
If you want to order a pizza, you should call: Fedorov, Rogulenko, Kaluzhin.
If you want to go to a cafe with a wonderful girl, you should call: Melnikov.
input
3
5 Gleb
66-66-66
55-55-55
01-01-01
65-43-21
12-34-56
3 Serega
55-55-55
87-65-43
65-55-21
5 Melnik
12-42-12
87-73-01
36-04-12
88-12-22
82-11-43
output
If you want to call a taxi, you should call: Gleb.
If you want to order a pizza, you should call: Gleb, Serega.
If you want to go to a cafe with a wonderful girl, you should call: Melnik.
input
3
3 Kulczynski
22-22-22
65-43-21
98-12-00
4 Pachocki
11-11-11
11-11-11
11-11-11
98-76-54
0 Smietanka
output
If you want to call a taxi, you should call: Pachocki.
If you want to order a pizza, you should call: Kulczynski, Pachocki.
If you want to go to a cafe with a wonderful girl, you should call: Kulczynski.
Note

In the first sample you are given four friends. Fedorov's phone book contains one taxi number and one pizza delivery number,Melnikov's phone book only has 3 numbers of girls, Rogulenko's one has 6 taxi numbers and one pizza delivery number,Kaluzhin's one contains 2 taxi numbers and one pizza delivery number.

Thus, if you need to order a taxi, you should obviously call Rogulenko, if you need to order a pizza you should call anybody of the following: Rogulenko, Fedorov, Kaluzhin (each of them has one number). Melnikov has maximal number of phone numbers of girls.



==================================

找每类号码最多的那几个人

码有点乱orz


#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>

using namespace std;

char name[111][22],str[22];
int cnt[111][5],max0=-1,max1=-1,max2=-1,count0=0,count1=0,count2=0;
int m,n,a,b,c,d,e,f;

int main()
{
    scanf("%d",&n);
    memset(cnt,0,sizeof(cnt));
    for(int i=0;i<n;i++)
    {
        scanf("%d %s",&m,name[i]);
        //cout<<m<<" "<<name[i]<<endl;
        for(int j=0;j<m;j++)
        {
            scanf("%s",str);
            if(str[0]==str[1]&&str[1]==str[3]&&str[3]==str[4]&&str[4]==str[6]&&str[6]==str[7]) cnt[i][0]++;
            if(str[0]>str[1]&&str[1]>str[3]&&str[3]>str[4]&&str[4]>str[6]&&str[6]>str[7]) cnt[i][1]++;
            cnt[i][2]=m-cnt[i][0]-cnt[i][1];
        }
        //cout<<cnt[i][0]<<" "<<cnt[i][1]<<" "<<cnt[i][2]<<endl;
    }
    for(int i=0;i<n;i++)
    {
        if(cnt[i][0]>max0) max0=cnt[i][0];
        if(cnt[i][1]>max1) max1=cnt[i][1];
        if(cnt[i][2]>max2) max2=cnt[i][2];
    }
    //cout<<max0<<" "<<max1<<" "<<max2<<endl;
    for(int i=0;i<n;i++)
    {
        if(cnt[i][0]==max0) count0++;
        if(cnt[i][1]==max1) count1++;
        if(cnt[i][2]==max2) count2++;
    }
    printf("If you want to call a taxi, you should call:");
    for(int i=0,j=1;i<n;i++)
    {
        if(cnt[i][0]==max0&&j!=count0)
        {
            printf(" %s,",name[i]);
            j++;
        }
        else if(cnt[i][0]==max0&&j==count0) printf(" %s.\n",name[i]);
    }
    printf("If you want to order a pizza, you should call:");
    for(int i=0,j=1;i<n;i++)
    {
        if(cnt[i][1]==max1&&j!=count1)
        {
            printf(" %s,",name[i]);
            j++;
        }
        else if(cnt[i][1]==max1&&j==count1) printf(" %s.\n",name[i]);
    }
    printf("If you want to go to a cafe with a wonderful girl, you should call:");
    for(int i=0,j=1;i<n;i++)
    {
        if(cnt[i][2]==max2&&j!=count2)
        {
            printf(" %s,",name[i]);
            j++;
        }
        else if(cnt[i][2]==max2&&j==count2) printf(" %s.\n",name[i]);
    }
    return 0;
}


由Sensor光谱响应曲线联想到的白平衡增益计算 由Sensor光谱响应曲线联想到的白平衡增益计算 由于传感器硬件的限制,传感器在某个预定波长范围内的响应不可能是100% 响应。现实中都是类似于正态分布的单峰函数。如果仅做粗略计算,由一个中心波长和半高宽(也成半波宽)完全可以由数学公式计算出一个高斯分布曲线。这个分布曲线就叫波谱响应函数。 波谱响应函数反映了传感器通道获取能量的情况。实际上每个传感器厂商都提供了具体的光谱响应函数,一般由两列数据组成,一列数据是波长,另一列数据是相对响应强度。下图某sensor光谱的响应的波谱响应函数。 ... 阅读详情

相关推荐

构建面向嵌入式Linux的ARM64交叉编译工具链:从sysroot配置到CMake实战

本文详细介绍了如何构建面向嵌入式Linux的ARM64交叉编译工具链,从sysroot配置到CMake实战。通过分步指导,帮助开发者解决架构不一致问题,提升编译效率,特别适用于树莓派等ARM64设备开发。文章涵盖sysroot机制、环境搭建、CMake配置及常见问题解决方案,是嵌入式开发的实用指南。

weixin_42537142的博客 199

Codeforces Round #107 (Div. 2)——B

B. Phone Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Winters are just damn freezing cold in Nvo

Learn as if you were to live forever 669

A股历史数据免费下载终极指南:4000+个股数据一键打包获取

本文提供了获取A股历史数据的完整免费方案,重点介绍了Tushare Pro、AkShare等开源金融数据API的使用方法。通过详细的Python脚本示例,指导读者如何自动化批量抓取、清洗、存储4000多只个股的历史行情数据,并分享数据质量校验与性能优化技巧,助力量化研究与市场分析。

ooo22的博客 2236

2021-5-15补题

Codeforces Beta Round #107(Div2) B - Phone Numbers Winters are just damn freezing cold in Nvodsk! That’s why a group of n friends prefers to take a taxi, order a pizza and call girls. The phone numbers in the city consist of three pairs of digits (for exam

xiaoxu778的博客 707

DeepSeek赋能CAD:从API调用到智能设计工作流的实战指南

本文详细介绍了如何利用DeepSeek AI技术赋能CAD设计工作流,从API调用到智能设计优化的实战指南。通过Python环境配置、API接入详解以及四大智能设计场景的实战案例,帮助CAD设计师实现参数化设计优化、自动规范检查等高效工作方式,大幅提升设计效率和质量。

weixin_29092579的博客 624

欧姆龙SYSMAC STUDIO如何与基恩士SR-1000进行EIP通信

简要介绍一下扫码枪和欧姆龙sysmac的配置

weixin_42031602的博客 4782

B. Phone Numbers(暴力)

Winters are just damn freezing cold in Nvodsk! That's why a group of n friends prefers to take a taxi, order a pizza and call girls. The phone numbers in the city consist of three pairs of digits (for...

码农的一亩三分地 752

手把手教你学Simulink--巴特沃斯滤波器设计与实现仿真

巴特沃斯滤波器的设计目标是拥有尽可能平滑的通带响应,这意味着在通带内信号衰减最小且没有波动。这种类型的滤波器非常适合用于音频处理、生物医学信号处理以及其他需要高保真度的应用场景。根据应用需求的不同,可以选择低通、高通、带通或带阻滤波器。明确你的系统需求,如输入信号类型(正弦波、方波等)、滤波器类型(低通、高通、带通或带阻)、截止频率、滤波器阶数等。假设我们需要设计一个4阶低通巴特沃斯滤波器,其截止频率为1kHz,用来过滤掉高于1kHz的所有频率成分。

MHD0815的博客 451

CodeForces 151B Phone Numbers(简单模拟)

题目链接 B. Phone Numbers time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Winters are just damn freezing cold in Nvo

madaidao的专栏 690

【高级强化学习:算法、优化与泛化】第13章 扩散模型策略优化(Diffusion Policy Optimization)

\quad$ 计算均值 $\mu_t = \frac{1}{\sqrt{\alpha_t}} \left( x_t - \frac{1 - \alpha_t}{\sqrt{1 - \bar{\alpha}_t}} \tilde{\epsilon} \right)$.$\quad$ 组合得分估计: $\tilde{\epsilon} = \epsilon_{\text{unc}} + w \cdot (\epsilon_{\text{con}} - \epsilon_{\text{unc}})$.

u012133341的博客 338

基于转录逆转的药物重定向 GPS 模型

GPS是一个基于分子结构预测基因表达扰动的开源平台,由三个模块组成:RCL(在LINCS扰动数据上训练抗噪MLP)、GPS4Drugs(预测新化合物的基因表达谱并进行逆转评分)、MolSearch(基于MCTS的分子优化)。平台使用Morgan指纹和Gene Ontology注释作为特征输入,将基因表达扰动离散为三分类标签。训练数据来自LINCS Phase I的18,746个化合物和978个landmark基因,支持四细胞系独立训练,可用于药物重定向与化合物筛选。

听雨草堂 83

CodeForces 151 B 结构体排序。

E - 结构体又来了呦 Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 151B Description Winters are just damn freezing cold in Nv

w1072484464的专栏 563

推荐系统中召回率Recall计算方式附代码

Recall(召回率)是指在所有实际有交互的用户 - 物品对中,推荐系统成功预测出的比例。具体来说,设所有有交互的用户 - 物品对为S,推荐系统预测出的用户 - 物品对为T,则Recall的计算公式为:

优快云 精品推荐 1842

CodeForces 151B Phone Numbers

Phone Numbers Time Limit:2000MSMemory Limit:262144KB64bit IO Format:%I64d & %I64u SubmitStatusPracticeCodeForces 151B Description Winters are just damn freezing cold in...

weixin_34119545的博客 109

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

[CF151B]Phone Numbers(暴力,模拟)

题目链接:http://codeforces.com/contest/151/problem/B 题意:三种电话号码:假如数字都相同,则说明是taxi;严格下降的序列则说明是pizza;其他是girl。输出拥有某种号码最多的那个人的姓名,假如有同样多的,要按照输入顺序输出。 暴力搞,统计每个人各种电话号码有多少,排序三遍。 1 /* 2 ━━━━━┒ギリギリ♂ eye! ...

weixin_30347009的博客 164

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

01(CodeforcesB水平)CQU新生周末狂欢赛 I - Phone Numbers

I - Phone Numbers Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Practice CodeForces 151B Description Winters are just damn freezing cold

阿里巴巴算法工程师 802

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

Pizza Delivery Gym - 101986F

http://codeforces.com/gym/101986/attachments 对于每条边 判断将其反转后 新的最短路和原有最短路的大小关系 各询问相互独立 反转每条边之后 所有经过这条边的路径中最短的那一条 有可能是新的最短路 正向反向跑两遍即可 但是仅仅这样还不够 当这条路径大于原有最短路时 我们不知道是否还有其他和原有最短路径相等的存在 对于原图 扫一遍每条边 判断所有经过这...

sunyutian1998的博客 536

题解 CF - 101986 F Pizza Delivery (最短路+DAG必经点)

题解 CF - 101986 F Pizza Delivery (最短路+DAG必经点) 题目链接: https://codeforces.com/gym/101986 题意: 给你NNN个点,MMM条边的有向图,无重边自环,每条边都有边权wiw_iwi​,设置起点为1,终点为2,现在要求对每条边询问一下: 如果将这条边的方向取反,即原来是u→vu \rarr vu→v现在修改为v→uv\rarr...

qq_41848675的博客 763

B. Phone numbers

解题说明:模拟题,按照要求输出即可,可以每两位输出一次,然后判断倒数dierzu

无知的我 2275

Phone Numbers(C题)

题目大意: Vasya有一个电话簿,里面存着他好友的电话号码,但是有一些是重复的,请你整理一下 如果同一个人某一个电话号码是另一个电话号码的末尾的一部分,比如‘321’‘21’是同一个电话号码‘321’。 数据范围: 1&amp;amp;amp;amp;lt;= n &amp;amp;amp;amp;lt;=20 电话号码和名字长度不大于10 对于每一行数据最多10个电话号码 解题思路: 数据不大,老老实实模拟就行,因为要从电话的后面开始比较,所以我就先把...

qq_43651200的博客 588

Codeforces 898

Akatsuki

Akatsuki 885

Phone numbers

Phone numbers Phone number in Berland is a sequence of n digits. Often, to make it easier to memorize the number, it is divided into groups of two or three digits. For example, the phone number 119873...

codeswarrior的博客 721

【codeforces#25B】 Phone numbers

【codeforces#25B】 Phone numbers 题意:给一串长度为n的数字串,在两个或三个数字之间加-,便于记忆。 解题思路:可以将数字串都3个3个分,遇到余数不同的分情况讨论。

nininicrystal的专栏 861

codeforces 898C. Phone Numbers(模拟+map,set,vector)

题意:N表示下面有N个字符串,每个字符串第一个表示名字,第二个表示后面有几个电话号,后面是这几个电话号(电话号允许有前导0),(name ,number_of_phone_numbers,phone_numbers)中间都用空格隔开。现在需要你帮他整理这些电话号,当一个字符串为另一个字符串的后缀或相同时,那么我们删除这个电话号。输出整理后的这些。(题意不是很好理解,结合样例理解好点) 思路:

张松超的博客 773

Phone Numbers

Description: Let’s call a string a phone number if it has length 11 and fits the pattern “8xxxxxxxxxx”, where each “x” is replaced by a digit. For example, “80123456789” and “80000000000” are phone nu...

qq_40486952的博客 410
上一篇: CodeForces 149B - Martian Clock
下一篇: CodeForces 157B - Trace
coco430
博客等级 码龄14年 9粉丝 107原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值