Codeforces
Zeolim
这个作者很懒,什么都没留下…
展开
-
[Codeforces] Round #595 (Div. 3) A B1 B2 C1 C2 D1 D2 E
A: 将数分为k组使得每组不包含数值差为1的数解:正整数可直接分为两组 奇数 偶数 符合题意, 所以给定数列有相邻就是2否则就是1B1 / B2: 给定一每个点出度为1的图问每个点走到自己需要多少步明显走到自己是个环, 并且环上答案都一样,递归求解即可#include <bits/stdc++.h>using namespace std;const int MAX...原创 2019-10-23 16:04:39 · 292 阅读 · 0 评论 -
CCPC-Wannafly Summer Camp 2019 Day1
A - Jzzhu and Cities题目大意:给个图,m条普通边,k条特殊边,保证1到N的最短路上最多可以删掉几条特殊边使得最短路不变。解法1:跑最短路后松弛一遍所有边,如果松弛时既有普通和特殊则可去掉特殊铁路。解法2:直接重载搜索顺序使得迪杰斯特拉优先跑普通铁路,再记录总特殊条数-跑的条数即为答案。/* Zeolim - An AC a day keeps the...原创 2019-07-30 13:55:51 · 238 阅读 · 0 评论 -
[构造]D. N Problems During K Days
Polycarp has to solve exactlynnproblems to improve his programming skill before an important programming competition. But this competition will be held very soon, most precisely, it will start ink...原创 2019-05-08 20:23:11 · 337 阅读 · 0 评论 -
Educational Codeforces Round 54 (Rated for Div. 2) C. Meme Problem
二分搜索推下方程把前半部分去掉/* Zeolim - An AC a day keeps the bug away*///pragma GCC optimize(2)#include <cstdio>#include <iostream>#include <cstdlib>#include <cmath>#inc...原创 2018-11-13 11:32:19 · 373 阅读 · 0 评论 -
Educational Codeforces Round 54 (Rated for Div. 2) B. Divisor Subtraction
观察易得1.质数无1和自身外的因子 且只有本身既质又因 按题意直接一步减自身至零2.若N是偶数则一直减2直到0所有质数都是奇数 奇数减奇数易得偶数 再回到条件2 一步到位所以操作次数不会太多线筛打表 结合1 2 暴力模拟即可 /* Zeolim - An AC a day keeps the bug away*///pragma GCC optimi...原创 2018-11-13 11:29:19 · 259 阅读 · 0 评论 -
Educational Codeforces Round 54 (Rated for Div. 2) A. Minimizing the String
贪心因字典序位越靠前权越大 从初始位置枚举此位后一位向后与原串比较字典序若小则为最优输出结束/* Zeolim - An AC a day keeps the bug away*///pragma GCC optimize(2)#include <cstdio>#include <iostream>#include <cs...原创 2018-11-13 11:22:29 · 409 阅读 · 0 评论 -
Codeforces Round #516 Div. 2 A. B. Equations of Mathematical Magic C. Oh Those Pali D. Labyrinth
A. Make a triangle!Masha has three sticks of length aa, bb and cc centimeters respectively. In one minute Masha can pick one arbitrary stick and increase its length by one centimeter. She is not all...原创 2018-10-14 22:23:08 · 662 阅读 · 0 评论 -
Codeforces Round #498 (Div. 3) C. Three Parts of the Array
C. Three Parts of the Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array d1,d2,…,dnd1,d2,…,dn consisting...原创 2018-07-17 10:55:16 · 367 阅读 · 0 评论 -
Codeforces Round #498 (Div. 3) B. Polycarp's Practice
B. Polycarp's Practicetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp is practicing his problem solving skill. He has a...原创 2018-07-17 10:49:54 · 443 阅读 · 0 评论 -
Codeforces Round #498 (Div. 3) A. Adjacent Replacements
A. Adjacent Replacementstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka got an integer array aa of length nn as a birthday...原创 2018-07-17 10:45:57 · 180 阅读 · 0 评论