该文被密码保护。 阅读全文
摘要:
[CSP-J 2022] 解密 题目描述 给定一个正整数 \(k\),有 \(k\) 次询问,每次给定三个正整数 \(n_i, e_i, d_i\),求两个正整数 \(p_i, q_i\),使 \(n_i = p_i \times q_i\)、\(e_i \times d_i = (p_i - 1) 阅读全文
摘要:
https://www.luogu.com.cn/problem/P10765 题目描述 本题采用多组数据测试。 现在欣欣有一个从 \(1\) 到 \(n\) 的序列,并想对这个序列进行如下两种操作。 操作一:删去所有的奇数项。 操作二:删去所有的偶数项。 欣欣发现她在进行 \(k\) 次操作后,最 阅读全文
摘要:
dfs版本 #include <algorithm> #include <iostream> using namespace std; const int N = 2e1; int cat[N], cab[N]; int n, w; int ans; bool cmp(int a, int b) { 阅读全文
摘要:
题面翻译 给定非负整数 \(a\),\(b\),\(C\),判断是否存在一对二元组 \((x,y)\) 满足以下条件: \(0<x<2^{60}\) \(0<y<2^{60}\) \(\operatorname{popcount}(x)=a\) \(\operatorname{popcount}(y 阅读全文
摘要:
分情况讨论找规律 #include<bitsstdc++.h> #define ll long long #define maxn 1000005 using namespace std; struct nod{ int l,r,v; nod(){} nod(int a,int b,int c) { 阅读全文
摘要:
#include<bitsstdc++.h> #define ll long long #define N 100005 #define mod 998244353 using namespace std; ll sum_b[N], sum_p[N], p[N], a[N], sum; void f 阅读全文
摘要:
macOS下使用bits/stdc++.h万能头文件 1. 终端中输入 echo | g++ -v -x c++ -E - #include <...> search starts here: /usr/local/include /Library/Developer/CommandLineTool 阅读全文
摘要:
廊桥分配 1.错误想法:让当前飞机停到右端点最小的廊桥,但是当两个区间右端点都小于当前飞机左端点,选择最小的么? 显然不是,应该选择序号最小的廊桥,这样不影响下一个飞机继续放置(左端点从小打到排序的)。这样,当只能有i个廊桥(枚举国内廊桥)的时候,也是可以取得最大值的。最后前缀和。错误代码附后。 2 阅读全文
摘要:
1.斐波那契数列,变量版,变量覆盖 a = 1, b = 1; for(int i = 1; i <=n; i++){ cout<<a+b<<” ” a = b; b = c } 2.进击的奶牛前置版:变量覆盖 cnt=1;pre=a[1]; for(int i=2;i<=n;i++){ if(a[ 阅读全文