跳到正文

GZH0207

755146

在洛谷打开
资料、奖项与版本

资料

编号
755146
抓取

你谷游戏

博客

某编程网站 某编程网站2

文章生成器

蒟蒻练习情况

快读

C++
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}

快写

C++
   ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

蒟蒻的板子

C++
#pragma GCC optimize(1)
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize(4)
#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<string>
#include<cstring>
#include<queue>
#include<cmath>
#include<set>
#define int long long
#define F(i,j,k) for(int i=j;i<=k;i++)
#define dF(i,j,k) for(int i=j;i>=k;i--)
#define re(x) x=read() 
using namespace std;
const int N=100005;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}
signed main()
{
	ios::sync_with_stdio(0);
    cout.tie(0);
	return 0;
} 


_ 邮箱 gzh33100207@outlook.com _

K+O+Be+He+Li+Co+Pt+Er= HeLiCoPter↓ +KOBe↑

共 2 篇
  1. 个人记录

    分组背包

    该代码实现了一个分组背包问题的动态规划解法。其核心思想是将物品按组分类,对每组进行一次01背包处理。通过定义f[j]数组记录最大价值,外层循环遍历组别(1到100),内层循环从大到小遍历背包容量(m到0),对每组中的每个物品执行状态转移:若当前容量j大于等于物品体积v,则更新f[j] = max(f[j], f[j-v] + w)。最终输出f[m]即为容量为m时的最大价值。

  2. 个人记录

    数据结构—队列和栈

    栈(stack) 特点 栈的修改与访问是按照后进先出的原则进行的,因此栈通常被称为是后进先出 基本操作(include stack) 1.定义stack stack st; 2.stack压入num st.push(num); 3.栈顶元素 st.top(); 4.栈元素数量 s…