From e8985e6fe2210b3148419239b079368d727dc719 Mon Sep 17 00:00:00 2001 From: ruan-cat <1219043956@qq.com> Date: Fri, 26 Apr 2024 18:59:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=94=20save-file:=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E5=BE=88=E5=A4=9A=E6=B5=8B=E8=AF=95=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=B5=8B=E8=AF=95=E6=BC=94=E7=A4=BA?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/.vuepress/styles/config.scss | 14 ++ .../src/.vuepress/styles/index.scss | 76 +++++- packages/monorepo-1/src/.vuepress/theme.ts | 2 +- .../src/exercises copy 2/2024-3-17.md | 19 ++ .../src/exercises copy 2/2024-3-18.md | 19 ++ .../src/exercises copy 2/2024-3-19.md | 223 ++++++++++++++++++ .../src/exercises copy 2/2024-3-20.md | 19 ++ .../src/exercises copy 2/2024-3-21.md | 13 + .../src/exercises copy 2/2024-3-22.md | 13 + .../src/exercises copy 2/2024-3-23.md | 13 + .../src/exercises copy 2/2024-3-24.md | 13 + .../src/exercises copy 2/exercises.md | 10 + .../src/exercises copy 3/2024-3-17.md | 19 ++ .../src/exercises copy 3/2024-3-18.md | 19 ++ .../src/exercises copy 3/2024-3-19.md | 223 ++++++++++++++++++ .../src/exercises copy 3/2024-3-20.md | 19 ++ .../src/exercises copy 3/2024-3-21.md | 13 + .../src/exercises copy 3/2024-3-22.md | 13 + .../src/exercises copy 3/2024-3-23.md | 13 + .../src/exercises copy 3/2024-3-24.md | 13 + .../src/exercises copy 3/exercises.md | 10 + .../src/exercises copy/2024-3-17.md | 19 ++ .../src/exercises copy/2024-3-18.md | 19 ++ .../src/exercises copy/2024-3-19.md | 223 ++++++++++++++++++ .../src/exercises copy/2024-3-20.md | 19 ++ .../src/exercises copy/2024-3-21.md | 13 + .../src/exercises copy/2024-3-22.md | 13 + .../src/exercises copy/2024-3-23.md | 13 + .../src/exercises copy/2024-3-24.md | 13 + .../src/exercises copy/exercises.md | 10 + .../src/exercises/2024-3-17 copy 2.md | 19 ++ .../src/exercises/2024-3-17 copy.md | 19 ++ .../src/exercises/2024-3-18 copy 2.md | 19 ++ .../src/exercises/2024-3-18 copy.md | 19 ++ .../src/exercises/2024-3-19 copy 2.md | 223 ++++++++++++++++++ .../src/exercises/2024-3-19 copy.md | 223 ++++++++++++++++++ .../src/exercises/2024-3-20 copy 2.md | 19 ++ .../src/exercises/2024-3-20 copy.md | 19 ++ .../src/exercises/2024-3-21 copy 2.md | 13 + .../src/exercises/2024-3-21 copy.md | 13 + .../src/exercises/2024-3-22 copy 2.md | 13 + .../src/exercises/2024-3-22 copy.md | 13 + .../src/exercises/2024-3-23 copy 2.md | 13 + .../src/exercises/2024-3-23 copy.md | 13 + .../src/exercises/2024-3-24 copy 2.md | 13 + .../src/exercises/2024-3-24 copy.md | 13 + .../src/exercises/exercises copy 2.md | 10 + .../src/exercises/exercises copy.md | 10 + 48 files changed, 1800 insertions(+), 2 deletions(-) create mode 100644 packages/monorepo-1/src/exercises copy 2/2024-3-17.md create mode 100644 packages/monorepo-1/src/exercises copy 2/2024-3-18.md create mode 100644 packages/monorepo-1/src/exercises copy 2/2024-3-19.md create mode 100644 packages/monorepo-1/src/exercises copy 2/2024-3-20.md create mode 100644 packages/monorepo-1/src/exercises copy 2/2024-3-21.md create mode 100644 packages/monorepo-1/src/exercises copy 2/2024-3-22.md create mode 100644 packages/monorepo-1/src/exercises copy 2/2024-3-23.md create mode 100644 packages/monorepo-1/src/exercises copy 2/2024-3-24.md create mode 100644 packages/monorepo-1/src/exercises copy 2/exercises.md create mode 100644 packages/monorepo-1/src/exercises copy 3/2024-3-17.md create mode 100644 packages/monorepo-1/src/exercises copy 3/2024-3-18.md create mode 100644 packages/monorepo-1/src/exercises copy 3/2024-3-19.md create mode 100644 packages/monorepo-1/src/exercises copy 3/2024-3-20.md create mode 100644 packages/monorepo-1/src/exercises copy 3/2024-3-21.md create mode 100644 packages/monorepo-1/src/exercises copy 3/2024-3-22.md create mode 100644 packages/monorepo-1/src/exercises copy 3/2024-3-23.md create mode 100644 packages/monorepo-1/src/exercises copy 3/2024-3-24.md create mode 100644 packages/monorepo-1/src/exercises copy 3/exercises.md create mode 100644 packages/monorepo-1/src/exercises copy/2024-3-17.md create mode 100644 packages/monorepo-1/src/exercises copy/2024-3-18.md create mode 100644 packages/monorepo-1/src/exercises copy/2024-3-19.md create mode 100644 packages/monorepo-1/src/exercises copy/2024-3-20.md create mode 100644 packages/monorepo-1/src/exercises copy/2024-3-21.md create mode 100644 packages/monorepo-1/src/exercises copy/2024-3-22.md create mode 100644 packages/monorepo-1/src/exercises copy/2024-3-23.md create mode 100644 packages/monorepo-1/src/exercises copy/2024-3-24.md create mode 100644 packages/monorepo-1/src/exercises copy/exercises.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-17 copy 2.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-17 copy.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-18 copy 2.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-18 copy.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-19 copy 2.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-19 copy.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-20 copy 2.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-20 copy.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-21 copy 2.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-21 copy.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-22 copy 2.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-22 copy.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-23 copy 2.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-23 copy.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-24 copy 2.md create mode 100644 packages/monorepo-1/src/exercises/2024-3-24 copy.md create mode 100644 packages/monorepo-1/src/exercises/exercises copy 2.md create mode 100644 packages/monorepo-1/src/exercises/exercises copy.md diff --git a/packages/monorepo-1/src/.vuepress/styles/config.scss b/packages/monorepo-1/src/.vuepress/styles/config.scss index f91061d..2af9f83 100644 --- a/packages/monorepo-1/src/.vuepress/styles/config.scss +++ b/packages/monorepo-1/src/.vuepress/styles/config.scss @@ -1,3 +1,17 @@ // you can change config here $colors: #c0392b, #d35400, #f39c12, #27ae60, #16a085, #2980b9, #8e44ad, #2c3e50, #7f8c8d !default; + +// 修改电脑响应式布局断点 +$pc: 1920px; +// $pc: 5000px; + +// 想实现有效的 侧边栏控制 +// $mobile: 1920px; +// $mobile: 20px; + +// 侧边栏宽度 +$sidebar-width: 18.5rem; + +// 主要内容的宽度 +$content-width: 1150px; diff --git a/packages/monorepo-1/src/.vuepress/styles/index.scss b/packages/monorepo-1/src/.vuepress/styles/index.scss index f6af387..ecb0725 100644 --- a/packages/monorepo-1/src/.vuepress/styles/index.scss +++ b/packages/monorepo-1/src/.vuepress/styles/index.scss @@ -1 +1,75 @@ -// place your custom styles here +@use "@sass-palette/hope-config"; + +@import "./config.scss"; +@import "./palette.scss"; + +// 参考资料 https://github.com/orgs/vuepress-theme-hope/discussions/3742 +// FIXME: 出错 无法运行 +// @media (min-width: hope-config.$wide) { +// html { +// --content-width: calc(100vw - 40rem) !important; +// } +// } + +.vp-breadcrumb, +.vp-page-title, +.toc-place-holder, +.theme-hope-content:not(.custom) { + max-width: 95vw; +} + +// @media (min-width: $pc) { +// .toggle-sidebar-wrapper { +// display: unset; +// } +// } + +$scrollbar-width: 1rem; + +/*滚动条样式*/ +::-webkit-scrollbar { + width: $scrollbar-width; +} + +::-webkit-scrollbar-thumb { + width: $scrollbar-width; + border-radius: calc($scrollbar-width * 0.5); + + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.2); +} + +::-webkit-scrollbar-track { + width: $scrollbar-width; + border-radius: calc($scrollbar-width * 0.5); + + -webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2); + background: rgba(0, 0, 0, 0.1); +} + +aside#sidebar { + $color: palevioletred; + $width-s: 0.4rem; + $width-l: 1rem; + + & { + &::-webkit-scrollbar { + width: $width-s; + } + + &::-webkit-scrollbar-track { + width: $width-s; + } + + &::-webkit-scrollbar-thumb { + width: $width-s; + background-color: $theme-color; + } + } + + &:hover { + &::-webkit-scrollbar { + width: $width-l; + } + } +} diff --git a/packages/monorepo-1/src/.vuepress/theme.ts b/packages/monorepo-1/src/.vuepress/theme.ts index 2b9fdc1..c95cf7d 100644 --- a/packages/monorepo-1/src/.vuepress/theme.ts +++ b/packages/monorepo-1/src/.vuepress/theme.ts @@ -22,7 +22,7 @@ export default hopeTheme({ navbar, // 侧边栏 - sidebar, + sidebar: "structure", // 页脚 footer: "默认页脚", diff --git a/packages/monorepo-1/src/exercises copy 2/2024-3-17.md b/packages/monorepo-1/src/exercises copy 2/2024-3-17.md new file mode 100644 index 0000000..ea7ce15 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/2024-3-17.md @@ -0,0 +1,19 @@ +# 2024-3-17 星期天 + +## Second Order Statistics 二阶统计 + +- https://vjudge.net.cn/problem/CodeForces-22A + +![3.17](https://img2.imgtp.com/2024/03/17/LaSSxbaa.png) + +## Rudolf and 121 + +- https://vjudge.net/problem/CodeForces-1941B#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/S8E6WGqL.png) + +## Substring 子串 + +- https://vjudge.net/problem/HDU-6948#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/T7U9iZil.png) diff --git a/packages/monorepo-1/src/exercises copy 2/2024-3-18.md b/packages/monorepo-1/src/exercises copy 2/2024-3-18.md new file mode 100644 index 0000000..65ee36e --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/2024-3-18.md @@ -0,0 +1,19 @@ +# 2024-3-18 星期一 + +## Reconnaissance + +- https://vjudge.net/problem/CodeForces-32A#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/C50pe4xC.png) + +## Turtle Tenacity: Continual Mods + +- https://codeforces.com/problemset/problem/1933/D + +![3.18](https://img2.imgtp.com/2024/03/18/d0pYCeQ1.png) + +## Obsession with Robots + +- https://vjudge.net/problem/CodeForces-8B#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/dSAW3bt7.png) diff --git a/packages/monorepo-1/src/exercises copy 2/2024-3-19.md b/packages/monorepo-1/src/exercises copy 2/2024-3-19.md new file mode 100644 index 0000000..78bf1ef --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/2024-3-19.md @@ -0,0 +1,223 @@ +# 2024-3-19 星期二 + +## Borze + +- https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/UOJnR0lA.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_01 { + public static void main(String[] args) { + //https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + //分析:可以从左开始进行判断如果当前是.表示为0,取下一个i++; + //如果是-则接着判断下一个是.还是-对应1,2 + Scanner sc=new Scanner(System.in); + String str=sc.next(); + int[]arr=new int[str.length()];//用来记录对应数字 + int j=0; + for (int i = 0; i < str.length(); ) { + String temp= String.valueOf(str.charAt(i)); + if (temp.equals(".")) {//为0 + arr[j++]=0;i++; + }else if (temp.equals("-")) { + String temp1= String.valueOf(str.charAt(++i)); + if (temp1.equals(".")) { + arr[j++]=1;i++; + }else if (temp1.equals("-")) { + arr[j++]=2;i++; + } + } + } + for (int i = 0; i < j; i++) { + System.out.print(arr[i]+" "); + } + } +} +``` + +## Setting up Camp + +- https://codeforces.com/contest/1945/problem/A + +![3.19](https://img2.imgtp.com/2024/03/19/1J0MqiD5.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_02 { + public static void main(String[] args) { + //https://codeforces.com/contest/1945/problem/A + //分析:1.测试次数,2内向人不用管一人一个帐篷, + //3.外向的人必须要三个人才能住一个帐篷,不够可以借普通人,但如果还是不够返回-1 + // 对于普通人都可以1,2,3,但我们需要最少的帐篷 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(); + while (N-->0){ + int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(); + int sum=a; + sum+=b/3;//记录有多少组内向人(三人一组) + b=b%3;//取余 + if (b!=0) {//还有外向的人 + if (c+b < 3) {//包含外向人的剩余人数小于3人返回-1 + System.out.println(-1);continue; + }else if (c+b>=3) {//说明人数够 + sum+=(c+b)/3; + if ((c+b)%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum);continue; + } + }else {//没有外向人了 + sum+=c/3; + if (c%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum); + } + } + } +} + +``` + +## Lake Counting + +- https://vjudge.net/problem/POJ-2386#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/R7OW1gDB.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_03 { + public static void main(String[] args) { + //https://vjudge.net/problem/POJ-2386#author=GPT_zh + //1.核心判断W的周围是否存在W,对周围的W也这样判断,(分为9种) + //四个角落,四边,中间 + // ,会有重复,不好结束判断,我们可以对已判断的标记。 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(),M=sc.nextInt(); + char[][]filed=new char[N][M]; + for (int i = 0; i < N; i++) { + String line = sc.next(); + filed[i] = line.toCharArray(); + } + sc.close(); + int loopNumber=0; + for (int i = 0; i < N; i++) {//遍历判断当前是否为W + for (int j = 0; j < M; j++) { + if (filed[i][j]=='W') { + aroundIsW(filed,i,j,N,M); + filed[i][j]='w';//标记一下 + loopNumber++;//一个相连的水坑判断完加一 + }//如果不是就不管 + } + } + System.out.println(loopNumber); + } + public static void aroundIsW(char[][]arr,int i,int j,int N,int M){ + if (arr[i][j]=='W') {//只有当前为水坑,才继续判断,否则返回空 + if (i==0) {//在第一排 + if (j==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (j==M-1) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } else if (i==N-1) {//在最后一排 + if (j==0) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }if (j==M-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + } else if (j==0){//在第一列 + if (i==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (i==M-1) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j+1,N,M);//右边 + } else if (j==M-1) {//在最后一列 + if (i==0) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + }if (i==N-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + } else if (i>=1&&j>=1&&i<=N-1&&j<=M-1) {//在中间 + arr[i][j]='w'; + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } + }else return; + + } +} + +``` diff --git a/packages/monorepo-1/src/exercises copy 2/2024-3-20.md b/packages/monorepo-1/src/exercises copy 2/2024-3-20.md new file mode 100644 index 0000000..b911cd8 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/2024-3-20.md @@ -0,0 +1,19 @@ +# 2024-3-20 星期三 + +## Reconnaissance 2 + +- https://vjudge.net/problem/CodeForces-34A#author=GPT_zh + +![3.20](https://img2.imgtp.com/2024/03/20/GWSrUXRt.png) + +## Vlad and Division + +- https://codeforces.com/problemset/problem/1926/D + +![3.20](https://img2.imgtp.com/2024/03/20/0RY8fghL.png) + +## Binary Path + +- https://codeforces.com/problemset/problem/1937/B + +![3.21](https://img2.imgtp.com/2024/03/20/cSk2UHwU.png) diff --git a/packages/monorepo-1/src/exercises copy 2/2024-3-21.md b/packages/monorepo-1/src/exercises copy 2/2024-3-21.md new file mode 100644 index 0000000..30160bb --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/2024-3-21.md @@ -0,0 +1,13 @@ +# 2024-3-21 星期四 + +## Army + +- https://vjudge.net/problem/CodeForces-38A#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/qbxfMlnw.png) + +## Stack of Presents + +- https://vjudge.net/problem/CodeForces-1279C#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/oHVk29uE.png) diff --git a/packages/monorepo-1/src/exercises copy 2/2024-3-22.md b/packages/monorepo-1/src/exercises copy 2/2024-3-22.md new file mode 100644 index 0000000..8de0670 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/2024-3-22.md @@ -0,0 +1,13 @@ +# 2024-3-22 星期五 + +## Translation + +- https://vjudge.net/problem/CodeForces-41A#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/QVHSH6Jy.png) + +## A Game with Traps + +- https://vjudge.net/problem/CodeForces-1260D#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/3moYp7Sh.png) diff --git a/packages/monorepo-1/src/exercises copy 2/2024-3-23.md b/packages/monorepo-1/src/exercises copy 2/2024-3-23.md new file mode 100644 index 0000000..78b970a --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/2024-3-23.md @@ -0,0 +1,13 @@ +# 2024-3-23 星期六 + +## Ball Game + +- https://vjudge.net/problem/CodeForces-46A#author=21016020903 + +![3.23](https://img2.imgtp.com/2024/03/23/aS5lE6JH.png) + +## Red and Black + +- https://vjudge.net/problem/POJ-1979 + +![3.23](https://img2.imgtp.com/2024/03/23/D4gnyXCA.png) diff --git a/packages/monorepo-1/src/exercises copy 2/2024-3-24.md b/packages/monorepo-1/src/exercises copy 2/2024-3-24.md new file mode 100644 index 0000000..4102ab4 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/2024-3-24.md @@ -0,0 +1,13 @@ +## 2024-3-24 星期日 + +### Digit Product + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) + +### K-hour Clock + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) \ No newline at end of file diff --git a/packages/monorepo-1/src/exercises copy 2/exercises.md b/packages/monorepo-1/src/exercises copy 2/exercises.md new file mode 100644 index 0000000..7fff357 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 2/exercises.md @@ -0,0 +1,10 @@ +--- +# 期望该页面在顺序内 排布到侧边栏的第一位 +order: 1 +dir: + - order: 1 +--- + +# 习题集 + +这里是我们日常训练习题集。 diff --git a/packages/monorepo-1/src/exercises copy 3/2024-3-17.md b/packages/monorepo-1/src/exercises copy 3/2024-3-17.md new file mode 100644 index 0000000..ea7ce15 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/2024-3-17.md @@ -0,0 +1,19 @@ +# 2024-3-17 星期天 + +## Second Order Statistics 二阶统计 + +- https://vjudge.net.cn/problem/CodeForces-22A + +![3.17](https://img2.imgtp.com/2024/03/17/LaSSxbaa.png) + +## Rudolf and 121 + +- https://vjudge.net/problem/CodeForces-1941B#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/S8E6WGqL.png) + +## Substring 子串 + +- https://vjudge.net/problem/HDU-6948#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/T7U9iZil.png) diff --git a/packages/monorepo-1/src/exercises copy 3/2024-3-18.md b/packages/monorepo-1/src/exercises copy 3/2024-3-18.md new file mode 100644 index 0000000..65ee36e --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/2024-3-18.md @@ -0,0 +1,19 @@ +# 2024-3-18 星期一 + +## Reconnaissance + +- https://vjudge.net/problem/CodeForces-32A#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/C50pe4xC.png) + +## Turtle Tenacity: Continual Mods + +- https://codeforces.com/problemset/problem/1933/D + +![3.18](https://img2.imgtp.com/2024/03/18/d0pYCeQ1.png) + +## Obsession with Robots + +- https://vjudge.net/problem/CodeForces-8B#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/dSAW3bt7.png) diff --git a/packages/monorepo-1/src/exercises copy 3/2024-3-19.md b/packages/monorepo-1/src/exercises copy 3/2024-3-19.md new file mode 100644 index 0000000..78bf1ef --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/2024-3-19.md @@ -0,0 +1,223 @@ +# 2024-3-19 星期二 + +## Borze + +- https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/UOJnR0lA.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_01 { + public static void main(String[] args) { + //https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + //分析:可以从左开始进行判断如果当前是.表示为0,取下一个i++; + //如果是-则接着判断下一个是.还是-对应1,2 + Scanner sc=new Scanner(System.in); + String str=sc.next(); + int[]arr=new int[str.length()];//用来记录对应数字 + int j=0; + for (int i = 0; i < str.length(); ) { + String temp= String.valueOf(str.charAt(i)); + if (temp.equals(".")) {//为0 + arr[j++]=0;i++; + }else if (temp.equals("-")) { + String temp1= String.valueOf(str.charAt(++i)); + if (temp1.equals(".")) { + arr[j++]=1;i++; + }else if (temp1.equals("-")) { + arr[j++]=2;i++; + } + } + } + for (int i = 0; i < j; i++) { + System.out.print(arr[i]+" "); + } + } +} +``` + +## Setting up Camp + +- https://codeforces.com/contest/1945/problem/A + +![3.19](https://img2.imgtp.com/2024/03/19/1J0MqiD5.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_02 { + public static void main(String[] args) { + //https://codeforces.com/contest/1945/problem/A + //分析:1.测试次数,2内向人不用管一人一个帐篷, + //3.外向的人必须要三个人才能住一个帐篷,不够可以借普通人,但如果还是不够返回-1 + // 对于普通人都可以1,2,3,但我们需要最少的帐篷 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(); + while (N-->0){ + int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(); + int sum=a; + sum+=b/3;//记录有多少组内向人(三人一组) + b=b%3;//取余 + if (b!=0) {//还有外向的人 + if (c+b < 3) {//包含外向人的剩余人数小于3人返回-1 + System.out.println(-1);continue; + }else if (c+b>=3) {//说明人数够 + sum+=(c+b)/3; + if ((c+b)%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum);continue; + } + }else {//没有外向人了 + sum+=c/3; + if (c%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum); + } + } + } +} + +``` + +## Lake Counting + +- https://vjudge.net/problem/POJ-2386#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/R7OW1gDB.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_03 { + public static void main(String[] args) { + //https://vjudge.net/problem/POJ-2386#author=GPT_zh + //1.核心判断W的周围是否存在W,对周围的W也这样判断,(分为9种) + //四个角落,四边,中间 + // ,会有重复,不好结束判断,我们可以对已判断的标记。 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(),M=sc.nextInt(); + char[][]filed=new char[N][M]; + for (int i = 0; i < N; i++) { + String line = sc.next(); + filed[i] = line.toCharArray(); + } + sc.close(); + int loopNumber=0; + for (int i = 0; i < N; i++) {//遍历判断当前是否为W + for (int j = 0; j < M; j++) { + if (filed[i][j]=='W') { + aroundIsW(filed,i,j,N,M); + filed[i][j]='w';//标记一下 + loopNumber++;//一个相连的水坑判断完加一 + }//如果不是就不管 + } + } + System.out.println(loopNumber); + } + public static void aroundIsW(char[][]arr,int i,int j,int N,int M){ + if (arr[i][j]=='W') {//只有当前为水坑,才继续判断,否则返回空 + if (i==0) {//在第一排 + if (j==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (j==M-1) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } else if (i==N-1) {//在最后一排 + if (j==0) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }if (j==M-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + } else if (j==0){//在第一列 + if (i==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (i==M-1) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j+1,N,M);//右边 + } else if (j==M-1) {//在最后一列 + if (i==0) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + }if (i==N-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + } else if (i>=1&&j>=1&&i<=N-1&&j<=M-1) {//在中间 + arr[i][j]='w'; + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } + }else return; + + } +} + +``` diff --git a/packages/monorepo-1/src/exercises copy 3/2024-3-20.md b/packages/monorepo-1/src/exercises copy 3/2024-3-20.md new file mode 100644 index 0000000..b911cd8 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/2024-3-20.md @@ -0,0 +1,19 @@ +# 2024-3-20 星期三 + +## Reconnaissance 2 + +- https://vjudge.net/problem/CodeForces-34A#author=GPT_zh + +![3.20](https://img2.imgtp.com/2024/03/20/GWSrUXRt.png) + +## Vlad and Division + +- https://codeforces.com/problemset/problem/1926/D + +![3.20](https://img2.imgtp.com/2024/03/20/0RY8fghL.png) + +## Binary Path + +- https://codeforces.com/problemset/problem/1937/B + +![3.21](https://img2.imgtp.com/2024/03/20/cSk2UHwU.png) diff --git a/packages/monorepo-1/src/exercises copy 3/2024-3-21.md b/packages/monorepo-1/src/exercises copy 3/2024-3-21.md new file mode 100644 index 0000000..30160bb --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/2024-3-21.md @@ -0,0 +1,13 @@ +# 2024-3-21 星期四 + +## Army + +- https://vjudge.net/problem/CodeForces-38A#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/qbxfMlnw.png) + +## Stack of Presents + +- https://vjudge.net/problem/CodeForces-1279C#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/oHVk29uE.png) diff --git a/packages/monorepo-1/src/exercises copy 3/2024-3-22.md b/packages/monorepo-1/src/exercises copy 3/2024-3-22.md new file mode 100644 index 0000000..8de0670 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/2024-3-22.md @@ -0,0 +1,13 @@ +# 2024-3-22 星期五 + +## Translation + +- https://vjudge.net/problem/CodeForces-41A#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/QVHSH6Jy.png) + +## A Game with Traps + +- https://vjudge.net/problem/CodeForces-1260D#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/3moYp7Sh.png) diff --git a/packages/monorepo-1/src/exercises copy 3/2024-3-23.md b/packages/monorepo-1/src/exercises copy 3/2024-3-23.md new file mode 100644 index 0000000..78b970a --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/2024-3-23.md @@ -0,0 +1,13 @@ +# 2024-3-23 星期六 + +## Ball Game + +- https://vjudge.net/problem/CodeForces-46A#author=21016020903 + +![3.23](https://img2.imgtp.com/2024/03/23/aS5lE6JH.png) + +## Red and Black + +- https://vjudge.net/problem/POJ-1979 + +![3.23](https://img2.imgtp.com/2024/03/23/D4gnyXCA.png) diff --git a/packages/monorepo-1/src/exercises copy 3/2024-3-24.md b/packages/monorepo-1/src/exercises copy 3/2024-3-24.md new file mode 100644 index 0000000..4102ab4 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/2024-3-24.md @@ -0,0 +1,13 @@ +## 2024-3-24 星期日 + +### Digit Product + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) + +### K-hour Clock + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) \ No newline at end of file diff --git a/packages/monorepo-1/src/exercises copy 3/exercises.md b/packages/monorepo-1/src/exercises copy 3/exercises.md new file mode 100644 index 0000000..7fff357 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy 3/exercises.md @@ -0,0 +1,10 @@ +--- +# 期望该页面在顺序内 排布到侧边栏的第一位 +order: 1 +dir: + - order: 1 +--- + +# 习题集 + +这里是我们日常训练习题集。 diff --git a/packages/monorepo-1/src/exercises copy/2024-3-17.md b/packages/monorepo-1/src/exercises copy/2024-3-17.md new file mode 100644 index 0000000..ea7ce15 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/2024-3-17.md @@ -0,0 +1,19 @@ +# 2024-3-17 星期天 + +## Second Order Statistics 二阶统计 + +- https://vjudge.net.cn/problem/CodeForces-22A + +![3.17](https://img2.imgtp.com/2024/03/17/LaSSxbaa.png) + +## Rudolf and 121 + +- https://vjudge.net/problem/CodeForces-1941B#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/S8E6WGqL.png) + +## Substring 子串 + +- https://vjudge.net/problem/HDU-6948#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/T7U9iZil.png) diff --git a/packages/monorepo-1/src/exercises copy/2024-3-18.md b/packages/monorepo-1/src/exercises copy/2024-3-18.md new file mode 100644 index 0000000..65ee36e --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/2024-3-18.md @@ -0,0 +1,19 @@ +# 2024-3-18 星期一 + +## Reconnaissance + +- https://vjudge.net/problem/CodeForces-32A#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/C50pe4xC.png) + +## Turtle Tenacity: Continual Mods + +- https://codeforces.com/problemset/problem/1933/D + +![3.18](https://img2.imgtp.com/2024/03/18/d0pYCeQ1.png) + +## Obsession with Robots + +- https://vjudge.net/problem/CodeForces-8B#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/dSAW3bt7.png) diff --git a/packages/monorepo-1/src/exercises copy/2024-3-19.md b/packages/monorepo-1/src/exercises copy/2024-3-19.md new file mode 100644 index 0000000..78bf1ef --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/2024-3-19.md @@ -0,0 +1,223 @@ +# 2024-3-19 星期二 + +## Borze + +- https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/UOJnR0lA.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_01 { + public static void main(String[] args) { + //https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + //分析:可以从左开始进行判断如果当前是.表示为0,取下一个i++; + //如果是-则接着判断下一个是.还是-对应1,2 + Scanner sc=new Scanner(System.in); + String str=sc.next(); + int[]arr=new int[str.length()];//用来记录对应数字 + int j=0; + for (int i = 0; i < str.length(); ) { + String temp= String.valueOf(str.charAt(i)); + if (temp.equals(".")) {//为0 + arr[j++]=0;i++; + }else if (temp.equals("-")) { + String temp1= String.valueOf(str.charAt(++i)); + if (temp1.equals(".")) { + arr[j++]=1;i++; + }else if (temp1.equals("-")) { + arr[j++]=2;i++; + } + } + } + for (int i = 0; i < j; i++) { + System.out.print(arr[i]+" "); + } + } +} +``` + +## Setting up Camp + +- https://codeforces.com/contest/1945/problem/A + +![3.19](https://img2.imgtp.com/2024/03/19/1J0MqiD5.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_02 { + public static void main(String[] args) { + //https://codeforces.com/contest/1945/problem/A + //分析:1.测试次数,2内向人不用管一人一个帐篷, + //3.外向的人必须要三个人才能住一个帐篷,不够可以借普通人,但如果还是不够返回-1 + // 对于普通人都可以1,2,3,但我们需要最少的帐篷 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(); + while (N-->0){ + int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(); + int sum=a; + sum+=b/3;//记录有多少组内向人(三人一组) + b=b%3;//取余 + if (b!=0) {//还有外向的人 + if (c+b < 3) {//包含外向人的剩余人数小于3人返回-1 + System.out.println(-1);continue; + }else if (c+b>=3) {//说明人数够 + sum+=(c+b)/3; + if ((c+b)%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum);continue; + } + }else {//没有外向人了 + sum+=c/3; + if (c%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum); + } + } + } +} + +``` + +## Lake Counting + +- https://vjudge.net/problem/POJ-2386#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/R7OW1gDB.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_03 { + public static void main(String[] args) { + //https://vjudge.net/problem/POJ-2386#author=GPT_zh + //1.核心判断W的周围是否存在W,对周围的W也这样判断,(分为9种) + //四个角落,四边,中间 + // ,会有重复,不好结束判断,我们可以对已判断的标记。 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(),M=sc.nextInt(); + char[][]filed=new char[N][M]; + for (int i = 0; i < N; i++) { + String line = sc.next(); + filed[i] = line.toCharArray(); + } + sc.close(); + int loopNumber=0; + for (int i = 0; i < N; i++) {//遍历判断当前是否为W + for (int j = 0; j < M; j++) { + if (filed[i][j]=='W') { + aroundIsW(filed,i,j,N,M); + filed[i][j]='w';//标记一下 + loopNumber++;//一个相连的水坑判断完加一 + }//如果不是就不管 + } + } + System.out.println(loopNumber); + } + public static void aroundIsW(char[][]arr,int i,int j,int N,int M){ + if (arr[i][j]=='W') {//只有当前为水坑,才继续判断,否则返回空 + if (i==0) {//在第一排 + if (j==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (j==M-1) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } else if (i==N-1) {//在最后一排 + if (j==0) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }if (j==M-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + } else if (j==0){//在第一列 + if (i==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (i==M-1) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j+1,N,M);//右边 + } else if (j==M-1) {//在最后一列 + if (i==0) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + }if (i==N-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + } else if (i>=1&&j>=1&&i<=N-1&&j<=M-1) {//在中间 + arr[i][j]='w'; + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } + }else return; + + } +} + +``` diff --git a/packages/monorepo-1/src/exercises copy/2024-3-20.md b/packages/monorepo-1/src/exercises copy/2024-3-20.md new file mode 100644 index 0000000..b911cd8 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/2024-3-20.md @@ -0,0 +1,19 @@ +# 2024-3-20 星期三 + +## Reconnaissance 2 + +- https://vjudge.net/problem/CodeForces-34A#author=GPT_zh + +![3.20](https://img2.imgtp.com/2024/03/20/GWSrUXRt.png) + +## Vlad and Division + +- https://codeforces.com/problemset/problem/1926/D + +![3.20](https://img2.imgtp.com/2024/03/20/0RY8fghL.png) + +## Binary Path + +- https://codeforces.com/problemset/problem/1937/B + +![3.21](https://img2.imgtp.com/2024/03/20/cSk2UHwU.png) diff --git a/packages/monorepo-1/src/exercises copy/2024-3-21.md b/packages/monorepo-1/src/exercises copy/2024-3-21.md new file mode 100644 index 0000000..30160bb --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/2024-3-21.md @@ -0,0 +1,13 @@ +# 2024-3-21 星期四 + +## Army + +- https://vjudge.net/problem/CodeForces-38A#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/qbxfMlnw.png) + +## Stack of Presents + +- https://vjudge.net/problem/CodeForces-1279C#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/oHVk29uE.png) diff --git a/packages/monorepo-1/src/exercises copy/2024-3-22.md b/packages/monorepo-1/src/exercises copy/2024-3-22.md new file mode 100644 index 0000000..8de0670 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/2024-3-22.md @@ -0,0 +1,13 @@ +# 2024-3-22 星期五 + +## Translation + +- https://vjudge.net/problem/CodeForces-41A#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/QVHSH6Jy.png) + +## A Game with Traps + +- https://vjudge.net/problem/CodeForces-1260D#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/3moYp7Sh.png) diff --git a/packages/monorepo-1/src/exercises copy/2024-3-23.md b/packages/monorepo-1/src/exercises copy/2024-3-23.md new file mode 100644 index 0000000..78b970a --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/2024-3-23.md @@ -0,0 +1,13 @@ +# 2024-3-23 星期六 + +## Ball Game + +- https://vjudge.net/problem/CodeForces-46A#author=21016020903 + +![3.23](https://img2.imgtp.com/2024/03/23/aS5lE6JH.png) + +## Red and Black + +- https://vjudge.net/problem/POJ-1979 + +![3.23](https://img2.imgtp.com/2024/03/23/D4gnyXCA.png) diff --git a/packages/monorepo-1/src/exercises copy/2024-3-24.md b/packages/monorepo-1/src/exercises copy/2024-3-24.md new file mode 100644 index 0000000..4102ab4 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/2024-3-24.md @@ -0,0 +1,13 @@ +## 2024-3-24 星期日 + +### Digit Product + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) + +### K-hour Clock + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) \ No newline at end of file diff --git a/packages/monorepo-1/src/exercises copy/exercises.md b/packages/monorepo-1/src/exercises copy/exercises.md new file mode 100644 index 0000000..7fff357 --- /dev/null +++ b/packages/monorepo-1/src/exercises copy/exercises.md @@ -0,0 +1,10 @@ +--- +# 期望该页面在顺序内 排布到侧边栏的第一位 +order: 1 +dir: + - order: 1 +--- + +# 习题集 + +这里是我们日常训练习题集。 diff --git a/packages/monorepo-1/src/exercises/2024-3-17 copy 2.md b/packages/monorepo-1/src/exercises/2024-3-17 copy 2.md new file mode 100644 index 0000000..ea7ce15 --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-17 copy 2.md @@ -0,0 +1,19 @@ +# 2024-3-17 星期天 + +## Second Order Statistics 二阶统计 + +- https://vjudge.net.cn/problem/CodeForces-22A + +![3.17](https://img2.imgtp.com/2024/03/17/LaSSxbaa.png) + +## Rudolf and 121 + +- https://vjudge.net/problem/CodeForces-1941B#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/S8E6WGqL.png) + +## Substring 子串 + +- https://vjudge.net/problem/HDU-6948#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/T7U9iZil.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-17 copy.md b/packages/monorepo-1/src/exercises/2024-3-17 copy.md new file mode 100644 index 0000000..ea7ce15 --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-17 copy.md @@ -0,0 +1,19 @@ +# 2024-3-17 星期天 + +## Second Order Statistics 二阶统计 + +- https://vjudge.net.cn/problem/CodeForces-22A + +![3.17](https://img2.imgtp.com/2024/03/17/LaSSxbaa.png) + +## Rudolf and 121 + +- https://vjudge.net/problem/CodeForces-1941B#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/S8E6WGqL.png) + +## Substring 子串 + +- https://vjudge.net/problem/HDU-6948#author=GPT_zh + +![3.17](https://img2.imgtp.com/2024/03/17/T7U9iZil.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-18 copy 2.md b/packages/monorepo-1/src/exercises/2024-3-18 copy 2.md new file mode 100644 index 0000000..65ee36e --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-18 copy 2.md @@ -0,0 +1,19 @@ +# 2024-3-18 星期一 + +## Reconnaissance + +- https://vjudge.net/problem/CodeForces-32A#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/C50pe4xC.png) + +## Turtle Tenacity: Continual Mods + +- https://codeforces.com/problemset/problem/1933/D + +![3.18](https://img2.imgtp.com/2024/03/18/d0pYCeQ1.png) + +## Obsession with Robots + +- https://vjudge.net/problem/CodeForces-8B#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/dSAW3bt7.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-18 copy.md b/packages/monorepo-1/src/exercises/2024-3-18 copy.md new file mode 100644 index 0000000..65ee36e --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-18 copy.md @@ -0,0 +1,19 @@ +# 2024-3-18 星期一 + +## Reconnaissance + +- https://vjudge.net/problem/CodeForces-32A#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/C50pe4xC.png) + +## Turtle Tenacity: Continual Mods + +- https://codeforces.com/problemset/problem/1933/D + +![3.18](https://img2.imgtp.com/2024/03/18/d0pYCeQ1.png) + +## Obsession with Robots + +- https://vjudge.net/problem/CodeForces-8B#author=GPT_zh + +![3.18](https://img2.imgtp.com/2024/03/18/dSAW3bt7.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-19 copy 2.md b/packages/monorepo-1/src/exercises/2024-3-19 copy 2.md new file mode 100644 index 0000000..78bf1ef --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-19 copy 2.md @@ -0,0 +1,223 @@ +# 2024-3-19 星期二 + +## Borze + +- https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/UOJnR0lA.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_01 { + public static void main(String[] args) { + //https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + //分析:可以从左开始进行判断如果当前是.表示为0,取下一个i++; + //如果是-则接着判断下一个是.还是-对应1,2 + Scanner sc=new Scanner(System.in); + String str=sc.next(); + int[]arr=new int[str.length()];//用来记录对应数字 + int j=0; + for (int i = 0; i < str.length(); ) { + String temp= String.valueOf(str.charAt(i)); + if (temp.equals(".")) {//为0 + arr[j++]=0;i++; + }else if (temp.equals("-")) { + String temp1= String.valueOf(str.charAt(++i)); + if (temp1.equals(".")) { + arr[j++]=1;i++; + }else if (temp1.equals("-")) { + arr[j++]=2;i++; + } + } + } + for (int i = 0; i < j; i++) { + System.out.print(arr[i]+" "); + } + } +} +``` + +## Setting up Camp + +- https://codeforces.com/contest/1945/problem/A + +![3.19](https://img2.imgtp.com/2024/03/19/1J0MqiD5.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_02 { + public static void main(String[] args) { + //https://codeforces.com/contest/1945/problem/A + //分析:1.测试次数,2内向人不用管一人一个帐篷, + //3.外向的人必须要三个人才能住一个帐篷,不够可以借普通人,但如果还是不够返回-1 + // 对于普通人都可以1,2,3,但我们需要最少的帐篷 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(); + while (N-->0){ + int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(); + int sum=a; + sum+=b/3;//记录有多少组内向人(三人一组) + b=b%3;//取余 + if (b!=0) {//还有外向的人 + if (c+b < 3) {//包含外向人的剩余人数小于3人返回-1 + System.out.println(-1);continue; + }else if (c+b>=3) {//说明人数够 + sum+=(c+b)/3; + if ((c+b)%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum);continue; + } + }else {//没有外向人了 + sum+=c/3; + if (c%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum); + } + } + } +} + +``` + +## Lake Counting + +- https://vjudge.net/problem/POJ-2386#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/R7OW1gDB.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_03 { + public static void main(String[] args) { + //https://vjudge.net/problem/POJ-2386#author=GPT_zh + //1.核心判断W的周围是否存在W,对周围的W也这样判断,(分为9种) + //四个角落,四边,中间 + // ,会有重复,不好结束判断,我们可以对已判断的标记。 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(),M=sc.nextInt(); + char[][]filed=new char[N][M]; + for (int i = 0; i < N; i++) { + String line = sc.next(); + filed[i] = line.toCharArray(); + } + sc.close(); + int loopNumber=0; + for (int i = 0; i < N; i++) {//遍历判断当前是否为W + for (int j = 0; j < M; j++) { + if (filed[i][j]=='W') { + aroundIsW(filed,i,j,N,M); + filed[i][j]='w';//标记一下 + loopNumber++;//一个相连的水坑判断完加一 + }//如果不是就不管 + } + } + System.out.println(loopNumber); + } + public static void aroundIsW(char[][]arr,int i,int j,int N,int M){ + if (arr[i][j]=='W') {//只有当前为水坑,才继续判断,否则返回空 + if (i==0) {//在第一排 + if (j==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (j==M-1) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } else if (i==N-1) {//在最后一排 + if (j==0) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }if (j==M-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + } else if (j==0){//在第一列 + if (i==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (i==M-1) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j+1,N,M);//右边 + } else if (j==M-1) {//在最后一列 + if (i==0) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + }if (i==N-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + } else if (i>=1&&j>=1&&i<=N-1&&j<=M-1) {//在中间 + arr[i][j]='w'; + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } + }else return; + + } +} + +``` diff --git a/packages/monorepo-1/src/exercises/2024-3-19 copy.md b/packages/monorepo-1/src/exercises/2024-3-19 copy.md new file mode 100644 index 0000000..78bf1ef --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-19 copy.md @@ -0,0 +1,223 @@ +# 2024-3-19 星期二 + +## Borze + +- https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/UOJnR0lA.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_01 { + public static void main(String[] args) { + //https://vjudge.net/problem/CodeForces-32B#author=GPT_zh + //分析:可以从左开始进行判断如果当前是.表示为0,取下一个i++; + //如果是-则接着判断下一个是.还是-对应1,2 + Scanner sc=new Scanner(System.in); + String str=sc.next(); + int[]arr=new int[str.length()];//用来记录对应数字 + int j=0; + for (int i = 0; i < str.length(); ) { + String temp= String.valueOf(str.charAt(i)); + if (temp.equals(".")) {//为0 + arr[j++]=0;i++; + }else if (temp.equals("-")) { + String temp1= String.valueOf(str.charAt(++i)); + if (temp1.equals(".")) { + arr[j++]=1;i++; + }else if (temp1.equals("-")) { + arr[j++]=2;i++; + } + } + } + for (int i = 0; i < j; i++) { + System.out.print(arr[i]+" "); + } + } +} +``` + +## Setting up Camp + +- https://codeforces.com/contest/1945/problem/A + +![3.19](https://img2.imgtp.com/2024/03/19/1J0MqiD5.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_02 { + public static void main(String[] args) { + //https://codeforces.com/contest/1945/problem/A + //分析:1.测试次数,2内向人不用管一人一个帐篷, + //3.外向的人必须要三个人才能住一个帐篷,不够可以借普通人,但如果还是不够返回-1 + // 对于普通人都可以1,2,3,但我们需要最少的帐篷 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(); + while (N-->0){ + int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(); + int sum=a; + sum+=b/3;//记录有多少组内向人(三人一组) + b=b%3;//取余 + if (b!=0) {//还有外向的人 + if (c+b < 3) {//包含外向人的剩余人数小于3人返回-1 + System.out.println(-1);continue; + }else if (c+b>=3) {//说明人数够 + sum+=(c+b)/3; + if ((c+b)%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum);continue; + } + }else {//没有外向人了 + sum+=c/3; + if (c%3>0) {//有余数,还需要加一 + sum+=1; + } + System.out.println(sum); + } + } + } +} + +``` + +## Lake Counting + +- https://vjudge.net/problem/POJ-2386#author=GPT_zh + +![3.19](https://img2.imgtp.com/2024/03/19/R7OW1gDB.png) + +### 题解 + +```java +import java.util.Scanner; + +public class task3_19_03 { + public static void main(String[] args) { + //https://vjudge.net/problem/POJ-2386#author=GPT_zh + //1.核心判断W的周围是否存在W,对周围的W也这样判断,(分为9种) + //四个角落,四边,中间 + // ,会有重复,不好结束判断,我们可以对已判断的标记。 + Scanner sc=new Scanner(System.in); + int N=sc.nextInt(),M=sc.nextInt(); + char[][]filed=new char[N][M]; + for (int i = 0; i < N; i++) { + String line = sc.next(); + filed[i] = line.toCharArray(); + } + sc.close(); + int loopNumber=0; + for (int i = 0; i < N; i++) {//遍历判断当前是否为W + for (int j = 0; j < M; j++) { + if (filed[i][j]=='W') { + aroundIsW(filed,i,j,N,M); + filed[i][j]='w';//标记一下 + loopNumber++;//一个相连的水坑判断完加一 + }//如果不是就不管 + } + } + System.out.println(loopNumber); + } + public static void aroundIsW(char[][]arr,int i,int j,int N,int M){ + if (arr[i][j]=='W') {//只有当前为水坑,才继续判断,否则返回空 + if (i==0) {//在第一排 + if (j==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (j==M-1) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } else if (i==N-1) {//在最后一排 + if (j==0) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }if (j==M-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + } + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + } else if (j==0){//在第一列 + if (i==0) {//在左上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + return; + }if (i==M-1) {//在左下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j+1,N,M);//右边 + } else if (j==M-1) {//在最后一列 + if (i==0) {//在右上角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + return; + }if (i==N-1) {//在右下角落递归结束条件 + arr[i][j]='w'; + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + return; + }arr[i][j]='w'; + aroundIsW(arr,i-1,j,N,M);//上边 + aroundIsW(arr,i+1,j,N,M);//下边 + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + } else if (i>=1&&j>=1&&i<=N-1&&j<=M-1) {//在中间 + arr[i][j]='w'; + aroundIsW(arr,i-1,j-1,N,M);//左上边 + aroundIsW(arr,i-1,j,N,M);//正上边 + aroundIsW(arr,i-1,j+1,N,M);//右上边 + aroundIsW(arr,i,j-1,N,M);//左边 + aroundIsW(arr,i,j+1,N,M);//右边 + aroundIsW(arr,i+1,j-1,N,M);//左下边 + aroundIsW(arr,i+1,j,N,M);//正下边 + aroundIsW(arr,i+1,j+1,N,M);//右下边 + } + }else return; + + } +} + +``` diff --git a/packages/monorepo-1/src/exercises/2024-3-20 copy 2.md b/packages/monorepo-1/src/exercises/2024-3-20 copy 2.md new file mode 100644 index 0000000..b911cd8 --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-20 copy 2.md @@ -0,0 +1,19 @@ +# 2024-3-20 星期三 + +## Reconnaissance 2 + +- https://vjudge.net/problem/CodeForces-34A#author=GPT_zh + +![3.20](https://img2.imgtp.com/2024/03/20/GWSrUXRt.png) + +## Vlad and Division + +- https://codeforces.com/problemset/problem/1926/D + +![3.20](https://img2.imgtp.com/2024/03/20/0RY8fghL.png) + +## Binary Path + +- https://codeforces.com/problemset/problem/1937/B + +![3.21](https://img2.imgtp.com/2024/03/20/cSk2UHwU.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-20 copy.md b/packages/monorepo-1/src/exercises/2024-3-20 copy.md new file mode 100644 index 0000000..b911cd8 --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-20 copy.md @@ -0,0 +1,19 @@ +# 2024-3-20 星期三 + +## Reconnaissance 2 + +- https://vjudge.net/problem/CodeForces-34A#author=GPT_zh + +![3.20](https://img2.imgtp.com/2024/03/20/GWSrUXRt.png) + +## Vlad and Division + +- https://codeforces.com/problemset/problem/1926/D + +![3.20](https://img2.imgtp.com/2024/03/20/0RY8fghL.png) + +## Binary Path + +- https://codeforces.com/problemset/problem/1937/B + +![3.21](https://img2.imgtp.com/2024/03/20/cSk2UHwU.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-21 copy 2.md b/packages/monorepo-1/src/exercises/2024-3-21 copy 2.md new file mode 100644 index 0000000..30160bb --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-21 copy 2.md @@ -0,0 +1,13 @@ +# 2024-3-21 星期四 + +## Army + +- https://vjudge.net/problem/CodeForces-38A#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/qbxfMlnw.png) + +## Stack of Presents + +- https://vjudge.net/problem/CodeForces-1279C#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/oHVk29uE.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-21 copy.md b/packages/monorepo-1/src/exercises/2024-3-21 copy.md new file mode 100644 index 0000000..30160bb --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-21 copy.md @@ -0,0 +1,13 @@ +# 2024-3-21 星期四 + +## Army + +- https://vjudge.net/problem/CodeForces-38A#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/qbxfMlnw.png) + +## Stack of Presents + +- https://vjudge.net/problem/CodeForces-1279C#author=GPT_zh + +![3.21](https://img2.imgtp.com/2024/03/21/oHVk29uE.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-22 copy 2.md b/packages/monorepo-1/src/exercises/2024-3-22 copy 2.md new file mode 100644 index 0000000..8de0670 --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-22 copy 2.md @@ -0,0 +1,13 @@ +# 2024-3-22 星期五 + +## Translation + +- https://vjudge.net/problem/CodeForces-41A#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/QVHSH6Jy.png) + +## A Game with Traps + +- https://vjudge.net/problem/CodeForces-1260D#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/3moYp7Sh.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-22 copy.md b/packages/monorepo-1/src/exercises/2024-3-22 copy.md new file mode 100644 index 0000000..8de0670 --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-22 copy.md @@ -0,0 +1,13 @@ +# 2024-3-22 星期五 + +## Translation + +- https://vjudge.net/problem/CodeForces-41A#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/QVHSH6Jy.png) + +## A Game with Traps + +- https://vjudge.net/problem/CodeForces-1260D#author=GPT_zh + +![3.22](https://img2.imgtp.com/2024/03/22/3moYp7Sh.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-23 copy 2.md b/packages/monorepo-1/src/exercises/2024-3-23 copy 2.md new file mode 100644 index 0000000..78b970a --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-23 copy 2.md @@ -0,0 +1,13 @@ +# 2024-3-23 星期六 + +## Ball Game + +- https://vjudge.net/problem/CodeForces-46A#author=21016020903 + +![3.23](https://img2.imgtp.com/2024/03/23/aS5lE6JH.png) + +## Red and Black + +- https://vjudge.net/problem/POJ-1979 + +![3.23](https://img2.imgtp.com/2024/03/23/D4gnyXCA.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-23 copy.md b/packages/monorepo-1/src/exercises/2024-3-23 copy.md new file mode 100644 index 0000000..78b970a --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-23 copy.md @@ -0,0 +1,13 @@ +# 2024-3-23 星期六 + +## Ball Game + +- https://vjudge.net/problem/CodeForces-46A#author=21016020903 + +![3.23](https://img2.imgtp.com/2024/03/23/aS5lE6JH.png) + +## Red and Black + +- https://vjudge.net/problem/POJ-1979 + +![3.23](https://img2.imgtp.com/2024/03/23/D4gnyXCA.png) diff --git a/packages/monorepo-1/src/exercises/2024-3-24 copy 2.md b/packages/monorepo-1/src/exercises/2024-3-24 copy 2.md new file mode 100644 index 0000000..4102ab4 --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-24 copy 2.md @@ -0,0 +1,13 @@ +## 2024-3-24 星期日 + +### Digit Product + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) + +### K-hour Clock + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) \ No newline at end of file diff --git a/packages/monorepo-1/src/exercises/2024-3-24 copy.md b/packages/monorepo-1/src/exercises/2024-3-24 copy.md new file mode 100644 index 0000000..4102ab4 --- /dev/null +++ b/packages/monorepo-1/src/exercises/2024-3-24 copy.md @@ -0,0 +1,13 @@ +## 2024-3-24 星期日 + +### Digit Product + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) + +### K-hour Clock + +- https://vjudge.net/problem/ZOJ-4137#author=GPT_zh + +![3.24](https://img2.imgtp.com/2024/03/24/ku4BN2CH.png) \ No newline at end of file diff --git a/packages/monorepo-1/src/exercises/exercises copy 2.md b/packages/monorepo-1/src/exercises/exercises copy 2.md new file mode 100644 index 0000000..7fff357 --- /dev/null +++ b/packages/monorepo-1/src/exercises/exercises copy 2.md @@ -0,0 +1,10 @@ +--- +# 期望该页面在顺序内 排布到侧边栏的第一位 +order: 1 +dir: + - order: 1 +--- + +# 习题集 + +这里是我们日常训练习题集。 diff --git a/packages/monorepo-1/src/exercises/exercises copy.md b/packages/monorepo-1/src/exercises/exercises copy.md new file mode 100644 index 0000000..7fff357 --- /dev/null +++ b/packages/monorepo-1/src/exercises/exercises copy.md @@ -0,0 +1,10 @@ +--- +# 期望该页面在顺序内 排布到侧边栏的第一位 +order: 1 +dir: + - order: 1 +--- + +# 习题集 + +这里是我们日常训练习题集。