摘要: 上代码 #include<iostream> using namespace std; int main(){ int a,b,c,d,e; int count=0; cin>>a>>b; c=a&b; d=a|b; e=c^d; while(e!=0){ e=((e-1)&e); count++; 阅读全文
posted @ 2024-06-04 12:20 pengfu_xin 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 睿抗2023本科组第三题 #include<bits/stdc++.h> using namespace std; //声明全局变量 int n,k[6],level1,level2,t[6],f[32],r[32]; //函数get_level:根据五个骰子的点数,返回当前获胜等级 int get 阅读全文
posted @ 2024-05-31 20:35 pengfu_xin 阅读(30) 评论(0) 推荐(0) 编辑
摘要: 2024.5.8 今天写了洛谷 P1003 [NOIP2011 提高组] 铺地毯 关于这题,a56爆大奖在线娱乐有感悟: 先呈上a56爆大奖在线娱乐学习的第一篇代码: #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) 编辑
摘要: 今天了解了一下记忆化搜索,作为a56爆大奖在线娱乐dp,a56爆大奖在线娱乐难以理解 #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:46 pengfu_xin 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 2024.5.5 在C++编程中,DFS(深度优先搜索,Depth-First Search)和DP(动态规划,Dynamic Programming)是两种完全不同的算法和技术,它们用于解决不同类型的问题。 DFS(深度优先搜索) DFS是a56爆大奖在线娱乐用于遍历或搜索树或图的算法。这种算法会尽可能深地搜索树 阅读全文
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:25 pengfu_xin 阅读(5) 评论(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 阅读(2) 评论(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:08 pengfu_xin 阅读(5) 评论(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) 编辑