![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
基础题
刀锋灬意志
嘤嘤嗡嗡
展开
-
问题 K: oop实习-11.运算符重载
题目描述定义有理数类(分母不为0的分数,分子分母均为整数)Rational,实现相应操作符的重载。(1)定义私有数据成员:分子int iUp; 分母 int iDown。(2)定义私有成员函数:void Reduce() 和 int Gcd(int l, int r),分别用于有理数的约简和求两个整数的最大公约数。其中,在约简时需要求取分子与分母的最大公约数。(3)定义构造函数,在...原创 2019-05-14 22:57:34 · 1962 阅读 · 0 评论 -
HDU6438-Buy and Resell(贪心、思维题)
题目链接Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 3083Accepted Submission(s): 1158Problem DescriptionThe Power Cube is used as a stas...原创 2019-04-17 19:43:51 · 169 阅读 · 0 评论 -
南昌网络赛-MORE XOR(打表找规律)
题目链接The Preliminary Contest for ICPC China Nanchang National Invitational题目大意f(l,r)是异或a[l]到a[r];g(l,r)是异或f(x,y),(l<=x<=y<=r);w(l,r)是异或g(x,y),(l<=x<=y<=r)。思路贴一个参考的博客:https:/...原创 2019-04-27 11:03:52 · 151 阅读 · 0 评论 -
UVA623-500!(模拟乘法 or BigInteger)
题目链接In these days you can more and more often happen to see programs which perform some useful calculations being executed rather then trivial screen savers. Some of them check the system message qu...原创 2019-06-21 11:18:06 · 168 阅读 · 0 评论 -
BZOJ4245-OR-XOR(二进制贪心)
题目链接给定一个长度为n的序列a[1],a[2],...,a[n],请将它划分为m段连续的区间,设第i段的费用c[i]为该段内所有数字的异或和,则总费用为c[1] or c[2] or ... or c[m]。请求出总费用的最小值。Input第一行包含两个正整数n,m(1<=m<=n<=500000),分别表示序列的长度和需要划分的段数。第一行包含n个整数,其中第...原创 2019-06-30 22:50:08 · 232 阅读 · 0 评论 -
ACM2019陕西省赛-ZOJ4128-0689(思维)
We call a string as a 0689-string if this string only consists of digits ‘0’, ‘6’, ‘8’ and ‘9’. Given a 0689-string sss of length nnn, one must do the following operation exactly once: select a non-em...原创 2019-07-17 16:03:49 · 1425 阅读 · 0 评论 -
PTA-GPLT L2-006 树的遍历(二叉树中序和后序输出层序遍历)
题目链接:https://pintia.cn/problem-sets/994805046380707840/problems/994805069361299456L2-006 树的遍历 (25 分)给定一棵二叉树的后序遍历和中序遍历,请你输出其层序遍历的序列。这里假设键值都是互不相等的正整数。输入格式:输入第一行给出一个正整数N(≤30),是二叉树中结点的个数。第二行给出其后序遍...原创 2019-03-16 16:54:47 · 1988 阅读 · 0 评论 -
Codeforces Round #579 div3 E Boxers(思维)
题目链接题意给一行数有n个,对于每个数可以增大1,也可以减小1,也可以不变,要求修改后必须是正整数,不可为0。将修改后的数去重,问最多有几个?#include <bits/stdc++.h>using namespace std;int n,a[150005],vis[150005],cnt;int main(){ scanf("%d",&n)...原创 2019-08-14 18:05:02 · 117 阅读 · 0 评论