摘要: int read() { int res = 0; char c = getchar(); while(!isdigit(c)) c = getchar(); while(isdigit(c)) res = (res << 1) + (res << 3) + c - 48, c = getchar( 阅读全文
posted @ 2021-08-28 11:25 废柴废柴少女 阅读(24) 评论(0) 推荐(0)
摘要: int main() { ll l,r; ll n,sum=0; scanf("%lld",&n); //左端点l,右端点r; for(l=1,r=0;l<n;l=r+1) { r=n/(n/l); sum+=(r-l+1)*(n/l); } printf("%lld\n",sum); } 阅读全文
posted @ 2021-08-25 18:42 废柴废柴少女 阅读(23) 评论(0) 推荐(0)
摘要: #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> #include <string> #include <stack> #include <queue> #in 阅读全文
posted @ 2021-08-25 16:12 废柴废柴少女 阅读(31) 评论(0) 推荐(0)
摘要: 题目:https://acm.hdu.edu.cn/showproblem.php?pid=6438 假如ai<a(i+1),而且a(i+1)<a(i+2) 如果我们在i买入,在i+1卖出,在i+1买入,在i+2卖出,得到的收益是-pi+p(i+1)-p(i+1)+p(i+1) 如果我们在i买入,在 阅读全文
posted @ 2021-08-25 15:33 废柴废柴少女 阅读(34) 评论(0) 推荐(0)
摘要: #include<stdio.h> const int maxn=1e3+100; int a[maxn][maxn]; void dfs(int x) { if(x==1024) return; for(int i=1;i<=x;i++) { for(int j=x+1;j<=x*2;j++) a 阅读全文
posted @ 2021-08-24 09:10 废柴废柴少女 阅读(51) 评论(0) 推荐(0)
摘要: 离线思想(把指令存起来后从后往前遍历) #include<stdio.h> const int maxn=1e5+7; int a[maxn]; int p[maxn]; int v[maxn]; int main() { int n,m; scanf("%d%d",&n,&m); for(int 阅读全文
posted @ 2021-08-23 20:45 废柴废柴少女 阅读(25) 评论(0) 推荐(0)
摘要: 要用long long 输入 题目中这个If the value of the expression is 0 when C=0, please print 1.的意思是如果a&b==0了的时候输出1 其他的都是输出(a&b) 0 1 0 1 0 1 1 0 只用管两者都是1的时候让c的那一位为1 阅读全文
posted @ 2021-08-23 19:09 废柴废柴少女 阅读(55) 评论(0) 推荐(0)
摘要: 题目:https://acm.hdu.edu.cn/showproblem.php?pid=6892根据sg定理,只需要求出每个数的sg[x];对于一个数x,如果是1是必败,sg[1]=0;如果是质数,那么必胜,sg[质数]=1;其他的则将x分解成若干对非1因数(p1,q1,p2,q2,p3,q3. 阅读全文
posted @ 2021-08-23 16:40 废柴废柴少女 阅读(33) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/problem/21467 题目描述 在网友的国度中共有n种不同面额的货币,第i种货币的面额为a[i],你可以假设每一种货币都有无穷多张。为了方便,我们把货币种数为n、面额数组为a[1..n]的货币系统记作(n,a)。 在一个完善的货币系 阅读全文
posted @ 2021-08-18 20:09 废柴废柴少女 阅读(66) 评论(0) 推荐(0)
摘要: 链接:https://ac.nowcoder.com/acm/problem/19990 里面写着在每首歌开始之前他想要改变的音量是多少。每一次改变音量,他可以选择调高也可以调低。 音量用一个整数描述。输入文件中给定整数beginLevel,代表吉他刚开始的音量,以及整数maxLevel,代表吉他的 阅读全文
posted @ 2021-08-18 19:37 废柴废柴少女 阅读(261) 评论(0) 推荐(0)