
构造
invoKer-
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
CodeForces - 27C Unordered Subsequence【水题】【构造】
题目链接:https://codeforces.com/contest/27/problem/C #include <iostream> using namespace std; static const int MAXN=1e5+10; int n; int a[MAXN]; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) scanf("%d",&a[i]); if(n>=原创 2020-11-09 18:21:00 · 151 阅读 · 0 评论 -
CodeForces - 26C Parquet【构造】
题目链接:https://codeforces.com/contest/26/problem/C #include <iostream> #include <cctype> using namespace std; static const int MAXN=100+10; char g[MAXN][MAXN]; int n,m,a,b,c; int main() { scanf("%d%d%d%d%d",&n,&m,&a,&b,&c)原创 2020-11-07 22:00:04 · 225 阅读 · 0 评论 -
CodeForces - 23C Oranges and Apples【构造】
题目链接:https://codeforces.com/contest/23/problem/C 奇妙的构造,不过2500似乎是有点高了 #include <iostream> #include <algorithm> using namespace std; static const int MAXN=1e5+10; inline int read(){ int s=0,w=1; char ch=getchar(); while(ch<'0'||ch>'9'){if(c原创 2020-10-29 17:46:47 · 142 阅读 · 0 评论 -
CodeForces - 23B Party【构造】
题目链接:https://codeforces.com/contest/23/problem/B 这个题的构造可真是太妙了 orz #include <iostream> using namespace std; int main() { int T,n; scanf("%d",&T); while(T--) { scanf("%d",&n); printf("%d\n",n>2?n-2:0); }原创 2020-10-29 17:44:43 · 175 阅读 · 0 评论 -
CodeForces - 22C System Administrator【构造】
题目链接:https://codeforces.com/contest/22/problem/C #include <iostream> using namespace std; int n,m,v; int main() { scanf("%d%d%d",&n,&m,&v); if(m<n-1 || m>n-1+1ll*(n-2)*(n-3)/2) puts("-1"); else { for(int i=1;原创 2020-10-28 19:14:01 · 220 阅读 · 0 评论 -
CodeForces - 12E Start of the season【构造】
题目链接:https://codeforces.com/contest/12/problem/E 先构造1~n-1的每行每列不存在重复数字的矩阵 以n=6为例 1 2 3 4 5 2 3 4 5 1 3 4 5 1 2 4 5 1 2 3 5 1 2 3 4 对角线的数字1,3,5,2,4…显然满足 (i+2)%n 不会重复 故把对角线中的数字移到最后一列,并把对角线置0 0 2 3 4 5 1 2 0 4 5 1 3 3 4 0 1 2 5 4 5 1 0 3 2 5 1 2 3 0 4 再把最后一行抄上原创 2020-09-23 10:29:04 · 249 阅读 · 1 评论