
ACM
柠檬超级酸
What Ever
展开
-
C++中栈有关知识的理解
文章目录一、栈有关的基础知识二、栈的应用1、括号匹配2、括号匹配一、栈有关的基础知识1、对栈的理解栈,是一种存储受限的线性数据结构,在存储和访问数据时只能够访问栈的一端,即栈是一种先进后出的数据结构。2、如何定义一个栈使用栈时,需要在头文件中添加 #include < stack>#include<stack>stack<int> s;//定义...原创 2020-04-21 12:11:05 · 569 阅读 · 0 评论 -
大数问题(1002、1042、1133、1250、1297、1715、1753、1865、2100)
文章目录1002、A + B Problem II[A+B,大数相加]1042、N![大数乘法]1002、A + B Problem II[A+B,大数相加]I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B.InputThe ...原创 2020-04-19 12:01:23 · 933 阅读 · 0 评论 -
杭电ACM基础题(2352、2549、2564、2565、2567、2572、2609、2607、2707、2708、2719、2721、2723)
文章目录2352、Verdis Quo[将罗马数字转化为十进制数字]2549、让你算出小数点后第n位是什么2564、词组缩写2565、放大的X[画图]2352、Verdis Quo[将罗马数字转化为十进制数字]The Romans used letters from their Latin alphabet to represent each of the seven numerals in ...原创 2020-04-17 15:02:57 · 3307 阅读 · 0 评论 -
如何理解字符串的最大、最小表示法
一、什么是循环字符串的最小表示法对于一个字符串S,求S的循环的同构字符串S’中字典序最小的一个。如:S=bacd,则S’可以是acdb,cdba,dbac,其中最小表示的S’是acdb。即该字符串的循环同构字符串中字典序最小的一个是acdb二、如何求解一个字符串的循环同构的最小表示求解这个问题,实质上是在S串中寻找一个位置,从该位置起循环输出S,此时得到的S’字典序是最小的思路一:首先...原创 2020-04-16 12:15:29 · 920 阅读 · 0 评论 -
杭电ACM基础题(1984、2052、2054、2072、2074、2087、2140、2163、2203、2206)
文章目录1984、Mispelling42052、Picture[画图]2054、A == B ?[利用字符串存数据]2072、单词数[利用set]2074、叠筐[画图]1984、Mispelling4Misspelling is an art form that students seem to excel at. Write a program that removes the nth c...原创 2020-04-13 16:51:10 · 885 阅读 · 0 评论 -
杭电ACM基础题(1200、1251、1256、1321、1328、1379、1288、1804、1860、1982)
文章目录1200、To and Fro[将加密的字符串进行解密]1251、统计难题[输出以指定字符串为前缀的单词的数量]1200、To and Fro[将加密的字符串进行解密]Mo and Larry have devised a way of encrypting messages. They first decide secretly on the number of columns an...原创 2020-04-11 15:33:45 · 10830 阅读 · 0 评论 -
如何理解错排问题
一、什么是错排问题举例:十本不同的书放在书架,现重新摆放,使得每本书都不在原来的位置上,有几种摆法?一个人给十个同学写信,但他把所有的信都装错了信封,问共有多少种错误的方式?以上问题推广,就是错排问题。一个n个元素的排列,若一个排列中所有的元素都不在自己原来的位置上,那么这样的一个排列就称为原排列的一个错排。而研究一个排列的错排个数的问题,就称为错排问题(或称为更列问题)。二、错排公式...原创 2020-04-10 23:15:50 · 764 阅读 · 0 评论 -
杭电ACM基础题(2201、2212、2304、2309、2317、2401、2500、2502、2503、1708、1161)
文章目录2201、熊猫阿波的故事[概率问题]2212、DFS[各位数的阶乘之和等于该数]2304、Electrical Outlets[电源板接口]2309、ICPC Score Totalizer Software[去掉一个最高分,去掉一个最低分的最终得分]2401、Baskets of Gold Coins[金币的重量]2500、输出指定大小的方形字符串2502、月之数 [规律题]2503、a...原创 2020-04-09 10:19:41 · 5567 阅读 · 0 评论 -
杭电ACM基础题(2139、2143、2148、2153、2156、2161、2162、2164、2186、2192、2200)
文章目录2139、Calculate the formula[计算公式]2143、box[操作符和数]2148、Score[班里有多少同学高于该同学]2153、仙人球的残影[数组模拟]2156、分数矩阵[求和]2161、Primes[判断一个数是否为素数]2162、Add ‘em[计算连续的几个整数和]2164、Rock, Paper, or Scissors?[石头剪刀布游戏]2178、猜数字2...原创 2020-04-07 23:15:24 · 1120 阅读 · 0 评论 -
杭电ACM基础题(2114、2115、2123、2131、2132、2133、2135、2136、2137、2138)
文章目录2114、Calculate S(n)2115、I Love This Game[利用结构排序]2123、An easy problem[输出n*n矩阵]2131、Probability2132、An easy problem[递归给出]2133、What day is it[计算给定日期是星期几]2135、Rolling table[对矩阵进行旋转]2136、Largest prime ...原创 2020-04-07 11:52:28 · 1385 阅读 · 0 评论 -
杭电ACM基础题(2096、2097、2098、2099、2101、2103、2106、2107、2109、2113)
文章目录2096、小明A+B2097、Sky数[十进制、十二进制、十六进制各位之和是否相等]2098、分拆素数和2099、整除的尾数2096、小明A+B小明今年3岁了, 现在他已经能够认识100以内的非负整数, 并且能够进行100以内的非负整数的加法计算.对于大于等于100的整数, 小明仅保留该数的最后两位进行计算, 如果计算结果大于等于100, 那么小明也仅保留计算结果的最后两位.例如,...原创 2020-04-06 11:16:18 · 1496 阅读 · 0 评论 -
杭电ACM基础题(2075、2076、2078、2081、2083、2088、2090、2092、2093、2095)
文章目录2075、A能否被B整除2076、时针和分针之间夹角有多大2078、复习效率的最大值2081、手机短号2083、简易版之最短距离2075、A能否被B整除正整数A是否能被正整数B整除,不知道为什么xhd会研究这个问题,来帮帮他吧。Input输入数据的第一行是一个数据T,表示有T组数据。每组数据有两个正整数A和B(A,B<10^9)。Output对于每组输入数据,输出"YE...原创 2020-04-05 14:47:42 · 1657 阅读 · 0 评论 -
杭电ACM基础题(2048、2049、2053、2055、2056、2057、2060、2061、2071、2073)
文章目录2048、抽奖活动无人中奖的概率[错排问题]2049、不容易系列之(4)——考新郎[错排问题]2053、Switch Game[开关灯]2055、An easy problem[计算n+f(c)]2056、Rectangles[计算重叠部分矩形面积]2048、抽奖活动无人中奖的概率[错排问题]HDU 2006’10 ACM contest的颁奖晚会隆重开始了!为了活跃气氛,组织者举行...原创 2020-04-04 17:49:12 · 4932 阅读 · 0 评论 -
杭电ACM基础题(2031、2032、2033、2034、2035、2039、2040、2042、2043、2051)
进制转换(2031)|输出n层的杨辉三角(2032)|时钟的A+B(2033)|两个集合作差(2034)|求A^B^(2035)|判断能否构成三角形(2039)|亲和数(2040)|经过收费站计数(2042)|判断密码是否是安全密码(2043)|将十进制转化为二进制(2051)原创 2020-04-03 17:05:41 · 2205 阅读 · 0 评论 -
杭电ACM基础题(2021、2022、2023、2024、2025、2026、2027、2028、2029、2030)
文章目录2021、发工资2022、在二维数组中,寻找绝对值最大的数2023、求平均成绩2024、C语言合法标识符2025、查找最大字母,并在其后插入字符串2026、首字母变大写2027、统计元音字母的个数2028、Lowest Common Multiple Plus[求n个数的最小公倍数]2029、Palindromes _easy version[判断回文字符串]2030、汉字统计2021、...原创 2020-04-02 22:45:52 · 2997 阅读 · 0 评论 -
杭电ACM基础题(2011、2012、2013、2014、2015、2016、2017、2018、2019、2020)
2011、多项式求和多项式的描述如下:1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + …现在请你求出该多项式的前n项的和。Input输入数据由2行组成,首先是一个正整数m(m<100),表示测试实例的个数,第二行包含m个正整数,对于每一个整数(不妨设为n,n<1000),求该多项式的前n项的和。Output对于每个测试实例n,要求输出多项式前n项的和。...原创 2020-04-02 15:23:25 · 1647 阅读 · 0 评论 -
杭电ACM基础题(2000、2001、2002、2003、2004、2005、2006、2007、2008、2009、2010)
文章目录2000、ASCII码排序[简单的字符排序]2001、计算两点间的距离[简单的数学公式]2002、计算球体积[简单的球体体积公式]2003、求绝对值[简单]2004、成绩转换[简单的条件判断]2005、给定一个日期,输出这个日期是该年的第几天2006、求n个整数中,奇数的乘积2007、所有偶数的平方和以及所有奇数的立方和2008、数值统计[统计一行中正、负数的个数]2009、求数列的和20...原创 2020-04-01 21:45:49 · 738 阅读 · 0 评论 -
杭电ACM基础题(1877、1898、1976、1977、1985、1994)
文章目录1877、输出A+B的m进制数1898 Sempr == The Best Problem Solver?[在T小时的时候,A和B谁提交的问题多]1976、Software Version[比较软件版本的新旧]1977、Consecutive sum II[找规律]1985、Conversions[单位转换]1994、利息计算1877、输出A+B的m进制数输入两个不超过整型定义的非负1...原创 2020-04-01 14:25:42 · 1049 阅读 · 0 评论 -
杭电ACM基础题(1720、1785、1799、1859、1862)
文章目录1720、A+B Coming[十六进制数A+B]1785、给定(x,y)坐标,比较其与x轴正向夹角1799、多重for循环,计算程序一共执行了多少次1859、最小长方形[长方形框左下坐标,右上坐标]1720、A+B Coming[十六进制数A+B]InputInput may contain multiple test cases. Each case contains A and...原创 2020-03-31 23:24:06 · 609 阅读 · 0 评论 -
杭电ACM基础题(1562、1563、1570、1587、1673、1678、1718)
文章目录1562、Guess the number1563、Find your present![寻找一行数中值为唯一的数]1570、AC[排列组合]1587、Flowers[买到最多的花]1673、Optimal Parking[需要步行的最短距离]1678、Shopaholic[买三送一,计算最优惠折扣]1718、Rank[找出编号为id的同学的分数的排名]1562、Guess the nu...原创 2020-03-31 16:01:03 · 483 阅读 · 0 评论 -
杭电ACM基础题(1408、1412、1418、1420、1465、1491、1555)
1408、// 滴完一瓶盐水所需要的时间#include<iostream>using namespace std;int main(){ double vul,d;//(0,5000),该瓶盐水共vul毫升,每一滴d毫升,要用double类型 while(cin>>vul>>d){ double sum=0;...原创 2020-03-31 10:57:27 · 588 阅读 · 0 评论 -
杭电ACM基础题(1339、1393、1395、1397、1405、1406、1407)
文章目录1339、A Simple Task[n=o*2^p^]1393、Weird Clock[给定s和d,判断至少需要几枚硬币使得分针转回0 ]1395、2^x mod n = 1[取模运算]1397、Goldbach's Conjecture[哥德巴赫猜想--n=p1+p2(素数打表)]1405、The Last Practice[将正数分解为一些质数的组合 如60:2 2 3 1 5 1 ...原创 2020-03-30 17:31:43 · 676 阅读 · 0 评论 -
杭电ACM基础题(1323、1391、1390、1330、1334、1335)
1323、Perfection[一个正整数的因数之和是否等于其自身]From the article Number Theory in the 1994 Microsoft Encarta: “If a, b, c are integers such that a = bc, a is called a multiple of b or of c, and b or c is called a ...原创 2020-03-29 22:19:55 · 1485 阅读 · 0 评论 -
杭电ACM基础题(1236、1266、1279、1283、1302、1303)
1236、排名(排序)今天的上机考试虽然有实时的Ranklist,但上面的排名只是根据完成的题数排序,没有考虑每题的分值,所以并不是最后的排名。给定录取分数线,请你写程序找出最后通过分数线的考生,并将他们的成绩按降序打印。Input测试输入包含若干场考试的信息。每场考试信息的第1行给出考生人数N ( 0 < N< 1000 )、考题数M ( 0 < M < = ...原创 2020-03-28 15:35:00 · 885 阅读 · 0 评论 -
杭电ACM基础题(1201、1202、1205、1219、1234、1235)
1201、计算一个人从出生到18岁生日所经历的时间Code:分析闰年、平年和2月份的关系//计算一个人从出生到18岁生日所经历的总的天数#include<iostream>#include<string>using namespace std;bool isLeap(int year){ if((year%4==0&&year%100!...原创 2020-03-27 11:22:02 · 653 阅读 · 0 评论 -
杭电oj基础题目(1106、1108、1163、1164、1170、1194、1197)
文章目录1106、排序1108、最小公倍数1157、Who's in the middle1163、Eddy's digital Roots[数字根]1164、Eddy's research I[将一个数拆分成素数的乘积]1170、Balloon Comes![已知操作符和操作数,计算相应结果]1194、Beat the Spread![给出两个数的和以及两个数的差,求这两个数--二元一次方程]1...原创 2020-03-25 22:10:54 · 1263 阅读 · 0 评论 -
杭电ACM基础题(1032、1037、1040、1048、1056、1058、1061、1070、1076、1097)
1032、The 3n + 1 problemProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a propert...原创 2020-03-24 22:21:19 · 3733 阅读 · 0 评论 -
杭电ACM基础题(1017、1019、1021、1028、1029)
1017、A Mathematical CuriosityGiven two integers n and m, count the number of pairs of integers (a,b) such that 0 < a < b < n and (a2+b2 +m)/(ab) is an integer.This problem contains multiple...原创 2020-03-23 18:11:10 · 1128 阅读 · 0 评论 -
杭电ACM基础题目(1000 1001 1004 1005 1008 1012 1014)
1001、Sum ProblemCode:1、注意:输出格式的要求,因为题目要求空一行,所以需要cout<<endl<<endl;2、计算从1-n的和并输出#include<iostream>using namespace std;int main() { int n,sum; while (cin >> n) { ...原创 2020-03-21 13:52:36 · 898 阅读 · 0 评论 -
Just A Triangle
Problem DescriptionThis is an easy problem, just for you to warm up.Give you three edges of a triangle. Can you tell me which kind of triangle it stands for?If it’s a right triangle(直角三角形), please ...原创 2020-03-20 11:07:23 · 164 阅读 · 0 评论 -
GPA
Problem DescriptionEach course grade is one of the following five letters: A, B, C, D, and F. (Note that there is no grade E.) The grade A indicates superior achievement , whereas F stands for failur...原创 2020-03-19 18:58:20 · 263 阅读 · 0 评论 -
decimal system
Problem DescriptionAs we know , we always use the decimal system in our common life, even using the computer. If we want to calculate the value that 3 plus 9, we just import 3 and 9.after calculation...原创 2020-03-19 17:58:53 · 394 阅读 · 0 评论 -
Buildings
Problem DescriptionWe divide the HZNU Campus into NM grids. As you can see from the picture below, the green grids represent the buidings. Given the size of the HZNU Campus, and the color of each gri...原创 2020-03-18 18:34:02 · 264 阅读 · 0 评论 -
Box of Bricks
Problem DescriptionLittle Bob likes playing with his box of bricks. He puts the bricks one upon another and builds stacks of different height. “Look, I’ve built a wall!”, he tells his older sister Al...原创 2020-03-18 17:40:02 · 291 阅读 · 0 评论 -
Financial Management
Problem DescriptionLarry graduated this year and finally has a job. He’s making a lot of money, but somehow never seems to have enough. Larry has decided that he needs to grab hold of his financial p...原创 2020-03-18 17:16:25 · 183 阅读 · 0 评论 -
A+B for Input-Output Practice(1089-1096)
1、Your task is to Calculate a + b.InputThe input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.OutputFor each pair of input integers a ...原创 2020-03-18 14:58:03 · 663 阅读 · 0 评论