![](https://img-blog.csdnimg.cn/20190927151101105.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
ACM_其它
ACM 其它知识点题目
蔡军帅
好好学习,天天向上!
展开
-
POJ 1182-食物链 [并查集] 《挑战程序设计竞赛》2.4
POJ 1182-食物链 [并查集] 《挑战程序设计竞赛》2.4 Description动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1 X Y”,表示X和Y是同类。 第二...原创 2019-05-05 09:05:00 · 153 阅读 · 0 评论 -
PAT 甲级 1107 Social Clusters (30分)(并查集)
1107Social Clusters(30分)When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. Asocial cluster...原创 2020-02-02 23:55:00 · 289 阅读 · 0 评论 -
L3-003. 社交集群(并查集)
L3-003. 社交集群时间限制1000 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越在社交网络平台注册时,用户通常会输入自己的兴趣爱好,以便找到和自己兴趣相投的朋友。有部分兴趣相同的人们就形成了“社交集群”。现请你编写程序,找出所有的集群。输入格式:输入的第一行给出正整数N(<=1000...原创 2018-03-30 20:51:00 · 178 阅读 · 0 评论 -
集合问题(并查集)
链接:https://www.nowcoder.com/acm/contest/77/D来源:牛客网集合问题 时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K 64bit IO Format: %lld题目描述 给你a,b和n个数p[i],问你如何分配这n个数给A,B集合,并且满足...原创 2018-02-26 20:04:00 · 229 阅读 · 1 评论 -
POJ 1182 食物链(并查集的使用)
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 81915 Accepted: 24462 &#原创 2018-01-31 13:00:00 · 62 阅读 · 0 评论 -
PATL2-007. 家庭房产-并查集
L2-007. 家庭房产时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者陈越给定每个人的家庭成员和其自己名下的房产,请你统计出每个家庭的人口数、人均房产面积及房产套数。输入格式:输入第一行给出一个正整数N(<=1000),随后N行,每行按下列格式给出一个人的房产:编号 父 母 k...原创 2018-03-26 21:04:00 · 213 阅读 · 0 评论 -
POJ 3061 Subsequence(尺取法)
Subsequence Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 18145 Accepted: 7751 
原创 2018-02-21 19:48:00 · 73 阅读 · 0 评论 -
POJ 3320 Jessica's Reading Problem(尺取法)
Jessica's Reading Problem Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14734 Accepted: 5073 &原创 2018-02-21 20:25:00 · 139 阅读 · 0 评论 -
POJ 2566 Bound Found(尺取法,前缀和)
Bound Found Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 5207 Accepted: 1667 Special Judge&#原创 2018-02-21 23:58:00 · 115 阅读 · 0 评论 -
HDU 1969 Pie(二分,注意精度)
PieTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 16554 Accepted Submission(s): 5829 My birthday is coming up and traditionally ...原创 2018-08-27 13:53:00 · 164 阅读 · 0 评论 -
HDU 2143 Can you find it?(基础二分)
Can you find it?Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/10000 K (Java/Others)Total Submission(s): 42520 Accepted Submission(s): 10315Problem DescriptionGive you th...原创 2018-08-23 23:20:00 · 183 阅读 · 0 评论 -
HDU 2199 Can you solve this equation?(二分精度)
HDU 2199 Can you solve this equation? Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100; Now please try your lucky.
...原创 2018-08-27 11:44:00 · 93 阅读 · 0 评论 -
HDU 4004 The Frog's Games(二分+小思维+用到了lower_bound)
The Frog's GamesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 9678 Accepted Submission(s): 4428 The annual Games in frogs' kingd...原创 2018-08-27 15:24:00 · 169 阅读 · 0 评论 -
HDU 2141 Can you find it?(二分)
Can you find it?Time Limit: 10000/3000 MS (Java/Others) Memory Limit: 32768/10000 K (Java/Others)Total Submission(s): 35836 Accepted Submission(s): 8845Problem DescriptionGive you th...原创 2018-02-13 14:53:00 · 66 阅读 · 0 评论 -
数学建模python matlab 编程(喷泉模拟)
在无风情况下的喷泉模拟我的python代码import numpy as npimport randomimport matplotlibmatplotlib.rcParams['font.sans-serif']=[u'simHei']matplotlib.rcParams['axes.unicode_minus']=Falseimport matplotlib.pypl...原创 2019-07-16 15:32:00 · 1619 阅读 · 0 评论 -
洛谷P1039 侦探推理(模拟)
洛谷P1039 侦探推理(模拟) 侦探推理题目描述明明同学最近迷上了侦探漫画《柯南》并沉醉于推理游戏之中,于是他召集了一群同学玩推理游戏。游戏的内容是这样的,明明的同学们先商量好由其中的一个人充当罪犯(在明明不知情的情况下),明明的任务就是找出这个罪犯。接着,明明逐个询问每一个同学,被询问者可能会说:证词中出现的其他话,都不列入逻辑推理的内容。明明所知道的是,他的同学...原创 2019-04-26 23:02:00 · 341 阅读 · 0 评论 -
poj 3977 Subset(折半枚举+二进制枚举+二分)
SubsetTime Limit: 30000MS Memory Limit: 65536KTotal Submissions: 5721 Accepted: 1083DescriptionGiven a list of N integers with absolute values no larger than 1015, find a non...原创 2018-02-24 13:42:00 · 202 阅读 · 0 评论 -
PAT 甲级 1044 Shopping in Mars (25 分)(滑动窗口,尺取法,也可二分)
1044Shopping in Mars(25分)Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When makin...原创 2019-09-02 14:30:00 · 432 阅读 · 0 评论 -
洛谷P1038 神经网络(bfs,模拟,拓扑)
洛谷P1038 神经网络(bfs,模拟,拓扑) 题目背景人工神经网络(Artificial Neural NetworkArtificialNeuralNetwork)是一种新兴的具有自我学习能力的计算系统,在模式识别、函数逼近及贷款风险评估等诸多领域有广泛的应用。对神经网络的研究一直是当今的热门方向,兰兰同学在自学了一本神经网络的入门书籍后,提出了一个简化模型,他希望你能帮助他用程...原创 2019-04-26 22:54:00 · 1138 阅读 · 0 评论 -
POJ 2549 Sumsets(折半枚举+二分)
Sumsets Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11946 Accepted: 3299 &am原创 2018-02-24 14:27:00 · 192 阅读 · 0 评论 -
二分搜索
二分搜索 题目描述给定n个元素,使用二分法从中查找特地元素x。输入包含T组数据。先给定一个T。每组数据第一行是n,第二行是n个数。第三行为要查找的数xT<2000,n<100000输出先输出排序后的数组。如果找到x,则输出x的位置;如果没找到,输出“-1”。样例输入11160 17 39 15 8 34 30 45 5 52 2...原创 2019-03-01 09:14:00 · 375 阅读 · 0 评论 -
POJ 1222 EXTENDED LIGHTS OUT(反转)
EXTENDED LIGHTS OUTTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 12616 Accepted: 8002DescriptionIn an extended version of the game Lights Out, is a puzzle with 5 ...原创 2018-02-23 11:03:00 · 166 阅读 · 0 评论 -
麻烦的聚餐(最长递增子序列+二分优化)
麻烦的聚餐(最长递增子序列+二分优化) 麻烦的聚餐题目描述 为了避免餐厅过分拥挤,FJ要求奶牛们分3批就餐。每天晚饭前,奶牛们都会在餐厅前排队入内,按FJ的设想,所有第3批就餐的奶牛排在队尾,队伍的 前端由设定为第1批就餐的奶牛占据,中间的位置就归第2批就餐的奶牛了。由于奶牛们不理解FJ的安排,晚饭前的排队成了一个大麻烦。 第i头奶牛有一张标明她用餐批次D_i(...原创 2019-05-05 18:53:00 · 329 阅读 · 0 评论 -
走迷宫(用栈模拟实现非递归,并输出路径)
#include<iostream>#include<stack>using namespace std;int a[10][10]={ {1,1,1,1,1,1,1,1,1,1},{1,0,0,1,0,0,0,1,0,1}, {1,0,0,1,0,0,0,1,0,1},{1,0,0,0,0,1,1,0,0,1},...原创 2018-08-22 10:36:00 · 867 阅读 · 0 评论 -
POJ 3185 The Water Bowls(反转)
The Water Bowls Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7292 Accepted: 2887 &#原创 2018-02-22 16:41:00 · 76 阅读 · 0 评论 -
PAT 甲级 1008 Elevator (20)(20 分)模拟水题
题目翻译:1008.电梯在我们的城市里,最高的建筑物里只有一部电梯。有一份由N个正数组成的请求列表。这些数表示电梯将会以规定的顺序在哪些楼层停下。电梯升高一层需要6秒,下降一层需要4秒。每次停下电梯将花费5秒。给你一个请求列表,你需要计算出完成列表里的请求总共花费的时间。一开始电梯在0层。当请求全部完成时,电梯不需要回到底层。输入说明:每个输入文件包含一个测试实例。每个...原创 2018-08-10 16:33:00 · 508 阅读 · 0 评论 -
POJ 2785 4 Values whose Sum is 0(折半枚举+二分)
4 Values whose Sum is 0Time Limit: 15000MS Memory Limit: 228000KTotal Submissions: 25675 Accepted: 7722Case Time Limit: 5000MSDescriptionThe SUM problem can be formulated ...原创 2018-02-23 15:38:00 · 136 阅读 · 0 评论 -
HDU 5705 Clock(模拟,分类讨论)
ClockTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 500 Accepted Submission(s): 176Problem DescriptionGiven a time HH:MM:SS and o...原创 2018-05-13 22:05:00 · 243 阅读 · 0 评论 -
POJ 3276 Face The Right Way(反转)
Face The Right WayTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6038 Accepted: 2791DescriptionFarmer John has arranged his N (1 ≤ N ≤ 5,000) cows in...原创 2018-02-22 14:02:00 · 81 阅读 · 0 评论 -
POJ 3279 Fliptile(反转 +二进制枚举)
FliptileTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 13631 Accepted: 5027DescriptionFarmer John knows that an intellectually satisfied cow is a happy cow who wi...原创 2018-02-22 16:01:00 · 194 阅读 · 0 评论 -
codeforces 985 D. Sand Fortress(二分+思维)
Sand Fortresstime limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputYou are going to the beach with the idea to build the ...原创 2018-05-24 14:44:00 · 214 阅读 · 0 评论 -
一家人(模拟)
一家人时间限制: 1 Sec 内存限制: 32 MB提交: 10 解决: 7[提交][状态][讨论版][命题人:外部导入][Edit] [TestData]题目描述最近小明交了一个新朋友叫小宇,他们在聊天的时候发现500年前他们竟然是一家人!现在小明想知道小宇是他的长辈,晚辈,还是兄弟。输入输入包含多组测试数据。每组首先输入一个整数N(N<=10),接下来N行...原创 2018-08-20 13:15:00 · 538 阅读 · 0 评论 -
NOIP 2008 立体图 (字符串+模拟)
立体图时间限制: 1 Sec 内存限制: 50 MB提交: 2 解决: 0[提交][状态][讨论版][命题人:外部导入]题目描述小渊是个聪明的孩子,他经常会给周围的小朋友们讲些自己认为有趣的内容。最近,他准备给小朋友们讲解立体图,请你帮他画出立体图。小渊有一块面积为m*n的矩形区域,上面有m*n个边长为1的格子,每个格子上堆了一些同样大小的吉姆(积木的长宽高都是...原创 2018-05-10 15:49:00 · 195 阅读 · 0 评论 -
PAT 甲级 1010 Radix (25)(25 分)进制匹配(听说要用二分,历经坎坷,终于AC)
1010 Radix (25)(25 分)Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number....原创 2018-08-13 19:39:00 · 144 阅读 · 0 评论 -
传球游戏(模拟,递推,找规律)
传球游戏时间限制: 1 Sec 内存限制: 50 MB提交: 8 解决: 5[提交][状态][讨论版][命题人:外部导入]题目描述上体育课的时候,小蛮的老师经常带着同学们一起做游戏。这次,老师带着同学们一起做传球游戏。游戏规则是这样的:n个同学站成一个圆圈,其中的一个同学手里拿着一个球,当老师吹哨子时开始传球,每个同学可以把球传给自己左右的两个同学中的一个(左右任意...原创 2018-05-10 15:44:00 · 387 阅读 · 0 评论 -
ZOJ 3593 One Person Game(拓展欧几里得求最小步数)
One Person GameTime Limit: 2 Seconds Memory Limit: 65536 KBThere is an interesting and simple one person game. Suppose there is a number axis under your feet. You are at point A at first...原创 2018-02-19 21:37:00 · 188 阅读 · 0 评论 -
欧几里德与扩展欧几里德算法
欧几里德算法 欧几里德算法又称辗转相除法,用于计算两个整数a,b的最大公约数。 基本算法:设a=qb+r,其中a,b,q,r都是整数,则gcd(a,b)=gcd(b,r),即gcd(a,b)=gcd(b,a%b)。 第一种证明: a可以表示成a = kb + r,则r = a mod b 假设d是a,b的一个公约数,...原创 2018-02-16 01:29:00 · 90 阅读 · 0 评论 -
ZOJ 3609 Modular Inverse(拓展欧几里得求最小逆元)
Modular InverseTime Limit: 2 Seconds Memory Limit: 65536 KB The modular modular multiplicative inverse of an integer a modulo m is an integer x such that a-1≡x (mod m). This is equiv...原创 2018-02-19 23:35:00 · 175 阅读 · 0 评论 -
HDU 1222 Wolf and Rabbit(欧几里得)
Wolf and Rabbit Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9485 Accepted Submission(s): 4857 Problem Description...原创 2018-02-21 16:19:00 · 66 阅读 · 0 评论 -
POJ 1061 青蛙的约会(拓展欧几里得求同余方程,解ax+by=c)
青蛙的约会Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 122871 Accepted: 26147Description两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前...原创 2018-02-18 19:17:00 · 251 阅读 · 0 评论