思维
文章平均质量分 88
Fool xa
活着
展开
-
Intersection ,poj1410(判断两线段是否相交)
#include #include #include using namespace std;struct point//记录点的坐标{double x,y;};struct line//记录线段的始端点和尾端点{point st,ed;};//判断两条线段是否相交:https://www.cnblogs.com/tuyang1129/p/9390376.htmldouble mul(point a,point b,point c){return}bool find(lin原创 2021-10-22 19:26:22 · 105 阅读 · 0 评论 -
c++中STL中容器讲解
一、容器的定义在数据存储上,有一种对象类型,它可以持有其它对象或指向其它对像的指针,这种对象类型就叫做容器。很简单,容器就是保存其它对象的对象,当然这是一个朴素的理解,这种“对象”还包含了一系列处理“其它对象”的方法。二、容器的种类1、顺序容器:是一种各元素之间有顺序关系的线性表,是一种线性结构的可序群集。顺序性容器中的每个元素均有固定的位置,除非用删除或插入的操作改变这个位置。顺序容器的元素排列次序与元素值无关,而是由元素添加到容器里的次序决定。顺序容器包括:vector(向量)、list(列表)、转载 2021-08-15 16:55:30 · 189 阅读 · 0 评论 -
Jessica‘s Reading Problem POJ - 3320(尺取)
Jessica’s a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pass it, she has to master all ideas included in a very thick text book. The author of that text原创 2021-08-07 18:41:32 · 103 阅读 · 0 评论 -
放玩具,用几何方法求解+二分
Calculate the number of toys that land in each bin of a partitioned toy box.计算每一个玩具箱里面玩具的数量Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave John a rectangular box to put his toys in,转载 2021-06-08 21:43:56 · 372 阅读 · 0 评论 -
用给定个数的0,1,替换字符串中的 ‘?‘ 并使之成为回文串,不能的输出-1
You are given a string s consisting of the characters ‘0’, ‘1’, and ‘?’. You need to replace all the characters with ‘?’ in the string s by ‘0’ or ‘1’ so that the string becomes a palindrome and has exactly a characters ‘0’ and exactly b characters ‘1’. No原创 2021-05-30 15:39:07 · 262 阅读 · 0 评论