题解
文章平均质量分 81
VigiIante
这个作者很懒,什么都没留下…
展开
-
Chiaki Sequence Revisited题解
首先顺着题目逻辑打表打表代码:#include<iostream>#include<string>#include<vector>using namespace std;int lowbit(int x){ return x&(-x);}int main(){ int N; int a[1007] = { 1,1 };...原创 2019-07-08 09:38:12 · 147 阅读 · 0 评论 -
校赛题解
题意很好理解,需要优先队列#include<bits/stdc++.h>using namespace std;const int maxn = 1e5 + 5;typedef long long int ll;struct Node{ ll a, b, num1, num2; bool operator < (const Node y) c...原创 2019-07-27 16:23:58 · 173 阅读 · 0 评论 -
2019牛客暑期多校训练营(第一场)题解
JFraction Comparision题意:给出x, a, y, b, 判断x / a与y / b的大小思路:数字太大需要大数,计算x * b与y *a的大小,再判断实现:JAVA大数import java.math.BigInteger;import java.util.*;public class Main { public static void ...原创 2019-07-19 16:26:11 · 195 阅读 · 0 评论 -
Codeforces Round #567 (Div. 2) B. Split a Number题解
B. Split a Numbertime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputDima worked all day and wrote down on a long paper strip his fa...原创 2019-07-02 16:25:05 · 315 阅读 · 0 评论 -
Codeforces Round #402 (Div. 2)题解
A. Pupils Redistributionhttps://codeforces.com/contest/779/problem/A题意就是把数字1到5平均分到两个班内,题水但是判定容易出BUG#include<bits/stdc++.h>using namespace std;constexpr int maxl = 6;int numa[maxl], num...原创 2019-06-04 10:52:09 · 280 阅读 · 0 评论 -
洛谷 P1091 合唱队形 题解(最长单调子序列)
https://www.luogu.org/problemnew/show/P1091题目描述NN位同学站成一排,音乐老师要请其中的(N-KN−K)位同学出列,使得剩下的KK位同学排成合唱队形。合唱队形是指这样的一种队形:设K位同学从左到右依次编号为1,2,…,K1,2,…,K,他们的身高分别为T_1,T_2,…,T_KT1,T2,…,TK, 则他们的身高满足T_1<......原创 2019-04-26 17:19:58 · 369 阅读 · 0 评论 -
Codeforces Round #554 (Div. 2) Problem B. Neko Performs Cat Furrier Transform
https://codeforces.com/contest/1152/problem/B大致思路是找到二进制n的第一个0, 然后模拟,与位操作有关#include<algorithm>#include <iostream>#include <sstream>#include <cstring>#include <cst...原创 2019-04-26 09:46:52 · 130 阅读 · 0 评论 -
April Fools Day Contest 2019 A. Thanos Sort题解
愚人节专场比我想象的难一些(太菜了)代码来自一个博客:https://blog.csdn.net/qq_38185591/article/details/88966801题目链接:https://codeforces.com/contest/1145/problem/A主要考验dfs能力,我第一次写了110行代码没过卡题贴代码:#include<algorithm&...原创 2019-04-02 23:45:33 · 259 阅读 · 0 评论 -
洛谷P1028 数的计算
这题是递归加打表加DP(给大佬ORZ)打表代码:#include<iostream>using namespace std;int sum = 0;void dfs(int n){ sum++; if (n == 1) return; for (int i = 1; i <= n / 2; i++) dfs(i);}int main(){ in...原创 2019-04-04 01:10:11 · 167 阅读 · 0 评论 -
Codeforces Round #544 (Div. 3) D. Zero Quantity Maximization题解
https://codeforces.com/contest/1133/problem/D#include<algorithm>#include <iostream>#include <sstream>#include <cstring>#include <cstdlib>#include <string&...原创 2019-03-12 20:19:16 · 115 阅读 · 0 评论 -
Codeforces Round #544 (Div. 3) B. Preparation for International Women's Day题解
https://codeforces.com/contest/1133/problem/B#include<algorithm>#include <iostream>#include <sstream>#include <cstring>#include <cstdlib>#include <string&...原创 2019-03-12 18:42:27 · 1076 阅读 · 0 评论 -
Problem L. Visual Cube题解(一个有意思的题目)
题目分析:Problem DescriptionLittle Q likes solving math problems very much. Unluckily, however, he does not have good spatial ability. Everytime he meets a 3D geometry problem, he will struggle to dra...原创 2018-07-31 14:22:34 · 351 阅读 · 0 评论 -
2019杭电多校Problem 5 Snowy Smile题解
转化为维护最大连续子串和#include<bits/stdc++.h>#define ll long long#define pi pair<int, ll>#define mk make_pairusing namespace std;const int maxn = 2010;struct node { int x, y; ll...原创 2019-08-07 20:04:39 · 241 阅读 · 0 评论