![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
VJ
文章平均质量分 65
꧁ꦿ眠羊꧂
既然选择了远方,便只顾风雨兼程
展开
-
C - K Derangement
题意:给你一个n和一个k,i从1到n,输出一串数组ai,要使得所有的abs(ai-i)>=k,还要注意字典序输出,比如8 3,输出4 5 6 7 8 1 2 3,但是15 4 要输出 5 6 7 8 1 2 3 12 13 14 15 4 9 10 11.原创 2022-08-02 20:01:21 · 228 阅读 · 0 评论 -
B - So You Think You Can Count?
从后往前找和它相同的数字,然后从j-i的dp值加起来就是dp【i】,然后如果两个相同数字之间有两个相同的数字,那么我们要求的两个数字之间一定是有隔板的,否则那两个之间的相同的数字是不合法的;题意分割成子集,然后每个子集中没有相同元素,求最多能有多少种子集分割情况。......原创 2022-07-18 21:10:46 · 94 阅读 · 0 评论 -
C - MRT Map
题意给n个城市,两两城市之间的路线长度是相同字母(不区分大小写,不记数量)的数量,然后求最短路的路程,用dijkstra。原创 2022-07-16 19:48:36 · 143 阅读 · 0 评论 -
A - Bookshelf Filling (非二分法,好像还更快)
链接:https://codeforces.com/gym/103688/problem/A竖着按hb为一个单位一个个看。先看a上边,摞上去的数量就是(H - ha) * (na / hb),然后ans减去。然后剩下的没安排的,是a那部分剩下的够不了一个的,再加上全部的b,就是na % hb + ans - na。然后对这部分也是一个单位一个单位看(hb),我们先把b全放上去,就是res -= H - hb,一直摞,直到最后不能摞,也就是res.........原创 2022-06-07 20:36:13 · 511 阅读 · 0 评论 -
C - K Swap
题意:在1 - n-k范围内,交换a[i]和a[i + k]能不能让序列变成非递减的序列。然后就暴力枚举,但是我们要考虑a[i] a[i+k] a[i+2k]巴拉巴拉,可以传递交换,所以弄个vector数组,然后存i i+k i+2k巴拉巴拉,然后对比k区间2k区间巴拉巴拉的数字,如果有递增情况就输出No,否则Yes。...原创 2022-06-05 22:39:34 · 221 阅读 · 0 评论 -
J - uvenile Galant
Xingqiu at your service, my liege! I humbly trust that even one such as I, a mere bookworm, may yet prove to be of some utility under your wise leadership. Nice, I don’t often get a chance to speak with such formality. It felt pretty good! —Xingqiu As a se原创 2022-05-24 23:46:28 · 147 阅读 · 0 评论 -
2018-german-collegiate-programming-contest-gcpc-18-en
Problem C: Coolest Ski Routelink题目大意:在有向图里找一个最长路,没有入点的是起点,没有出点的是终点。用记忆化搜索#include <bits/stdc++.h>#define mm(a) memset(a, 0, sizeof(a));using namespace std;const int N = 5e3 + 7;int n, m;int Map[N][N];int dp[N];int vis[N];int cnt[N];v原创 2022-05-03 20:53:21 · 198 阅读 · 0 评论 -
A - AD 2020
2020 is the current year and is a leap year starting on Wednesday of the Gregorian calendar, the 2020th year of the Common Era (CE) and Anno Domini (AD) designations, the 20th year of the 3rd millennium, the 20th year of the 21st century, and the 1st year转载 2022-04-30 21:31:49 · 128 阅读 · 0 评论 -
2019 ICPC-- 女生专场重现赛
B - Gcd原创 2022-04-29 21:20:46 · 218 阅读 · 0 评论