ICode9

精准搜索请尝试: 精确搜索
  • [Editorial] Codeforces Contest 17262022-09-07 05:30:53

    A. Mainak and Array 显然如果 \([l,r]\) 不包括两端那么就不会对答案有影响,那么直接枚举包括两端的情况即可。 /* author : Gemini date : September 6th, 2022 url : https://codeforces.com/contests/1726/A */ #include<bits/stdc++.h> using namespace std; template<typena

  • 计算几何模板2022-01-12 19:01:08

    const double eps = 1e-8; const double inf = 1e20; const double pi = acos(-1.0); const int maxp = 1010; //判断正负 inline int sgn (double x) { if (fabs(x) < eps) return 0; if (x < 0) return -1; else return 1; } inline double sqr (double x) {return x *

  • cf739 C. Alyona and towers(线段树)2021-12-30 18:34:27

    题意: 给定数组,要求实现两种操作:区间加、查询数组中最长的 “先严格上升再严格下降” 的连续子区间的长度。 注意只严格上升或只严格下降或只有一个元素也是合法的。 思路: 把长为n的原数组处理成相邻项的差,长为n-1。 考虑相邻项的差的符号,1,0,-1表示大于零,等于零,小于零。满足条件

  • CF1620F 题解2021-12-21 10:03:26

    CF1620F 题解 题意: 给定排列 \(p\),要求拟定一个新序列 \(p'\),满足: \(\forall i \in [1,n],p'_i=\pm p_i\); 构造无向图 \(G\),其中 \((i,j)\) 有边当且仅当 \(i<j,p'_i>p'_j\),要求 \(G\) 是二分图。 请给出方案或报告没有方案。 做法: 首先注意到,一张图不是二分图,当且仅当其存在至

  • [极角排序]Scrambled Polygon POJ20072021-10-26 17:00:33

    A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the vertices of the polygon. When one starts at any vertex of a closed polygon and traverses each bounding line segment e

  • [线段判交][最短路]The Doors POJ15562021-10-25 23:01:30

    You are to find the length of the shortest path through a chamber containing obstructing walls. The chamber will always have sides at x = 0, x = 10, y = 0, and y = 10. The initial and final points of the path are always (0, 5) and (10, 5). There will also

  • 计算几何2D2021-09-22 23:59:18

    零. 三态函数 const double eps = 1e-8; const double Pi = acos(-1.0); int sgn(double x) { if(fabs(x) < eps) return 0; return x < 0 ? -1 : 1; } 一. 点类及其常见操作 typedef struct Point { double x, y; Point(double x=0, double y=0): x(x),

  • 点到圆的切点2021-09-15 16:31:38

    点到圆的切点 https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/7/CGL_7_F int sgn(double x) { if(fabs(x)<eps)return 0; return x<0?-1:1; } struct Point { //定义点和基本运算 double x,y; double ang; Point() {} Point(double x,double y):x(x),y(y) {} Po

  • 两圆交点2021-09-15 13:04:33

    两圆交点 https://onlinejudge.u-aizu.ac.jp/courses/library/4/CGL/7/CGL_7_E int sgn(double x) { if(fabs(x)<eps)return 0; return x<0?-1:1; } struct Point { //定义点和基本运算 double x,y; double ang; Point() {} Point(double x,double y):x(x),y(y) {} Point

  • 加入正则化项是如何减少过拟合的2021-09-13 18:31:48

    过拟合时加入正则化项为什么能减少过拟合,提高模型泛化能力?   要降低模型的复杂度,来获得模型更好的泛化能力。而降低模型的复杂度有两条路径:一是进行降维,进行特征约减,这样可以减少模型参数的个数。二是对参数进行约束。使得参数的取值范围减少。而第二种方法就是加正则项。 增加了

  • 计算几何之凸包问题2021-07-17 12:59:13

    文章目录 计算几何之凸包问题POJ 1113 WallPOJ 2007 Scrambled PolygonPOJ 1873 The Fortified ForestPOJ 1228 Grandpa's EstatePOJ 3348 Cows 计算几何之凸包问题 POJ 1113 Wall 大意: 给出一个n边形的城堡,国王要求修建一个城墙,城墙到城堡的距离最少是L,问最少的城堡边

  • 计算几何之凸包问题2021-07-17 12:58:41

    文章目录 计算几何之凸包问题POJ 1113 WallPOJ 2007 Scrambled PolygonPOJ 1873 The Fortified ForestPOJ 1228 Grandpa's EstatePOJ 3348 Cows 计算几何之凸包问题 POJ 1113 Wall 大意: 给出一个n边形的城堡,国王要求修建一个城墙,城墙到城堡的距离最少是L,问最少的城堡边

  • CodeForces - 32E Hide-and-Seek【计算几何】2021-05-01 16:29:24

    题目链接:https://codeforces.com/contest/32/problem/E 先判两点之间是否被墙和镜子挡,再用相似三角形找入射点,乱搞判断一下。 这题有点卡精度,EPS用1e-6能过,1e-8过不了。 #include <iostream> #include <cstdio> #include <cstdlib> #include <cctype> #include <cmath> #incl

  • CF1485F 题解2021-02-13 09:01:04

    Problem 传送门:CF1485F 给出一个长度为 \(n\) 的序列 \(b_1,b_2,\dots ,b_n\) ,求出有多少种序列\(a_1,a_2,\dots,a_n\) 满足: \(\forall i \in [1,n],b_i = a_i \or b_i = \sum_\limits{j=1}^i a_j\). Sol 考虑当前我们填到第 \(i\) 位,所填的数的和是 \(S\) , 那么,我们可以填: 1.\(b

  • Excel 2010 SQL应用048 比较两列数据是否相同2020-12-23 15:31:19

    目录 源数据表 解决方案一: STRCOMP函数 CBOOL函数 CBOOL函数与STRCOMP函数用法比较 解决方案二 解决方案三 SGN函数 源数据表 学号赵老师王老师1郭海晶郭海晶2吴美燕吴美艳3杨明军杨明军4彭高辉彭高辉5王晓敏王晓敏6陈菊云陈菊云7何伟何伟8洪秋雯洪秋文9刘欢刘欢10周颖周颖11武

  • kuangbin带你飞 专题十三 基础计算几何2020-12-12 02:32:21

    目录POJ 2318 TOYSPOJ 2398 Toy StoragePOJ 3304 SegmentsPOJ 1269 Intersecting LinesPOJ 1556 The DoorsPOJ 2653 Pick-up sticksPOJ 1066 Treasure HuntPOJ 1410 IntersectionPOJ 1696 Space AntPOJ 3347 Kadj SquaresPOJ 2826 An Easy Problem?!POJ 1039 PipePOJ 3349 Geome

  • LeetCode #1111 有效符号的嵌套深度2020-04-01 13:08:35

    题目描述 分析 u1s1这道题的翻译着实抽象。。。下面是我认为的几个要点: 有效括号字符串(Valid Parentheses Strings, 后面简写为VPS)中的括号都是前后匹配的,不会出现类似"())"、")("之类的情况; VPSseq,要求将其分为两个子串A、B,它们也需要是VPS; VPS的深度depth 空字符,如"",dept

  • 多个凸多边形相交面积2019-09-27 21:04:34

    #include <bits/stdc++.h>using namespace std;const long double eps=1e-8;const double pi=acos(-1.0);int sgn(double x) { if(fabs(x)<eps) return 0; return x<0?-1:1;}int dcmp(double x,double y) { if(fabs(x-y)<eps) return 0

  • Codeforces Round #580 (Div. 1)(CF1205)2019-08-21 10:04:25

    A 将$a_i$看做一个无穷数列,$i > 2n$时$a_i = a_{i - 2n}$.设$sgn_i = \sum\limits_{j=i+1}^{i+n}a_i - \sum\limits_{j=i}^{i+n-1}a_i = a_{i+n} - a_i$,那么答案要满足:$\forall j \leq k , \sum\limits_{p=j}^k sgn_p \in [-1,1]$.且$\forall i , sgn_i \neq 0$. 上述条件等价于$i>

  • 省赛前最后一次总结2019-05-09 19:51:51

    经过这一个月的做题训练,思维能力,跟做题感觉,都有所有能力也有所提高。没有太多感想,就是继续努力。 问题: 1.埃氏筛法 int a[maxx]; int b[maxx+1]; int gg(int n) { int p=0;//记录素数个数 for(int i=0;i<n+1;i++)b[i]=1; b[0]=0; b[1]=0; //准备完毕

  • Art Gallery2019-05-05 18:39:32

    Art Gallery http://poj.org/problem?id=1279 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 9684   Accepted: 3747 Description The art galleries of the new and very futuristic building of the Center for Balkan Cooperation have the fo

  • Maxim and Array CodeForces - 721D (贪心)2019-03-25 22:55:24

    大意: 给定序列, 每次操作选择一个数+x或-x, 最多k次操作, 求操作后所有元素积的最小值   贪心先选出绝对值最小的调整为负数, 再不断选出绝对值最小的增大它的绝对值 #include <iostream>#include <algorithm>#include <cstdio>#include <math.h>#include <set>#include <map>#i

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有