#include<bits/stdc++.h> #define ls rt<<1 #define rs rt<<1|1 using namespace std; typedef long long ll; const int p=1e8+7; vector<int>v[1001000],ans; i ...
分类:
其他好文 时间:
2020-06-14 12:35:49
阅读次数:
64
题目链接 点我呀 翻译 给你一个初始数字x, 你可以对它做两种操作: 1.整除2然后加上10 2.减去10 问你在n次1操作和m次2操作之内, 能不能把数字x变成是小于0的。 题解 n和m都小于30? 这不傻逼题吗? dp[i][j]表示i次1操作,j次1操作x能到达的最小值。 \(dp[i][j] ...
分类:
其他好文 时间:
2020-06-14 11:08:14
阅读次数:
55
题目链接 点我呀 翻译 给你3条边x, y, z的范围, 且满足x < y < z, 让你选出3条合法的边, 使得这3条边能组成三角形。 保证答案总是存在。 题解 因为x < y < z, 所以x(y)和z相加的话, 肯定是大于y(x)的。 因此只要判断x+y是不是大于z就可以了。 因为说了一定会有 ...
分类:
其他好文 时间:
2020-06-14 10:41:15
阅读次数:
64
A - Minimal Square #include <bits/stdc++.h> using namespace std; const int maxn = 1e4+5; int main() { int t; cin >> t; while (t--) { int a, b; cin >> ...
分类:
其他好文 时间:
2020-06-13 21:16:11
阅读次数:
69
Odd Selection Subsequence Hate Game On Leaves Guess The Maximums Tree Shuffling A、Odd Selection 题意: $n$个数选$x$个数能不能使它们的和是奇数。 题解: 按奇偶分一波情况就行。 AC代码: 1 #i ...
分类:
其他好文 时间:
2020-06-13 14:33:52
阅读次数:
74
Codeforces Round #648 (Div. 2) A. 题意: 玩搞矩阵的游戏,只能在同行和同列都是0的地方把这个位置的0变成1,谁没法继续变了谁就输了 tag: 贪心,模拟 题解: 没有什么麻烦的贪心策略,1的行和列设为false,从头到尾跑一遍,i行j列是不是还可以放,因为无后效性( ...
分类:
其他好文 时间:
2020-06-13 13:04:17
阅读次数:
65
#pragma GCC optimize(2) #include<bits/stdc++.h> #define ll long long #define maxn 1000005 #define inf 1e9 #define pb push_back #define rep(i,a,b) for( ...
分类:
其他好文 时间:
2020-06-12 21:47:58
阅读次数:
79
#include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<cmath> #include<map> #include<vector> #include<queue> #include<set> ...
分类:
其他好文 时间:
2020-06-12 21:47:06
阅读次数:
66
题意:你有$a$个树枝和$b$个钻石,$2$个树枝和$1$个钻石能造一个铁铲,$1$个树枝和$2$个钻石能造一把剑,问最多能造多少铲子和剑. 题解:如果$a\le b$,若$b\ge 2a$,那么一直取$b$即可,否则就要两两轮流减,即$(a+b)/3$,取个min即可. 代码: #include ...
分类:
其他好文 时间:
2020-06-12 20:12:15
阅读次数:
62
题目链接:https://codeforces.com/problemset/problem/1365/E 题意 有 $n$ 个元素,定义大小为 $k$ 的集合值为 $\sum2^i$,其中,若集合内至少有 $max(1, k - 2)$ 个数二进制下第 $i$ 位为 $1$,则第 $i$ 位有效, ...
分类:
其他好文 时间:
2020-06-11 16:10:31
阅读次数:
84