06 2020 档案
摘要:有n个箱子,初始时每个箱子单独为一列; 接下来有p行输入,M, x, y 或者 C, x; 对于M,x,y:表示将x箱子所在的一列箱子搬到y所在的一列箱子上; 对于C,x:表示求箱子x下面有多少个箱子 思路:开一个num数组,表示第i个箱子所在的集合共有多少个箱子。 开一个step数组,表示第i个箱
阅读全文
摘要:Bug有两种性别,异性之间才交往, 让你根据数据判断是否存在同性恋,输入有 t 组数据,每组数据给出bug数量n, 和关系数m, 以下m行给出相交往的一对Bug编号 a, b。只需要判断有没有,按题目要求输出。 思路:我们开一个两倍的数组,存上对应的关系。 例如:有n个bug,其中(2, 3),(3
阅读全文
摘要:An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unex
阅读全文
摘要:动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种
阅读全文
摘要:The police office in Tadu City decides to say ends to the chaos, as launch actions to root up the TWO gangs in the city, Gang Dragon and Gang Snake. H
阅读全文
摘要:题意:给你两个字符串s1,s2;你需要用最小变化次数把是s1变成s2;变化规则如下: 在s1中任意选择k个字符,选择k个字符中字典序最小的si,让k个字符都变成si; #define _CRT_SECURE_NO_WARNINGS #include<iostream> #include<cstrin
阅读全文
摘要:版权声明:本文为CSDN博主「飘过的小牛」的原创文章原文链接:https://blog.csdn.net/niushuai666/article/details/6662911 大佬写的太好了,取来自用orz。 话说江湖上散落着各式各样的大侠,有上千个之多。他们没有什么正当职业,整天背着剑在外面走来
阅读全文
摘要:Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize
阅读全文
摘要:There are so many different religions in the world today that it is difficult to keep track of them all. You are interested in finding out how many di
阅读全文
摘要:Today is Ignatius' birthday. He invites a lot of friends. Now it's dinner time. Ignatius wants to know how many tables he needs at least. You have to
阅读全文
摘要:Solitaire is a game played on a chessboard 8x8. The rows and columns of the chessboard are numbered from 1 to 8, from the top to the bottom and from l
阅读全文