A Ministry for Defense sent a general to inspect the Super Secret Military Squad under the command of the Colonel SuperDuper. Having learned the news, ...
分类:
其他好文 时间:
2020-06-30 22:37:23
阅读次数:
61
题目 A题意:给出x,y,n.求不大于n,且mod x = y的最大值. 解法:通过除法向下取整找到最大的数mod x = 0,再加上y. void solve(){ int x , y , n ; cin >> x >> y >> n ; cout << (n-y)/x*x+y << endl; ...
分类:
其他好文 时间:
2020-06-30 18:51:29
阅读次数:
58
题目链接:https://codeforces.com/contest/1354 想法: 很明显的权值线段树(值域线段树)板子题。 #include <algorithm> #include <string> #include <cstring> #include <vector> #include ...
分类:
其他好文 时间:
2020-06-30 00:43:08
阅读次数:
58
A.Required Remainder 传送门 #include<bits/stdc++.h> using namespace std; #pragma GCC optimize(2) typedef long long ll; typedef unsigned long long ull; ty ...
分类:
其他好文 时间:
2020-06-29 17:00:21
阅读次数:
91
题意:有一个数$n$,每次操作可以使$n*=2$或$n/=6$(如果能被整除),求最少操作次数使得$n=1$,如果不满足,输出$-1$. 题解:我们只要看$n$的质因子即可,如果要满足条件,那么它的质因子只能含有$2$和$3$,并且$2$的次数不大于$3$的次数.直接去找$2$和$3$的次数即可.( ...
分类:
其他好文 时间:
2020-06-29 13:41:34
阅读次数:
79
[codeforces 1335C] Two Teams Composing 统计技能种类数量+统计同一技能最大数量 https://codeforces.com/contest/1335/problem/C 7 4 2 4 1 4 3 4 统计技能种类数量 4种不同技能 统计同一技能最大数量 技能 ...
分类:
其他好文 时间:
2020-06-28 22:18:27
阅读次数:
90
Donut Shops CodeForces - 1373A 题意:两家货店,一家a元一件,一家b件c元,求买多少到第一家绝对划算,买多少到第二家绝对划算, 考虑 b ==1时,直接判断平均单价即可。 当 第一个的平均单价小于第二个的平均单价,第一个绝对优势,因为可以拆开卖。 第一个的平均单价等于第 ...
分类:
其他好文 时间:
2020-06-28 22:13:13
阅读次数:
59
打的 vp,花了 1h 30min 切了前 6 个,后来花了 20min 把最后一题也切掉了. 难度不大,但是想要进前 10 的话手速还是要快一点. A - Short Substrings 观察一下字符串,然后发现相同的保留一个就行. #include <bits/stdc++.h> #defin ...
分类:
其他好文 时间:
2020-06-28 20:43:59
阅读次数:
38
题目链接: 原题:http://codeforces.com/problemset/problem/1070/A 翻译过的训练题:https://vjudge.net/contest/361183#problem/A 题目大意: 给你两个正整数p和x,让你求出最小的正整数m,满足m被p整除且m的各数 ...
分类:
其他好文 时间:
2020-06-28 20:38:58
阅读次数:
51
这题目怕不是有毒,,,样例万恶之源... 直接导致有人在谷群内询问如何在 1s 内输出 $10^{16}$ 个字符。 好了说题解。 首先读题,不难发现是最少 \(k\) 个子串。我们开一个数组,存储 codeforces 每一个字母要输出几个。 显然的,每个字母的数量应该尽可能接近对方,这样就可以使 ...
分类:
其他好文 时间:
2020-06-28 12:33:21
阅读次数:
51