自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(20)
  • 收藏
  • 关注

原创 HDU - 1285 -确定比赛名次【拓扑排序】

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1285#include<bits/stdc++.h>using namespace std;const int maxn = 515;int mp[maxn][maxn];int _in[maxn];int ans[maxn];int N, M;void init(){...

2018-07-30 11:11:01 134

原创 LOJ - #6284. 数列分块入门 8

题目链接:https://ajax.loj.ac/problem/6284#include<bits/stdc++.h>using namespace std;const int maxn = 1e5+5;int a[maxn], pos[maxn], blo, n, tag[maxn], l, r, c;void reset(int x){ if(tag[x]...

2018-07-30 10:05:15 219

原创 LOJ - #6283. 数列分块入门 7

题目链接: https://ajax.loj.ac/problem/6283#include<bits/stdc++.h>#define ll long long#define mod 10007using namespace std;const int maxn = 1e5 + 5;int blo, opt, l, r, c, n, m;int pos[maxn],...

2018-07-26 15:52:37 205

原创 LOJ - #6282. 数列分块入门 6

题目链接:https://ajax.loj.ac/problem/6282#include<bits/stdc++.h>#define ll long longusing namespace std;const int maxn = 1e5 + 5;int blo, opt, l, r, c, n, m;int pos[maxn], a[maxn], st[maxn*2...

2018-07-26 10:36:42 218

原创 LOJ-#6281. 数列分块入门 5

题目链接:https://ajax.loj.ac/problem/6281#include<bits/stdc++.h>#define ll long longusing namespace std;const int maxn = 5e4 + 5;int blo, opt, l, r, c, a[maxn], flag[maxn], pos[maxn], n, sum[...

2018-07-26 09:10:19 192

原创 LOJ - #6280. 数列分块入门 4

题目链接:https://loj.ac/problem/6280#include<bits/stdc++.h>#define ll long longusing namespace std;const int maxn = 5e4 + 5;int blo, n, opt, l, r, c, pos[maxn];ll atag[maxn], sum[maxn], a[ma...

2018-07-25 17:41:21 223

原创 LOJ - #6279. 数列分块入门 3

题目链接:#6279. 数列分块入门 3#include<bits/stdc++.h>using namespace std;const int maxn = 1e5 + 5;int blo, n, opt, l, r, c, a[maxn], pos[maxn], atag[maxn];set<int>st[maxn];int add(int l, int...

2018-07-25 17:12:37 243

原创 LOJ - #6278. 数列分块入门 2

输出格式对于每次询问,输出一行一个数字表示答案。样例样例输入41 2 2 30 1 3 11 1 3 21 1 4 11 2 3 2样例输出302#include<bits/stdc++.h>using namespace std;const int maxn = 5e4 + 5;int blo, n, opt, l, r,...

2018-07-25 11:02:14 306

原创 LOJ - #6277数列分块入门 1

输出格式对于每次询问,输出一行一个数字表示答案。样例样例输入41 2 2 30 1 3 11 0 1 00 1 2 21 0 2 0样例输出25#include<bits/stdc++.h>using namespace std;const int maxn = 5e4 + 5;int blo, n, opt, l, r, c...

2018-07-25 10:11:31 179

原创 牛客小白月赛5 - G - 异或(xor)【找规律】

链接:https://www.nowcoder.com/acm/contest/135/G  从前,Apojacsleam家的水族箱里,养了一群热带鱼。    在这几条热带鱼里,Apojacsleam特别喜欢一条叫做TbGx(请勿人肉)的热带鱼,所以每次都让她第一个吃食物。对于每一条鱼,Apojacsleam都有一个顺序,鱼会按照这个顺序排序,越靠前的地位越高。   吃饱喝足是要睡觉的...

2018-07-24 16:39:45 395

原创 牛客小白月赛5 -I- 区间 (interval)【差分数组】

