码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • PAT 1139 First Contact


    1139 First Contact

    Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually not contact her directly in the first place. Instead, he might ask another boy C, one of his close friends, to ask another girl D, who was a friend of both B and C, to send a message to B -- quite a long shot, isn't it? Girls would do analogously.

    Here given a network of friendship relations, you are supposed to help a boy or a girl to list all their friends who can possibly help them making the first contact.

    Input Specification:

    Each input file contains one test case. For each case, the first line gives two positive integers N (1 < N ≤ 300) and M, being the total number of people and the number of friendship relations, respectively. Then M lines follow, each gives a pair of friends. Here a person is represented by a 4-digit ID

  • 相关阅读:
    RabbitMQ图解
    第一章 | 计算机网络原理 谢希仁(第八版)_ 习题答案
    python工具方法37 voc数据统计分析(box聚类、box散点图、类别频率统计、box面积统计)
    Springboot毕设项目高职院校实践教学与就业跟踪085m6(java+VUE+Mybatis+Maven+Mysql)
    cesium 实体无法拾取
    final/override 控制
    基于物联网技术的校园智慧消防管理平台-Susie 周
    【C++】命名空间 namespace 与 标准流 iostream ( 命名空间概念简介 | 命名空间定义 | 命名空间使用 | iostream 中的命名空间分析 )
    Redis主从复制基础概念
    linux离线环境中进入docker镜像安装python包
  • 原文地址:https://blog.csdn.net/weixin_50679551/article/details/127602204
  • 最新文章
  • polygon出题教程
    Manim物理模拟:别自己写欧拉了!
    AI 学习笔记:Agent 的应用演示
    分享一个CAN报文编辑器软件
    MiniCPM-V 4.6 部署实战:基于 GPUStack 与 SGLang 的端侧多模态模型部署
    用 FRP 打通云服务器与本地 Ubuntu,让 Codex 远程调试本地硬件
    软考 - 架构设计师 知识点总结
    给 FastApiAdmin 加个“会议纪要”模块,我把后端二次开发的坑踩了个遍
    聊一聊 MES系统如何实现多种标签打印并支持不同打印机
    断尺问题:戴德金分割现实悖论
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号