![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
大一寒假打卡专用
文章平均质量分 78
Connorxuan
这个作者很懒,什么都没留下…
展开
-
2021.3.4打卡
搬桌子The famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure.The floor has 200 rooms each on the north side and south side along the corridor. Recently the Company made a plan to reform its s原创 2021-03-05 00:29:56 · 217 阅读 · 1 评论 -
2021.3.2打卡
田忌赛马大约2300年前,齐国大将田忌喜欢和国王赛马,并且约定:每赢一场,对方就要付200元。假设已知田忌和国王的各自马匹的速度都不相同,请计算田忌最好的结果是什么。Input输入包含多组测试样例。每组样例的第一行是一个整数n(n <= 1000),表示田忌和国王各自参赛的马匹数量。接下来一行的n个整数表示田忌的马的速度,再接下来一行的n个整数表示国王的马的速度。n为0时,表示输入数据的结束。Output每组数据输出一行,表示田忌最多能够赢得的金额。Sample Input原创 2021-03-03 01:26:42 · 185 阅读 · 0 评论 -
2021.3.1打卡
排序已知每一位同学的解题数量和罚时,这次希望你能输出排名靠前的若干同学的名单。注:排名首先依据做题数量,若做题数量相同,则比较罚时,罚时少的排名靠前。Input第一行是数据组数C,代表有C组测试实例。每一组数据第一行两个整数N和M,N代表有N个人的成绩,M表示老师需要你输出前M名的名单。接下来N行,每一行依次给出名字Name,做出的题目数量num和罚时time1 ≤ C ≤ 102 < M ≤ N ≤ 1000Name的长度最大为101 ≤ num ≤ 1010 ≤ time原创 2021-03-02 00:40:04 · 463 阅读 · 0 评论 -
2021.2.6寒假打卡Day30
Girls and BoysProblem Descriptionthe second year of the university somebody started a study on the romantic relations between the students. The relation “romantically involved” is defined between one girl and one boy. For the study reasons it is necessar原创 2021-02-06 23:41:03 · 118 阅读 · 0 评论 -
2021.2.4寒假打卡Day28
SearchA strange liftProblem DescriptionThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When you at floor i,if you press the原创 2021-02-05 02:51:25 · 130 阅读 · 0 评论 -
2021.1.31寒假打卡Day24
CCUT20210131 大一E#include<iostream>using namespace std;int main(){ int t; cin>>t; while(t--){ int x,y,z,ans; cin>>x>>y>>z; ans=(z-y)/x*x+y; cout<<ans<<endl; }原创 2021-01-31 23:44:52 · 103 阅读 · 0 评论 -
2021.1.28寒假打卡Day21
求n个数的最小公倍数#include<iostream>using namespace std;int gcd(int a,int b){ int r=a%b; if(r==0) return b; else return gcd(b,r);}int nlcm(int a[],int b){ while(b!=1){ a[b-2]=a[b-1]*a[b-2]/gcd(a[b-1],a[b-2]); --b; }原创 2021-01-30 00:54:39 · 140 阅读 · 0 评论 -
2021.1.27寒假打卡Day20
哈尔滨学院2021ACM冬令营–字符串专题A TEX Quotes#include<iostream>#include<string>using namespace std;int main(){ string s; int cnt=0; while(cin>>s){ int len=s.length(); for(int i=0;i<len;i++){ if(s[i]=='"'){ ++cnt; if(cnt%2==原创 2021-01-28 03:50:14 · 216 阅读 · 0 评论 -
2021.1.26寒假打卡Day19
Luogu P1182给 n 个数,分成连续的 m 段,求分段后每段和的最大值的最小值。标准二分法#include<iostream>using namespace std;const int maxn=1e5+10;int n,m,a[maxn];bool check(int x){ int sum=0,cnt=0; for(int i=0;i<n;i++) if(sum+a[i]<=x) sum+=a[i]; else sum=a[i],++cn原创 2021-01-27 00:04:37 · 101 阅读 · 0 评论 -
2021.1.25寒假打卡Day18
CF #673(Div.3)A - Odd Divisor一直除以 2 ,如果最后不是 1 ,就含有Odd Divisor顺便吐槽一下这奇妙的机翻,真就直译(原文:Check if n has an odd divisor, )#include<iostream>using namespace std; bool have(unsigned long long int n){ if(n==1) return false; else if(n % 2 == 0) retu原创 2021-01-26 01:57:27 · 150 阅读 · 0 评论 -
2021.1.20寒假打卡Day16
A - Wizard of OrzThere are n digital panels placed in a straight line. Each panel can show any digit from 0 to 9. Initially, all panels show 0.Every second, the digit shown by each panel increases by 1. In other words, at the end of every second, a panel原创 2021-01-22 05:32:58 · 372 阅读 · 1 评论 -
2021.1.21寒假打卡Day17
丑数Problem Description丑数的定义是这样的——一个数,如果它分解后的素因子最多只有2、3、5、7四种,这个数则称为“丑数”。比如,前20个丑数是:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27。现在你的任务是:给你一个数,你能判断是否是丑数吗?Input输入数据的第一行首先是一个整数C,表示测试数据的个数,然后是C组数据,每组测试数据包含一个整数n(1 <= n <= 2^3原创 2021-01-22 02:52:23 · 289 阅读 · 0 评论 -
2021.1.19寒假打卡Day15
P1241 括号序列定义如下规则序列(字符串):空序列是规则序列;如果S是规则序列,那么(S)和[S]也是规则序列;如果A和B都是规则序列,那么AB也是规则序列。例如,下面的字符串都是规则序列:(),[],(()),([]),()[],()[()]而以下几个则不是:(,[,],)(,()),([()jh15024551551@96371现在,给你一些由(,),[,]构成的序列,你要做的,是补全该括号序列,即扫描一遍原序列,对每一个右括号,找到在它左边最靠近它的左括号匹配,如原创 2021-01-20 05:10:11 · 189 阅读 · 0 评论 -
2021.1.18寒假打卡Day14
洛谷题单 动态规划1P1434 [SHOI2002]滑雪Michael 喜欢滑雪。这并不奇怪,因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael 想知道在一个区域中最长的滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子:1 2 3 4 516 17 18 19 615 24 25 20 714 23 22 21 813 12原创 2021-01-20 00:49:14 · 151 阅读 · 0 评论 -
2021.1.17寒假打卡Day13
A - 小心FST!Mia Hossain is a very good competitive programmer & spends his most of the time in programming contest. His wife is very much interested in competitive programming. In her free time she sits beside him & curiously watches how he solves p原创 2021-01-18 03:29:28 · 445 阅读 · 0 评论 -
2021.1.15寒假打卡Day12
第十二届蓝桥杯大赛模拟赛(第二期)填空题小明要用二进制来表示 1 到 10000 的所有整数,要求不同的整数用不同的二进制数表示,请问,为了表示 1 到 10000 的所有整数,至少需要多少个二进制位?14Win10计算器是个好东西????请问在 1 到 2020 中,有多少个数既是 4 的整数倍,又是 6 的整数倍。168穷举呀穷举一个无向图包含 2020 条边,如果图中没有自环和重边,请问最少包含多少个结点?65这个我不会做,编了一个2019????后来百度了原创 2021-01-15 17:29:13 · 255 阅读 · 0 评论 -
2021.1.14寒假打卡Day11
C - 1-SATProblem StatementGiven are N strings S1,S2,…,SN. Each of these is a non-empty string consisting of lowercase English letters, with zero or one ! added at the beginning.We say a string T to be unsatisfied when it matches one of S1,S2,…,SN regard原创 2021-01-15 03:27:16 · 255 阅读 · 0 评论 -
2021.1.13寒假打卡Day10
今天在水牛客题的时候,碰到了这么一道题:原谅下饭如我,当时我就懵了。。。那么啥叫移位运算呢?我默默打开了才知道移位运算符有两个<<和>>,属于双目运算符。<<:左移 左边高位舍弃,右边低位补零。若高位没有丢失信息,则<<n效果等同于* pow(2,n)。41883 如下101000111001101141883 << 1 如下010001110011原创 2021-01-14 02:57:08 · 176 阅读 · 0 评论 -
2021.1.12寒假打卡Day9
P3613 【深基15.例2】寄包柜题目描述超市里有 n (n ≤ 105) 个寄包柜。每个寄包柜格子数量不一,第 i 个寄包柜有 ai (ai ≤ 105) 个格子,不过我们并不知道各个 ai 的值。对于每个寄包柜,格子编号从 1 开始,一直到 ai 。现在有 q (q ≤ 105) 次操作:1 i j k:在第 i 个柜子的第 j 个格子存入物品 k (0 ≤ k ≤ 109)。当 k=0k=0 时说明清空该格子。2 i j:查询第 i 个柜子的第 j 个格子中的物品是什么,保证查询的柜子原创 2021-01-13 04:35:38 · 215 阅读 · 0 评论 -
2021.1.11寒假打卡Day8
哈尔滨学院2021ACM冬令营Day2(20级)The puzzleProblem DescriptionKayaking is playing a puzzle game containing n different blocks. He marks the blocks with integers from 1 to n, which show the blocks’ original positions. Each time he can exchange two blocks and he w原创 2021-01-12 03:01:13 · 208 阅读 · 0 评论 -
2021.1.10寒假打卡Day7
哈尔滨学院2021ACM冬令营训练赛(一)A. Short SubstringsAlice guesses the strings that Bob made for her.At first, Bob came up with the secret string a consisting of lowercase English letters. The string a has a length of 2 or more characters. Then, from string a he bui原创 2021-01-11 03:13:49 · 329 阅读 · 0 评论 -
2021.1.9寒假打卡Day6
哈尔滨学院2021ACM冬令营Day1E - ACboy needs your help again!ACboy was kidnapped!!he miss his mother very much and is very scare now.You can’t image how dark the room he was put into is, so poor ???? .As a smart ACMer, you want to get ACboy out of the monster’s原创 2021-01-10 02:25:18 · 248 阅读 · 0 评论 -
2021.1.8寒假打卡Day5
寒假打卡 Day 5数据结构队列????规则:先进先出(和我们食堂里排队一样,先来的人先轮到打饭 食堂好像不用排队 )操作:enqueue(x); //在队列末尾添加元素xdequeue(); //从队列开头取出元素isEmpty(); //检查队列是否为空isFull(); //检查队列是否已满Queue????There are n processes in a queue. Each process has namei and timei. The round-ro原创 2021-01-09 01:06:04 · 294 阅读 · 0 评论 -
2021.1.7寒假打卡Day4
寒假打卡 Day 4直入主题,瞧瞧昨天的遗留问题:Shell Sort????Shell Sort is a generalization of Insertion Sort to arrange a list of n elements A. insertionSort(A, n, g) for i = g to n-1 v = A[i] j = i - g while j >= 0 && A[j] &原创 2021-01-07 22:50:48 · 180 阅读 · 0 评论 -
2021.1.6寒假打卡Day3
寒假打卡Day3今天开始看的是 这本书???? d6tc我就截取看到的重点做了些笔记 (绝对不是因为懒(/ω\))算法的效率复杂度分为两方面:Time ComplexitySpace Complexity在竞赛中,题目限制通常为 1s ,即大约108 次操作,因此我们通常遇到的都是时间复杂度过高的问题。表示法:Big-Oh-Notation诸如O(n),O(n2)···O(g(n)),g(n)可以认为是1s内的操作次数e.g. 给出m个数ai (i=1,2,···,m),找出最原创 2021-01-06 23:22:51 · 228 阅读 · 0 评论 -
2021.1.5寒假打卡Day2
寒假打卡Day2(今天是今天写的(/ω\)) 今天看的是递归哦求两个数的最大公因数这题因为太简单所以没有oj有,那就没有链接啦(bushi#include <iostream>using namespace std;int gcd(int a,int b){ if(a%b==0) return b; else return gcd(b,a%b); }int main(){ int a,b; cin>>a>>b; cout<<gc原创 2021-01-05 23:49:35 · 150 阅读 · 0 评论 -
2021.1.4寒假打卡Day1
寒假打卡Day1(说是说Day1,其实是Day2补写的(/ω\))总之今天很水,划了一天的水。。。problem 1: Way Too Long WordsSometimes some words like “localization” or “internationalization” are so long that writing them many times in one text is quite tiresome.Let’s consider a word too long, if原创 2021-01-05 22:35:17 · 292 阅读 · 0 评论