From 65b6b8310fec1666757086efa1aa33b0e3b5b489 Mon Sep 17 00:00:00 2001 From: ljcjames Date: Sat, 13 Aug 2022 14:22:41 +0800 Subject: [PATCH] =?UTF-8?q?8.13=E6=97=A9=E4=B8=8A=E6=AF=94=E8=B5=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 8.10/I-Wall/Readme.md | 2 +- 8.13/A-Points/Points.cpp | 83 ++++++++++++++++++++++++ 8.13/A-Points/Readme.md | 27 ++++++++ 8.13/A-Points/doc/Readme.md | 1 + 8.13/A-Points/main.cpp | 6 ++ 8.13/A-Points/test/in.txt | 0 8.13/A-Points/test/in2.txt | 0 8.13/A-Points/test/in3.txt | 0 8.13/A-Points/test/out.txt | 7 ++ 8.13/B-Suspicious/Readme.md | 27 ++++++++ 8.13/B-Suspicious/Suspicious.cpp | 65 +++++++++++++++++++ 8.13/B-Suspicious/bout.txt | 4 ++ 8.13/B-Suspicious/doc/Readme.md | 1 + 8.13/B-Suspicious/main.cpp | 6 ++ 8.13/B-Suspicious/test/in.txt | 0 8.13/B-Suspicious/test/in2.txt | 0 8.13/B-Suspicious/test/in3.txt | 0 8.13/B-Suspicious/test/out.txt | 7 ++ 8.13/E-VasyaTriangle/E-VasyaTriangle.cpp | 40 ++++++++++++ 8.13/E-VasyaTriangle/Readme.md | 27 ++++++++ 8.13/E-VasyaTriangle/doc/Readme.md | 1 + 8.13/E-VasyaTriangle/main.cpp | 6 ++ 8.13/E-VasyaTriangle/test/in.txt | 0 8.13/E-VasyaTriangle/test/in2.txt | 0 8.13/E-VasyaTriangle/test/in3.txt | 0 8.13/E-VasyaTriangle/test/out.txt | 7 ++ 26 files changed, 316 insertions(+), 1 deletion(-) create mode 100644 8.13/A-Points/Points.cpp create mode 100644 8.13/A-Points/Readme.md create mode 100644 8.13/A-Points/doc/Readme.md create mode 100644 8.13/A-Points/main.cpp create mode 100644 8.13/A-Points/test/in.txt create mode 100644 8.13/A-Points/test/in2.txt create mode 100644 8.13/A-Points/test/in3.txt create mode 100644 8.13/A-Points/test/out.txt create mode 100644 8.13/B-Suspicious/Readme.md create mode 100644 8.13/B-Suspicious/Suspicious.cpp create mode 100644 8.13/B-Suspicious/bout.txt create mode 100644 8.13/B-Suspicious/doc/Readme.md create mode 100644 8.13/B-Suspicious/main.cpp create mode 100644 8.13/B-Suspicious/test/in.txt create mode 100644 8.13/B-Suspicious/test/in2.txt create mode 100644 8.13/B-Suspicious/test/in3.txt create mode 100644 8.13/B-Suspicious/test/out.txt create mode 100644 8.13/E-VasyaTriangle/E-VasyaTriangle.cpp create mode 100644 8.13/E-VasyaTriangle/Readme.md create mode 100644 8.13/E-VasyaTriangle/doc/Readme.md create mode 100644 8.13/E-VasyaTriangle/main.cpp create mode 100644 8.13/E-VasyaTriangle/test/in.txt create mode 100644 8.13/E-VasyaTriangle/test/in2.txt create mode 100644 8.13/E-VasyaTriangle/test/in3.txt create mode 100644 8.13/E-VasyaTriangle/test/out.txt diff --git a/8.10/I-Wall/Readme.md b/8.10/I-Wall/Readme.md index d6c5f30..483e858 100644 --- a/8.10/I-Wall/Readme.md +++ b/8.10/I-Wall/Readme.md @@ -5,7 +5,7 @@ https://vjudge.net/contest/508277#problem/I ### 做法 用Graham法(看PPT即按逆时针顺序找点左转入栈,右转上一个出栈直到变成是右转)求凸包,再加上一个以L为半径的⚪的周长(在转角的地方,外角和=360) ### 关键词 -Graham、凸包、结构体、栈、PI、eps、计算几何 +Graham、凸包、结构体、栈、PI、eps、计算几何、构造函数、 ### 易错点 (int)()记得加括号、scanf与& ### 工具箱 diff --git a/8.13/A-Points/Points.cpp b/8.13/A-Points/Points.cpp new file mode 100644 index 0000000..54defcf --- /dev/null +++ b/8.13/A-Points/Points.cpp @@ -0,0 +1,83 @@ +#include +#include +#include +#include +using namespace std; +struct Point +{ + int x,y; +}p[4]; +struct Edge +{ + int x,y,val; +}e[4]; +int main() +{ + for(int i=1;i<=3;i++) + { + scanf("%d%d",&p[i].x,&p[i].y);//!!!!& + } + int sum=0; + for(int i=1;i<=3;i++) + { + int j=i%3+1; + e[i].x=p[j].x-p[i].x; + e[i].y=p[j].y-p[i].y;//i,j + e[i].val=abs(e[i].x)+abs(e[i].y); + sum+=e[i].val; + } + int ans=1; + for(int i=2;i<=3;i++) + { + if(sum-e[i].val0) + { + tot--; + } + printf("%d\n",tot); + Point now; + now=p[ans]; + if(e[ans].x!=0) + { +// if() + printf("%d %d ",now.x,now.y); + now.x+=e[ans].x; + printf("%d %d\n",now.x,now.y); + } + int been=0; + if(e[ans].y!=0) + { + printf("%d %d ",now.x,now.y); + now.y+=e[ans].y; + if(e[j].y*e[ans].y>0) + { + been=1; + now.y+=e[j].y; + } + printf("%d %d\n",now.x,now.y); + } + if(e[j].x!=0) + { + printf("%d %d ",now.x,now.y); + now.x+=e[j].x; + printf("%d %d\n",now.x,now.y); + } + if(!been&&e[j].y!=0) + { + printf("%d %d ",now.x,now.y); + now.y+=e[j].y; + printf("%d %d\n",now.x,now.y); + } + return 0; +} diff --git a/8.13/A-Points/Readme.md b/8.13/A-Points/Readme.md new file mode 100644 index 0000000..fe3eaf9 --- /dev/null +++ b/8.13/A-Points/Readme.md @@ -0,0 +1,27 @@ +# 题目 +* 链接 +### 题意 + +### 做法 + +### 关键词 + +### 易错点 + +### 工具箱 +* +### 题面 + +### Input + +### Output + +### Sample +#### input + +#### output + +### Hint + + +![](sketch.jpg) \ No newline at end of file diff --git a/8.13/A-Points/doc/Readme.md b/8.13/A-Points/doc/Readme.md new file mode 100644 index 0000000..4e768b5 --- /dev/null +++ b/8.13/A-Points/doc/Readme.md @@ -0,0 +1 @@ +# \ No newline at end of file diff --git a/8.13/A-Points/main.cpp b/8.13/A-Points/main.cpp new file mode 100644 index 0000000..b6d31b7 --- /dev/null +++ b/8.13/A-Points/main.cpp @@ -0,0 +1,6 @@ +#include +using namespace std; +int main() +{ + +} diff --git a/8.13/A-Points/test/in.txt b/8.13/A-Points/test/in.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/A-Points/test/in2.txt b/8.13/A-Points/test/in2.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/A-Points/test/in3.txt b/8.13/A-Points/test/in3.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/A-Points/test/out.txt b/8.13/A-Points/test/out.txt new file mode 100644 index 0000000..01ba092 --- /dev/null +++ b/8.13/A-Points/test/out.txt @@ -0,0 +1,7 @@ +## z:\Chao\src\Template\test\in.txt +2020/03/14 周六 11:41:28.68 +Hello Easy C++ project! + +----------------------------------------------- +Process exited after 200 ms with return value 0 + diff --git a/8.13/B-Suspicious/Readme.md b/8.13/B-Suspicious/Readme.md new file mode 100644 index 0000000..fe3eaf9 --- /dev/null +++ b/8.13/B-Suspicious/Readme.md @@ -0,0 +1,27 @@ +# 题目 +* 链接 +### 题意 + +### 做法 + +### 关键词 + +### 易错点 + +### 工具箱 +* +### 题面 + +### Input + +### Output + +### Sample +#### input + +#### output + +### Hint + + +![](sketch.jpg) \ No newline at end of file diff --git a/8.13/B-Suspicious/Suspicious.cpp b/8.13/B-Suspicious/Suspicious.cpp new file mode 100644 index 0000000..6a63057 --- /dev/null +++ b/8.13/B-Suspicious/Suspicious.cpp @@ -0,0 +1,65 @@ +#include +#include +#include +#include +using namespace std; +const int N=1e9+5,M=4e4;//const +int ans[M],dp[3][3],t,n,len; +void pre() +{ + ans[1]=0; + ans[2]=2; + ans[3]=6; + dp[0][1]=1; + dp[1][1]=1; + dp[2][1]=1; + bool b=1; + for(int i=4;b;i+=3) + { + for(int j=0;j<3;j++) + { + dp[j][1]++; + int r=(j+1)%3,l=(r+1)%3; + ans[i+j]=ans[i+j-1]+dp[l][1]*2+dp[r][1]*2; +// printf("%d:%d\n",i+j,ans[i+j]); + if(ans[i+j]>=N-5) + { + b=0; + len=i+j; + break; + } + } + } +} +int find(int u,int l,int r) +{ + int mid=(l+r)/2; + if(l==r) + { + return l; + } + if(ans[mid]==u) + { + return mid; + } + if(u +using namespace std; +int main() +{ + +} diff --git a/8.13/B-Suspicious/test/in.txt b/8.13/B-Suspicious/test/in.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/B-Suspicious/test/in2.txt b/8.13/B-Suspicious/test/in2.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/B-Suspicious/test/in3.txt b/8.13/B-Suspicious/test/in3.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/B-Suspicious/test/out.txt b/8.13/B-Suspicious/test/out.txt new file mode 100644 index 0000000..01ba092 --- /dev/null +++ b/8.13/B-Suspicious/test/out.txt @@ -0,0 +1,7 @@ +## z:\Chao\src\Template\test\in.txt +2020/03/14 周六 11:41:28.68 +Hello Easy C++ project! + +----------------------------------------------- +Process exited after 200 ms with return value 0 + diff --git a/8.13/E-VasyaTriangle/E-VasyaTriangle.cpp b/8.13/E-VasyaTriangle/E-VasyaTriangle.cpp new file mode 100644 index 0000000..827f6cc --- /dev/null +++ b/8.13/E-VasyaTriangle/E-VasyaTriangle.cpp @@ -0,0 +1,40 @@ +#include +#include +#include +#include +using namespace std; +int n,m,k; +int gcd(int a,int b) +{ + while(b!=0) + { + int tmp=a; + a=b; + b=tmp%b; + } + return a; +} +int main() +{ +// freopen("bout.txt","w",stdout); + + scanf("%d%d%d",&n,&m,&k); + int s=n*m/k*2; + if(n*m*2%k!=0) + { + printf("NO"); + return 0; + } + int nm=gcd(n,m),n1=n/nm,m1=m/nm; + int x=gcd(k,n1),xy=gcd(k,nm),y=gcd(k,m1); + printf("%d %d %d %d\n",nm,x,y,xy); + if(gcd(x*y*xy,s)==s) + { + printf("YES\n0 0\n%d 0\n0 %d\n",x*xy,y); + } + else + { + printf("NO"); + } + return 0; +} diff --git a/8.13/E-VasyaTriangle/Readme.md b/8.13/E-VasyaTriangle/Readme.md new file mode 100644 index 0000000..fe3eaf9 --- /dev/null +++ b/8.13/E-VasyaTriangle/Readme.md @@ -0,0 +1,27 @@ +# 题目 +* 链接 +### 题意 + +### 做法 + +### 关键词 + +### 易错点 + +### 工具箱 +* +### 题面 + +### Input + +### Output + +### Sample +#### input + +#### output + +### Hint + + +![](sketch.jpg) \ No newline at end of file diff --git a/8.13/E-VasyaTriangle/doc/Readme.md b/8.13/E-VasyaTriangle/doc/Readme.md new file mode 100644 index 0000000..4e768b5 --- /dev/null +++ b/8.13/E-VasyaTriangle/doc/Readme.md @@ -0,0 +1 @@ +# \ No newline at end of file diff --git a/8.13/E-VasyaTriangle/main.cpp b/8.13/E-VasyaTriangle/main.cpp new file mode 100644 index 0000000..b6d31b7 --- /dev/null +++ b/8.13/E-VasyaTriangle/main.cpp @@ -0,0 +1,6 @@ +#include +using namespace std; +int main() +{ + +} diff --git a/8.13/E-VasyaTriangle/test/in.txt b/8.13/E-VasyaTriangle/test/in.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/E-VasyaTriangle/test/in2.txt b/8.13/E-VasyaTriangle/test/in2.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/E-VasyaTriangle/test/in3.txt b/8.13/E-VasyaTriangle/test/in3.txt new file mode 100644 index 0000000..e69de29 diff --git a/8.13/E-VasyaTriangle/test/out.txt b/8.13/E-VasyaTriangle/test/out.txt new file mode 100644 index 0000000..01ba092 --- /dev/null +++ b/8.13/E-VasyaTriangle/test/out.txt @@ -0,0 +1,7 @@ +## z:\Chao\src\Template\test\in.txt +2020/03/14 周六 11:41:28.68 +Hello Easy C++ project! + +----------------------------------------------- +Process exited after 200 ms with return value 0 +