摘要: 2024.5.8 今天写了洛谷 P1003 [NOIP2011 提高组] 铺地毯 关于这题,我有感悟: 先呈上我学习的第一篇代码: #include<iostream> using namespace std; int main(){ int n=0; long long arr[10001][10 阅读全文
posted @ 2024-05-08 21:10 pengfu_xin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 今天了解了一下记忆化搜索,作为一种dp,我难以理解 #include<iostream> #include<cstdio> using namespace std; long long dp[22][22][22]; long long w(long long a,long long b,long 阅读全文
posted @ 2024-05-07 22:47 pengfu_xin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 2024.5.5 在C++编程中,DFS(深度优先搜索,Depth-First Search)和DP(动态规划,Dynamic Programming)是两种完全不同的算法和技术,它们用于解决不同类型的问题。 DFS(深度优先搜索) DFS是一种用于遍历或搜索树或图的算法。这种算法会尽可能深地搜索树 阅读全文
posted @ 2024-05-05 22:32 pengfu_xin 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 2024/4/21 #include<stdio.h> void f(double a,double b,double c,double *max){ *max=a; int arr[3]={a,b,c}; for(int i=0;i<3;i++){ if(*max<arr[i]) *max=arr 阅读全文
posted @ 2024-04-21 13:26 pengfu_xin 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 2024.4.19 #include<stdio.h> void dot(int arr[6][6],int *num,int *row,int *col){ int c=0; int c_1=0; for(int i=1;i<=5;i++){ for(int j=1;j<=5;j++){ for( 阅读全文
posted @ 2024-04-19 21:21 pengfu_xin 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 2024.4.17 #include<stdio.h> void f(int num,double *arr,double *ave,double *dif){ double max=arr[0]; double min=arr[0]; int MAX_SIZE=0; int MIN_SIZE=0; 阅读全文
posted @ 2024-04-17 22:09 pengfu_xin 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 2024.4.15 #include<stdio.h> void f(int arr[][5], int num_1, int num_2) { for (int j = 0; j < 5; j++) { int temp = arr[num_1 - 1][j]; arr[num_1 - 1][j] 阅读全文
posted @ 2024-04-15 21:42 pengfu_xin 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 2024.4.14 洛谷B2074 计算星期几 void f(int *num,int power,int *ans){ *num=*num%7; for(int i=1;i<=power;i++){ (*ans)*=(*num); (*ans)%=7; } } int main(){ int nu 阅读全文
posted @ 2024-04-14 12:57 pengfu_xin 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 2024.4.13 #include<stdio.h> void f(int num,int *num_1){ int a,b,c,d; int num_3; for(int i=0;i<num;i++){ scanf("%d",&num_3); a=num_3/1000%10; b=num_3/1 阅读全文
posted @ 2024-04-13 22:39 pengfu_xin 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 2024.4.12 这两天写了一个洛谷题——P2141 [NOIP2014 普及组] 珠心算测验 我写的题解是这样的 #include<stdio.h> void f(int *num){ scanf("%d",num); int a[110]; int b[110]; for(int i=0;i< 阅读全文
posted @ 2024-04-12 19:24 pengfu_xin 阅读(2) 评论(0) 推荐(0) 编辑