
数论/数学
数论/数学
SSL_GYX
座右铭:言念君子,温其如玉。
展开
-
【集训Day2】cinema ticket
【集训Day2 T2】cinema ticket原创 2022-07-17 21:37:36 · 125 阅读 · 0 评论 -
【POJ】1845 Sumdiv
SumdivLink解题思路显然,aba^bab 的分解质因数就是 aaa 的分解质因数数量每个乘以 bbb 。求和直接用等比数列求和公式即可。code#include<iostream>#include<cstdio>#include<cmath>#define int long longusing namespace std;const int mod=9901;int a,b,ans;int x[10000],y[10000],to原创 2022-02-26 10:29:56 · 219 阅读 · 0 评论 -
【POJ】1066 Treasure Hunt
Archeologists from the Antiquities and Curios Museum (ACM) have flown to Egypt to examine the great pyramid of Key-Ops. Using state-of-the-art technology they are able to determine that the lower floor of the pyramid is constructed from a series of straigh原创 2022-01-20 16:43:24 · 428 阅读 · 0 评论 -
【SSL】1280 全排列
全排列Link解题思路用 STLSTLSTL 中的 next_permutationnext\_permutationnext_permutation 直接生成全排列。code#include<algorithm>#include<iostream>#include<cstdio>using namespace std;int n;int a[10];int main(){ cin>>n; for(int i=1;i<原创 2022-01-19 10:11:15 · 955 阅读 · 0 评论 -
【POJ】1654 Area
AreaLink题目大意规定 1−41-41−4 分别代表,向右下走,向右走,向右上走,向下走,555 代表回到原点,6−96-96−9 代表,向上走,向左下走,向左走,向左上走。多组数据,每组数据从 (0,0)(0,0)(0,0) 开始,求描绘出多边形的面积。PSPSPS:不要管题目写的什么东西,英文翻译过来完全是错的。解题思路模拟图形,计算几何求面积。code#include<iostream>#include<cstring>#include<cs原创 2022-01-18 15:39:22 · 114 阅读 · 0 评论 -
【SSL】1213 多边形面积
多边形面积Link解题思路先依次判断线段是否相交,再计算面积。code#include<iostream>#include<cstdio>using namespace std;int n;struct abc{ double x,y;}a[1010];double cj(abc b1,abc b2,abc b3){ return (b1.x-b3.x)*(b2.y-b3.y)-(b2.x-b3.x)*(b1.y-b3.y);}int on原创 2022-01-18 15:01:14 · 80 阅读 · 0 评论 -
【Luogu】P2785 物理1(phsic1)- 磁通量
物理1(phsic1)- 磁通量Link解题思路叉积模板题。code#include<iostream>#include<cstdio>using namespace std;int n;double B;double x[100010];double y[100010];double cj(double x1,double y1,double x2,double y2){ return x1*y2-x2*y1;}int main(){原创 2022-01-17 19:36:20 · 132 阅读 · 0 评论 -
【SSL】1232 雷达覆盖
雷达覆盖Link解题思路先排除不在半径范围内的点,枚举剩下的点作为直线,枚举另一个点,作叉积。code#include<iostream>#include<cstring>#include<cstdio>#include<cmath>#define dou doubleusing namespace std;int n;int xx,yy;int x[1010];int y[1010];int v[1010];double原创 2022-01-17 11:31:14 · 392 阅读 · 0 评论 -
【Luogu】UVA1619 Feel Good
Feel GoodLink解题思路预处理出每个点可以作为最小值的区间的左右端点。code#include<iostream>#include<cstring>#include<cstdio>#define int long longusing namespace std;int n;int a[100010];int b[100010];int r[100010];int l[100010];int z[100010],top;vo原创 2022-01-16 21:16:55 · 136 阅读 · 0 评论 -
【51nod】1279 扔盘子
扔盘子Lind解题思路先把井处理成自下而上单调递增的。枚举每一层,一个盘子留在这一层只有两种情况:被下面一层卡住。正下方有一个盘子且这一层可以放下这个盘子。code#include<iostream>#include<cstdio>using namespace std;int n,m,ans;int a[50010];int b[50010];int main(){ cin>>n>>m; a[0]=0x3f3f3原创 2022-01-16 20:41:16 · 99 阅读 · 0 评论 -
【51nod】2478 小b接水
小b接水Link解题思路特别奇怪的一道题,只需要预处理出每个积木左边和右边最高的积木,取最小值就是这个积木可以储存的水,累加即可。code#include<iostream>#include<cstdio>#define int long longusing namespace std;int n, ans;int a[50010], b[50010], c[50010];signed main(){ cin>>n; for(int i原创 2022-01-16 20:31:35 · 184 阅读 · 0 评论 -
【Luogu&SSL2021.11.08】T1 Lyrith -迷宮リリス-
T1 Lyrith -迷宮リリス-link解题思路众所周知,8×125=10008\times125=10008×125=1000 。所以只需要考虑后三位是 888 的倍数即可。于是枚举 111~100010001000 中 888 的倍数,判断每一位数字有没有出现过相应的次数以上即可。code#include<iostream>#include<cstdio>#include<string>using namespace std;string原创 2021-11-13 10:42:25 · 142 阅读 · 0 评论 -
【Luogu&SSL2021.11.01】T1多项式滚出OI
多项式滚出OILink原题题目大意解题思路显然,这就是求 mmm 的 nnn 进制啊。。。code#include<iostream>#include<cstdio>#define int long longusing namespace std;int n,m;int a[100],tot;signed main(){ cin>>n>>m; while(m) a[++tot]=m%n,m/=n; printf("原创 2021-11-05 20:23:40 · 136 阅读 · 0 评论 -
【luogu_P5253】丢番图
丢番图题目链接:丢番图解题思路先推一下式子:1x+1y=1n\frac{1}{x}+\frac{1}{y}=\frac{1}{n}x1+y1=n1x+yxy=1n\frac{x+y}{xy}=\frac{1}{n}xyx+y=n1nx+ny=xynx+ny=xynx+ny=xynx+ny−xy=0nx+ny-xy=0nx+ny−xy=0nx+ny−xy+n2=n2nx+ny-xy+n^2=n^2nx+ny−xy+n2=n2(x−n)(y−n)=n2(x-n)(y-n)=n^2(x−n)原创 2021-05-15 15:42:32 · 170 阅读 · 1 评论