构造
阿晴0917
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Codeforces1313B.Different Rules 构造1700
#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1e5+5;#define IO ios::sync_with_stdio(false);cin.tie(0);ll n,t,x,y;int main(){ cin>>t; while(t--){ ...原创 2020-03-01 10:25:07 · 164 阅读 · 0 评论 -
Codeforces1293C 模拟构造 类似dfs
2*n的迷宫,从(1,1)出发到(2,n),初始时全部的都是地面,每次询问会把一个地面给变成熔浆,熔浆变成地面,熔浆不能通过,问是否可以走到。每次变成熔浆的话只会对这个点对面的相邻的三个点,所以每次查询只需要判断是否对面的相邻的三个点是否都是地面就行。#include<bits/stdc++.h>using namespace std;const int maxn=1e5+5...原创 2020-01-27 13:58:47 · 195 阅读 · 0 评论 -
西电新生赛 循环码 构造
#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1e6+5;const ll mod=1e9+7;const int INF=0x3f3f3f3f;#define IO ios::sync_with_stdio(false);cin.tie(0);ll T;l...原创 2019-12-02 22:01:50 · 165 阅读 · 0 评论 -
西电新生赛 逆元 1e18 n个q
十进制 10^n-1=n个9 *9的逆元 n个1 *q %mod#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=1e6+5;const int mod=1e9+7;const int INF=0x3f3f3f3f;ll T;ll n,m,minn,max...原创 2019-12-02 21:07:57 · 148 阅读 · 0 评论 -
Codeforces1255B 成环特判 C构造
https://codeforces.com/contest/1255/standings/friends/true#include<bits/stdc++.h>using namespace std;typedef long long ll;const int maxn=6e5+5;const ll mod=1e9+7;#define IO ios::sync_with_...原创 2019-11-20 09:12:36 · 162 阅读 · 0 评论 -
Codeforces1208C 分块螺旋构造
0 1 2 3 16 17 18 197 6 5 4 23 22 21 208 9 10 11 24 25 26 2715 14 13 12 31 30 29 2832 33 34 35 48 49 50 5139 38 37 36 55 54 53 5240 41 42 43 56 57 58 5947 46 45 44 63 62 61 60分块数nn/16=4 开根2行2列分...原创 2020-02-04 11:38:33 · 123 阅读 · 0 评论 -
Codeforces1245B 字符串构造
R->S P->R S->PBob 次数A B Cw=min(A,b)+min(B,c)+min(C,a)w2<n 不行直接遍历Bob 只要Alice有能攻击它的就构造序列不够的空上 绝对w2>=n 就剩余谁多随便填了#include<bits/stdc++.h>using namespace std;const int maxn=1e6+...原创 2019-11-02 14:47:40 · 214 阅读 · 0 评论 -
Codeforces1215B 区间积 为负正数的个数 C构造 D博弈
https://codeforc.es/contest/1215/problem/Bll 乘积#include<bits/stdc++.h>using namespace std;#define pb push_back#define mp make_pair#define rep(i,a,n) for(int i=a;i<=n;i++) typedef long ...原创 2019-09-17 20:39:13 · 258 阅读 · 0 评论 -
Codeforces1088 C. Ehab and a 2-operation task 构造递增
Chttps://codeforces.com/contest/1088/problem/Cint n,m,k,T,minn=INF,maxx,cnt,sum,tmp,f=0,ans,f1;set<int> s;int a[maxn];int main(){ cin>>n; rep(i,1,n){ cin>>a[i]; a[i]+=4001...原创 2019-09-11 12:15:11 · 202 阅读 · 0 评论 -
Codeforces1095D 构造
https://codeforces.com/contest/1095/problem/Dll n,m,q,cnt,f,res,cnt1;ll cha;string s;ll a[maxn],b[maxn];int vis[maxn];pii p[maxn];bool check(int now,int f,int s){ if(vis[f]) return false; ...原创 2019-08-19 15:33:08 · 244 阅读 · 0 评论 -
Codeforces Round #547 (Div. 3)C 构造序列
构造长度为n(2e5)序列 给n-1个数 代表相邻位置的差值能否构成1-n的序列 即1-n范围各出现1次如果不能 输出-1#include<iostream>#include<cstdio>#include<vector>#include<set>#include<map>#include<queue>#in...原创 2019-03-31 09:30:04 · 155 阅读 · 0 评论 -
Codeforces1150C 构造尽可能多的素数前缀和
https://codeforces.com/contest/1150/problem/C2 1 2 2 2 2 2 2 1 1 1 1 1会发现第一个是2质数第二前缀和是32 3 5 7 9 11 13 15 16 17 18 19 20为什么呢??2和从3开始 到n的前缀和奇+偶=奇得到第一个3一直+2 对应值2的前缀和为奇数到的1范围后 偶 奇 偶 奇交替构造尽可能多的从3...原创 2019-04-30 12:50:19 · 292 阅读 · 0 评论 -
Codeforces 1180B. Nick and Array C. 构造pair D.构造随机坐标
https://codeforces.com/contest/1180/problem/B任何数变2次 又变成本身a[i]=-a[i]-1>=0的数变负数,绝对值变大 n为偶数个 直接输出n为奇数个 找出绝对值最大的负数 即最小值的位置 将它一个变成正数剩下偶数个正数#include<bits/stdc++.h>using namespace std;const...原创 2019-07-30 16:33:30 · 284 阅读 · 0 评论 -
Codeforces1174B分类讨论 C素数打表
https://codeforces.com/contest/1174/problem/B#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int,int> pii; //1e9typedef pair<ll,ll> pll;const int m...原创 2019-08-04 17:04:28 · 257 阅读 · 0 评论 -
Codeforces1169B 构造
https://codeforces.com/contest/1169/problem/B#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int,int> pii; //1e9typedef pair<ll,ll> pll;const int m...原创 2019-08-06 18:05:23 · 340 阅读 · 0 评论 -
Codeforces1202A D构造
a+b左移 使得和字典序最小 lena>lenb尽量让b为1的位置 消掉a中从对应位置开始 较低位的1#include<bits/stdc++.h>using namespace std;typedef long long ll;typedef pair<int,int> pii; //1e9typedef pair<ll,ll> pll;c...原创 2019-08-09 13:49:10 · 205 阅读 · 0 评论 -
Codeforcs1167B 交互 C并查集 D括号层数红黑分
https://codeforces.com/contest/1167/problem/B交互题技巧,cin,cout可以自动刷新,而scanf,printf则需要手动用fflush(stdout)来刷新根据观察我们可以发现,这六个数两两乘积不相等,所以a1a2 a2a3这样的解是唯一的,并且只有六个数,我们用next_permatation全排列函数可以得到结果#include<bi...原创 2019-08-07 16:18:20 · 144 阅读 · 0 评论 -
Codeforces1003B.Binary String Constructing(构造) 1300
#include<iostream>#include<cstdio>#include<algorithm>#include<string>#include<cstring>#include<vector>#include<set>#include<map>#includ原创 2019-02-18 23:26:51 · 187 阅读 · 0 评论
分享