http://poj.org/problem?id=2443 http://bailian.openjudge.cn/practice/2443?lang=en_US 题意: 给定一堆集合和一堆询问,每次询问给出两个数 \(x,y\),如果 \(x\) 和 \(y\) 出现在了同一个集合内,则输出 ...
分类:
其他好文 时间:
2020-05-31 18:00:20
阅读次数:
54
题干 题目链接:https://www.luogu.com.cn/problem/P1259 题目描述 有2n个棋子(n≥4)排成一行,开始为位置白子全部在左边,黑子全部在右边,如下图为n=5的情况: ○○○○○●●●●● 移动棋子的规则是:每次必须同时移动相邻的两个棋子,颜色不限,可以左移也可以右 ...
分类:
移动开发 时间:
2020-05-31 17:40:03
阅读次数:
78
题意:给一个杯子 可以倒热水h 和冷水c 必须热冷热冷这样倒,可以倒无限次 问至少倒多少次的时候 温度的总和/倒的次数 最接近给的温度t 题目链接:https://codeforces.ml/contest/1359/problem/C 思路:设出函数考虑单调性 再考虑二分 1 假设倒了x杯热水的时 ...
分类:
其他好文 时间:
2020-05-31 10:47:27
阅读次数:
53
使用pyinstaller打包.py文件时,会把很多已安装的无关库同时打包进去,导致打包生成的.exe文件体积过大。使用pipenv创建虚拟python环境,在虚拟环境中安装.py文件所用到的库(即py文件中import 的第三方库),然后在pipenv所创建的虚拟环境中使用pip安装打包所用到的p ...
分类:
其他好文 时间:
2020-05-30 22:02:35
阅读次数:
226
题目链接:http://poj.org/problem?id=2484 题意:Alice和Bob玩游戏,从一堆圆环形排列的硬币中拿硬币,每次可以拿一个或者两个,但必须拿连续的(两个中间有空位也视为不连续),Alice先手,给定硬币个数,问谁赢。 题解: 当n=1或者n=2时,Alice可以一下子取走 ...
分类:
其他好文 时间:
2020-05-30 21:58:56
阅读次数:
80
问题描述 在经典汉诺塔问题中,有 3 根柱子及 N 个不同大小的穿孔圆盘,盘子可以滑入任意一根柱子。一开始,所有盘子自上而下按升序依次套在第一根柱子上(即每一个盘子只能放在更大的盘子上面)。移动圆盘时受到以下限制: (1) 每次只能移动一个盘子; (2) 盘子只能从柱子顶端滑出移到下一根柱子; (3 ...
分类:
其他好文 时间:
2020-05-30 19:32:08
阅读次数:
45
题解: t1: 代码: #include <cstdio> int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); printf("%d",a+b+c); return 0; } 典型的入门问题a+b problem的一点拓展. 看到fi=a*f_{i-1} ...
分类:
其他好文 时间:
2020-05-30 18:21:53
阅读次数:
47
#Linova and Kingdom 题目链接:[https://pintia.cn/problem-sets/994805046380707840/problems/1111914599412858880) ###涉及知识点: 思维/字符串 ###solution: \(我们需要判断这个第一句古 ...
分类:
其他好文 时间:
2020-05-30 15:53:23
阅读次数:
58
题目链接:https://vjudge.net/problem/HDU-1069 A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the ...
分类:
其他好文 时间:
2020-05-30 13:06:28
阅读次数:
65
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the lef ...
分类:
其他好文 时间:
2020-05-30 10:23:54
阅读次数:
65