链接:https://www.nowcoder.com/acm/contest/135/I来源:牛客网Apojacsleam喜欢数组。    他现在有一个n个元素的数组a,而他要对a[L]-a[R]进行M次操作:        操作一:将a[L]-a[R]内的元素都加上P        操作二:将a[L]-a[R]内的元素都减去P    最后询问a[l]-a[r]内的元素之和?...

2018-07-24 15:52:44 148

原创 牛客小白月赛5 - j - 时间time

链接:https://www.nowcoder.com/acm/contest/135/J来源:牛客网  Apojacsleam是一个喜欢特殊时刻的人。        他定义了一个时刻,若电子表显示ab:ba(24小时制),则该时刻为“回文时刻”(可以有前导零)。例如00:00就是回文时刻。        给定一个时刻,求此时刻的上一个和下一个回文时刻。J题附加:00:00就是...

2018-07-24 09:50:27 147

原创 CodeForces - 890A - ACM ICPC【水题】

#include<iostream>#include<cstdio>using namespace std;int main(){ int a[6], ans = 0; for (int i = 0; i < 6; i++){ cin >> a[i]; ans += a[i]; } ...

2018-07-21 23:35:10 136

原创 HDU - 1061 - 快速幂

#include<bits/stdc++.h>using namespace std;const int Mod = 1e5;int pow_mod(long long a, long long n, int m){ long long ans = 1; while(n){ if(n & 1){ ans = (ans * a) %...

2018-07-21 09:13:38 245

原创 快速幂【模板】

O(logn):#include<bits/stdc++.h>using namespace std;int pow_mod(int a, int n, int m){ if(n == 0) return 1; int x = pow_mod(a, n/2, m); long long ans = (long long)x * x % m; ...

2018-07-20 16:50:39 8678 1

原创 HDU - 5832 -A water problem【大数取模】

题解:因为137*73=10001,则将值对10001取模。#include<iostream>#include<cstring>#include<cstdio>#define mod 10001using namespace std;const int maxn = 1e7 + 5;char a[maxn];int main(){ ...

2018-07-20 16:03:59 151

原创 Codeforces - 1005D - Polycarp and Div 3【同余】

题意:只包含数字的字符串,将其划分成多个部分使其能被3整除的部分最多。题解:当一个数为3的倍数,那么该数各个位之和能被3整除;eg:  数 XYZ****;1.如果 X 能被3整除 则 ans++, 取第一个数 即 X | YZ****;2.如果 X 不能被3整除 ,但 X+ Y 能被3 整除 取前两个数 则 ans ++ ,即 XY |  Z****;3.如果 X 不能被3 ...

2018-07-20 10:23:11 237

原创 Codeforces - 1005C - Summarize to the Power of Two【map】

题意:给你一个序列,对于序列中的元素 i 如果存在 j 满足i + j (i ≠  j)的值为2的幂则保留,否则将其删除;输出需要删除的个数。#include<bits/stdc++.h>using namespace std;const int maxn = 122222;map<int,int>mp;int a[maxn];int main(){ ...

2018-07-20 08:43:09 170

原创 codeforces - 1005B - Delete from the Left【模拟】

题意:两个字符串,输出需要删除多少个字符使两个字符串相等,只能从当前左的字符开始删除;题解:计算两个字符串从右往左有多少个字符相等,不相等的字符为需要删除;#include <bits/stdc++.h>using namespace std;const int maxn = 222222;char a[maxn], b[maxn];int main(){ scanf...

2018-07-11 11:25:51 182

原创 Codeforces - 1005A - Tanya and Stairways【模拟】

题意:Tanya爬楼梯,每爬一层楼就会说出这一层楼梯的编号;例如她爬上两层楼,其中第一个楼包含3个楼梯3,第二个包含44个,她说出的数字为1 ,2 ,3 ,1 ,2 ,3 ,4,输出Tanya爬了几层楼,每一层楼有多少楼梯。 题解:用Vector存储每一层楼的楼梯数;#include <bits/stdc++.h>using namespace std;vector ...

2018-07-11 11:11:10 408

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除