![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ZCMU
KEMNHan
希望工作955,管吃住,生活设施齐全,有零食,小姐姐多,写不出bug
展开
-
ZCMU-2164
Problem B: 去注释Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 32 Solved: 11[Submit][Status][Web Board]Description给你一段C++代码,将其中的注释去除后输出剩余的代码。注释共有两种形式:1. 行注视:以//开头,一直作用到行尾为止。例子:int n;//n表示数据规模int a;去注释后...原创 2018-06-07 15:17:14 · 260 阅读 · 0 评论 -
zcmu-2087:小朋友排队
Description n 个小朋友站成一排。现在要把他们按身高从低到高的顺序排列,但是每次只能交换位置相邻的两个小朋友。 每个小朋友都有一个不高兴的程度。开始的时候,所有小朋友的不高兴程度都是0。 如果某个小朋友第一次被要求交换,则他的不高兴程度增加1,如果第二次要求他交换,则他的不高兴程度增加2(即不高兴程度为3),依次类推。当要求某个小朋友第k次交换时,他的不高兴...原创 2018-10-09 18:10:15 · 247 阅读 · 0 评论 -
zcmu-2205:Chord
Vasya studies music.He has learned lots of interesting stuff. For example, he knows that there are 12 notes: C, C#, D, D#, E, F, F#, G, G#, A, B, H. He also knows that the notes are repeated cyclica...原创 2018-10-10 17:48:06 · 162 阅读 · 0 评论 -
zcmu-2195:Cableway
A group of university students wants to get to the top of a mountain to have a picnic there. For that they decided to use a cableway.A cableway is represented by some cablecars, hanged onto some cab...原创 2018-10-10 17:50:24 · 187 阅读 · 0 评论 -
zcmu-2209:Vasya and Types
Programmer Vasya is studying a new programming language &K*. The &K* language resembles the languages of the C family in its syntax. However, it is more powerful, which is why the rules of the...原创 2018-10-10 17:53:49 · 157 阅读 · 0 评论 -
zcmu-2204
Vasya learns to type. He has an unusual keyboard at his disposal: it is rectangular and it has n rows of keys containing m keys in each row. Besides, the keys are of two types. Some of the keys have l...原创 2018-10-10 17:56:38 · 168 阅读 · 0 评论 -
ZCMU-2157(乘法逆元)
ly的旅行计划Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 33 Solved: 10[Submit][Status][Web Board]Description马上就要放暑假了,ly开始准备她的假期旅行计划,她买了一辆很神奇的火车的车票,假设把这辆火车的路线看成一条X轴,ly会在0的位置上车,然后开始她的旅行。这辆神奇的火车有一个...原创 2018-10-24 21:35:16 · 136 阅读 · 0 评论 -
zcmu-2216 Petya and Tree
One night, having had a hard day at work, Petya saw a nightmare. There was a binary search tree in the dream. But it was not the actual tree that scared Petya. The horrifying thing was that Petya coul...原创 2018-10-24 21:39:33 · 151 阅读 · 0 评论 -
zcmu-2217 Embassy Queue
In an embassy of a well-known kingdom an electronic queue is organised. Every person who comes to the embassy, needs to make the following three actions: show the ID, pay money to the cashier and be f...原创 2018-10-24 21:45:09 · 150 阅读 · 0 评论 -
浙江中医药大学2018级新生程序设计竞赛
画正方形题目很简单,两个for循环嵌套一下,控制下每行左后一位的换行直接输出就好了。#include<cstring>#include<algorithm>#include<stdlib.h>#include<stack>#include<queue>#include<map>using namespac...原创 2018-11-22 17:29:16 · 261 阅读 · 0 评论 -
阿力的第二场难题
A:本意是当签到题,但是可能低估了这题的难度在线标记处理二分查找#include <bits/stdc++.h>using namespace std;const int maxn = 1000005;int n, w[maxn];bool vis[maxn];set<int> a;set<int>::iterator it;inli...原创 2019-06-20 22:50:58 · 162 阅读 · 0 评论 -
阿力的第三场难题
A:算贪心两个数组排个序瞎搞搞就行了#include <bits/stdc++.h>using namespace std;const int maxn=0x3f3f3f3f;int n, a[50005], b[50005], ans = maxn, maxn, cmp;int main() { cin >> n; for (int i ...原创 2019-06-21 23:00:17 · 145 阅读 · 0 评论 -
zcmu-1437:A Bug's Life
Description Professor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposi...原创 2018-10-09 18:05:58 · 241 阅读 · 0 评论 -
zcmu-2018:Memory leak
Description Input Output 对于每种操作输出相应内容 Sample Input3 char a[5], b[5], c[5]; gets a C++ gets b Hello, world! gets c guys cout a cout b cout c return 0; char a[5]; cout a gets a 233...原创 2018-10-09 18:01:47 · 152 阅读 · 0 评论 -
zcmu-2210:Trains
Vasya the programmer lives in the middle of the Programming subway branch. He has two girlfriends: Dasha and Masha, who live at the different ends of the branch, each one is unaware of the other one's...原创 2018-10-09 17:58:20 · 294 阅读 · 0 评论 -
ZCMU-2163
Problem A: 项链Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 40 Solved: 15[Submit][Status][Web Board]Description强迫症非常麻烦,尤其是买东西的时候。冠璐女神的生日快到了,某强迫症要送一条项链送给她,重点是,这条项链要对称,这条项链要对称,这条项链要对称。(很重要所以说三遍)项链都是环状的...原创 2018-06-07 15:06:13 · 460 阅读 · 0 评论 -
士兵排队问题
拓扑排序+优先队列(考虑题目需要注意字符串排序的情况)优先队列递增 priority_queue <int,vector<int>,greater<int> > q;递减 priority_queue <int,vector<int>,less<int> >q;#include<bits/stdc++.h>usin原创 2018-07-11 09:01:01 · 1712 阅读 · 0 评论 -
zcmu2095 危险系数
1.并查集int find(int x)//并查集查找最终所属区域的方法{ return x == fa[x] ? x : fa[x] = find(fa[x]);}ac代码#include<bits/stdc++.h>using namespace std;int n,m;int fa[1010];struct node{ int x,y; bool operat...原创 2018-07-11 14:13:48 · 142 阅读 · 0 评论 -
zcmu2073: #6291. 小L进阶的斐波那契数列游戏
原题来自Loj的6291题目要求就是求斐波那契数列的前n项平方和对mod 取模的值刚开始 以为要求fib循环节,后来发现计算是有规律的根据题目要求可发现题目所求值实际上是fib【n】*fib【n-1】的值%mod下面是用快速求取模后fib值的ac代码(核心思路就是矩阵求fib)#include<bits/stdc++.h>using namespace std;typedef l...原创 2018-07-11 16:45:52 · 574 阅读 · 0 评论 -
浙中大的新生看过来!!
计算机专业的学弟学妹们是不是对于我们专业充满了期待啊!现在这份指南将带你快速了解你初期需要怎么学习。开始肯定需要学习如何写出一段符合需要的程序,大一也将以c语言作为基础开始你的程序猿生活(开玩笑)——————————我不是分割线————————————首先敲代码肯定需要编译器,个人推荐codeblocks 地址:http://www.codeblocks.org/—...原创 2018-09-01 20:46:50 · 1068 阅读 · 0 评论 -
zcmu-4944: 字符串处理
Description读入两个字符串,字符串除了数字还可能包括 '—'、'E'、'e'、'.',相加之后输出结果,如果是浮点型,要求用科学计数法表示(最多包含10个有效数字)。Input输入包含多组测试数据。每组输入占两行,每行一个字符串,测试数据保证字符串的构成严格按照题目中的描述。Output输出两个数字相加的结果,每组输出占一行。Sample Input34....原创 2018-10-08 17:39:54 · 471 阅读 · 0 评论 -
zcmu-1930帽子戏法
Description小A家有很多很多顶帽子初始时帽子都是独立分开的,每顶帽子都有一个编号用于区分.小A会有以下操作之一:1.将编号为y的帽子所在的帽子堆放在编号为x的帽子所在的帽子堆顶上,如果x,y在同一堆则不做任何动作.2.小A会向你询问编号为x的帽子上方有多少只帽子. Input输入有多组数据:第一行输入N,M分别为帽子数和操作数(1<=N<=40000,1...原创 2018-10-08 17:42:53 · 533 阅读 · 0 评论 -
zcmu-4959ly的新闹钟
Description最近ly买了一个新闹钟,每天盯着这个闹钟看,越看越喜欢....为了不让ly浪费时间,wjw决定给ly提出一个要求....从x点整到y点整,时针和分针总共会碰到几次?(虽然这个要求一样是在浪费时间.....) Input第一行输入一个整数T表示数据数量,接下来的T行,每行包含两个正整数 A , B ( 0 <= A < B <= 24 ) ...原创 2018-10-08 17:45:08 · 210 阅读 · 0 评论 -
zcmu-1931 wjw的剪纸
ly最近要生日了,wjw决定送一份礼物给这个傻孩子,考虑了一下礼物,发现贵的买不起,远的不想去,麻烦的不想做...最后wjw决定剪一张好看的图案给ly当作礼物,毕竟礼轻情意重嘛,情谊重就行了!现在wjw手里有一张正方形的彩纸,这张彩纸的边长是n,由n*n个小正方形组成,现在wjw沿着小正方形的边把这张彩纸剪成两部分,为了美观,他决定剪成形状完全相同的两部分...这时,wjw突发奇想,想知道到底能...原创 2018-10-08 17:48:42 · 151 阅读 · 0 评论 -
zcmu-2203 Robbery
It is nighttime and Joe the Elusive got into the country's main bank's safe. The safe has n cells positioned in a row, each of them contains some amount of diamonds. Let's make the problem more comfor...原创 2018-10-08 17:53:35 · 126 阅读 · 0 评论 -
zcmu-4933: 二叉排序树
Description输入一系列整数,建立二叉排序数,并进行前序,中序,后序遍历。Input输入第一行包括一个整数n(1<=n<=100)。接下来的一行包括n个整数。Output可能有多组测试数据,对于每组数据,将题目所给数据建立一个二叉排序树,并对二叉排序树进行前序、中序和后序遍历。每种遍历结果输出一行。每行最后一个数据之后有一个空格。Sample Input...原创 2018-10-08 18:13:25 · 190 阅读 · 0 评论 -
zcmu-2213:Reflection
Descriptiontime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFor each positive integer n consider the integer ψ(n) which is obtain...原创 2018-10-09 17:54:15 · 179 阅读 · 0 评论 -
矩阵快速幂板子
ll a0,a1,p,q,k; struct matrix{ ll a[2][2]; matrix() { memset(a,0,sizeof a); }};matrix operator *(const matrix &x,const matrix &y)//矩阵相乘函数 { matrix res; ...原创 2019-09-09 21:11:45 · 101 阅读 · 0 评论