摘要: ~~包括IQEQ~~ IQ:112 [link](https://international-iq-test.com/zh-Hans/64bfca46-f0bc-4193-8bc9-4a0595ca4579) EQ:140 二分法 MBTI:INTJ-A [link](https://www.16p 阅读全文
posted @ 2023-08-09 18:39 扶桃o 阅读(328) 评论(0) 推荐(0)
摘要: P1833 樱花 题解 # 二进制拆分 做法:把每一个物品根据2的多少次方拆分,因为任何数都可以转化为二进制数 核心思想:把每一个物品拆成很多个,分别计算价值和所需时间,再转化为01背包求解 最后一点:完全背包可以把他的空间记为999999,不要太大,一般百万就足够了 还有一点:cin和scanf**不可以混用** # 代 阅读全文
posted @ 2023-07-22 19:28 扶桃o 阅读(29) 评论(0) 推荐(0)
摘要: ## 思路 分组背包模版题,不多说。 # 代码 ```cpp #include #define ll long long #define ld long double using namespace std; inline void read(int &x) { x=0; short flag=1; 阅读全文
posted @ 2023-07-22 19:18 扶桃o 阅读(7) 评论(0) 推荐(0)
摘要: ## 思路 先枚举出 $n$以内的4次方数 然后dp. # 代码 ```cpp #include #define ll long long #define ld long double #define min(x,y) (x'9') { if(c=='-')flag=-1; c=getchar(); 阅读全文
posted @ 2023-07-22 19:16 扶桃o 阅读(49) 评论(0) 推荐(0)
摘要: ## 思路 这道题和 [NOIP2005 普及组] 采药的思路差不多 不同的是,这道题是完全背包,采药则是01背包。 转移方程为:```dp[j]=max(dp[j],dp[j-w[i]]+v[i]);//滚动数组优化``` # 代码 ```cpp #include #define ll long 阅读全文
posted @ 2023-07-22 19:11 扶桃o 阅读(13) 评论(0) 推荐(0)
摘要: ## 思路 01背包模版题 转移方程为:```dp[j]=max(dp[j],dp[j-ti]+wi);//滚动数组优化``` # 代码 ```cpp #include #define ll long long #define ld long double using namespace std; 阅读全文
posted @ 2023-07-22 14:00 扶桃o 阅读(12) 评论(0) 推荐(0)
摘要: ## 思路 ### 01背包模版题,唯一不同的是加了一个条件就是价格与重要度的乘积。 转移方程为:```dp[j]=max(dp[j],dp[j-w[i]]+w[i]*v[i]);``` 这里加了滚动数组优化。 ## 代码 ```cpp #include #define ll long long # 阅读全文
posted @ 2023-07-22 13:55 扶桃o 阅读(36) 评论(0) 推荐(0)
摘要: # 考试之前一定要拜月,增加RP # 月亮好闪,拜谢月亮 ##### (~~我是六年级捏~~ ## 语文 93 炸了 四科最低 作文留了一小时 没想到阅读读假了 **寄** 班级 **rank** 6 级部 **rank** 6 ## 数学 99 差点AK 做完选择题睡一觉 然后把应用题做完 后来发 阅读全文
posted @ 2023-07-09 19:41 扶桃o 阅读(27) 评论(0) 推荐(0)
摘要: 比较简单,先转成$int$类型,再%2判断奇偶 代码: ```cpp #include using namespace std; int main() { char x; cin>>x; int a=x; if(a%2==0) { printf("NO"); } else printf("YES") 阅读全文
posted @ 2023-07-09 19:37 扶桃o 阅读(61) 评论(0) 推荐(0)
摘要: [题目传送门](https://www.luogu.com.cn/problem/P8680) ## 思路与分析 这是一道简单的枚举题,从 $1$ 到 $n$ 依次将数位拆开判断即可。 ## 代码 ```cpp #include using namespace std; bool check(int 阅读全文
posted @ 2023-07-09 19:35 扶桃o 阅读(26) 评论(0) 推荐(0)