-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
1,800 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ export default hopeTheme({ | |
navbar, | ||
|
||
// 侧边栏 | ||
sidebar, | ||
sidebar: "structure", | ||
|
||
// 页脚 | ||
footer: "默认页脚", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
} | ||
} | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
Oops, something went wrong.