随笔分类 - 模拟
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 模拟题.知道哪个人是旁观者就好 【代码】 cpp / 1.Shoud it use long long ? 2.Have you ever test several sample(at least therr) yourself
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 模拟就好 【代码】 cpp / 1.Shoud it use long long ? 2.Have you ever test several sample(at least therr) yourself? 3.Can you
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 递归题 【代码】 cpp include using namespace std; const int N = 300; string s1, s2; int n, idx; int g[N][2]; int dfs(int l
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 dfs模拟一下就好。 先预处理一个dfs. 搞出来x叶子节点它的值是什么 【代码】 cpp / 1.Shoud it use long long ? 2.Have you ever test several sample(at
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 括号匹配。 栈模拟就好。 多种括号也是一样可以做的。 【代码】 cpp include using namespace std; const int N = 150; stack sta; string s; int main(
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 记录每个物品它的依赖有哪些,以及它被哪些东西依赖就可以了。 显式安装的东西不能被隐式删除删掉(就是remove item,然后删除item的依赖的过程叫隐式删除,而删除item本身叫显式删除); 而只能被显式删除。 隐式安装的依
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 倒着来,维护一个最小的点就可以了。 【代码】 cpp include using namespace std; const int N = 1e6; int a[N+10],n; int isdead[N+10]; int ma
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 贪心选容量大的瓶子就好 【代码】 cpp include define int long long using namespace std; const int N = 1e5; int n; int a[N+10],b[N+1
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 模拟+递归 【代码】 cpp include using namespace std; const int N = 200; string s[N+10]; int n; bool is(char key){ if (key!=
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 看看时间戳为i的点有哪些。 每次优先用已经访问过的点。 如果不行就新创一个点。 注意新创点的时间戳也是i. 【代码】 cpp include using namespace std; const int N = 2e5; int
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 傻逼模拟 【代码】 cpp include using namespace std; const int N = 2e5; int n; int a[N+100]; int main(){ ifdef LOCAL_DEFINE
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 三重循环 【代码】 cpp include using namespace std; int a[10]; int main(){ ifdef LOCAL_DEFINE freopen("F:\\c++source\\rush_
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 位置其实都没关系了。 只要每个字母都有对应的字母,它们的数量相同就可以了。 求出每种字母的数量。 排序之后。 肯定是要一一对应的。 【代码】 cpp include using namespace std; string s1,
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 相当于让你判断s1是不是s2的子序列。 for一遍就好 【代码】 cpp include using namespace std; string s1,s2; int main(){ ifdef LOCAL_DEFINE fre
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 模拟一下就好 一位一位地往右移动。 【代码】 cpp include using namespace std; const int N = 300; int a[N+10]; int b[N+10]; string s1,s2;
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 水模拟 【代码】
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 余数出现循环节。 就代表出现了循环小数。 【代码】
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 枚举每一位字母是什么。 从小到大枚举。 然后计算每一位的总贡献是多少。 取最小的那个输出。 【代码】 cpp include using namespace std; const int M = 50; const int N
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 给你一个规则,让你知道第i根萝卜的高度为si = A+(i 1) B 现在给你n个询问; 每次询问给你一个固定的起点l; 让你找一个最大的右端点r; 使得l..r这一段能够在t次"m吃操作"内被吃完. 【题解】 如果l..r里面的最大值大于t了;则无解
阅读全文
摘要:【链接】 "我是链接,点我呀:)" 【题意】 在这里输入题意 【题解】 每次取出最小的数字,在后面加上一个4或一个7就好; 会发现最后的数字很少的。 【代码】 cpp include using namespace std; define ll long long priority_queue ,g
阅读全文

浙公网安备 33010602011771号