2019-2020 10th BSUIR Open Programming Championship. Semifinal GYM链接https://codeforces.com/gym/103637 K 题意: 给定$n$个二进制下不超过$m$位的数,找到一个二进制下不超过$m$位且至多有$k$个…
Ural Sport Programming Championship 2015 A - The First Day at School 题目描述:给出课程安排,打印一个课程表. solution 暴力模拟. B - Maths 题目描述:给定一个数\(n\),找出一个序列\(a_i\)满足\(\forall i \in [2, n], \sum_{j=1}^{j \leq i} a_j\) 有\(a_i\)个约数. solution 暴力搜索,发现和不会超过\(2 \times 10^6\),…
Tree Ming and Hong are playing a simple game called nim game. They have nn piles of stones numbered 11 to nn ,the ii-th pile of stones has a_iai​ stones. There are n - 1n−1 bidirectional roads in total. For any two piles, there is a unique path from…
感想: 今天三个人的状态比昨天计院校赛的状态要好很多,然而三个人都慢热体质导致签到题wa了很多发.最后虽然跟大家题数一样(6题),然而输在罚时. 只能说,水题还是刷得少,看到签到都没灵感实在不应该. 题目链接:http://acm.zju.edu.cn/onlinejudge/showContestProblems.do?contestId=391 A:简单贪心,按高度sort一下就好了,这里用优先队列处理 #include <cstdio> #include <queue> #i…
We call a string as a 0689-string if this string only consists of digits '0', '6', '8' and '9'. Given a 0689-string $s$ of length $n$, one must do the following operation exactly once: select a non-empty substring of $s$ and rotate it 180 degrees. Mo…
BaoBao has just found a grid with $n$ rows and $m$ columns in his left pocket, where the cell in the $j$-th column of the $i$-th row (indicated by $(i, j)$) contains an arrow (pointing either upwards, downwards, leftwards or rightwards) and an intege…
Travel There are nn planets in the MOT galaxy, and each planet has a unique number from 1 \sim n1∼n. Each planet is connected to other planets through some transmission channels. There are mm transmission channels in the galaxy. Each transmission cha…
Swap There is a sequence of numbers of length nn, and each number in the sequence is different. There are two operations: Swap the first half and the last half of the sequence (if nn is odd, the middle number does not change) Swap all the numbers in…
Angel's Journey “Miyane!” This day Hana asks Miyako for help again. Hana plays the part of angel on the stage show of the cultural festival, and she is going to look for her human friend, Hinata. So she must find the shortest path to Hinata’s house.…
Tasks It's too late now, but you still have too much work to do. There are nn tasks on your list. The ii-th task costs you t_iti​seconds. You want to go to bed TT seconds later. During the TT seconds, you can choose some tasks to do in order to finis…
链接:https://nanti.jisuanke.com/t/39277 思路: 一开始看着很像树分治,就用树分治写了下,发现因为异或操作的特殊性,我们是可以优化树分治中的容斥操作的,不合理的情况只有当两点在一条链上才存在,那么直接一遍dfs从根节点向下跑途中维护一下前缀和,把所有情况中不合理情况造成的值修正. 这样的话时间复杂度就可以降得非常低了,感觉还可以优化,但是懒得写了 代码耗时:142ms. 实现代码: #include<bits/stdc++.h> using namespace…
链接:https://codeforc.es/gym/102267 A. Picky Eater 直接比较 int main(){ int x ,y; scanf("%d %d" ,&x ,&y); if(x>=y){ ; } ; ; } B. Primes 素数筛,log判断 ; int vis[maxn]; void is_prime(int N){ ;i<=N;i++){ if(!vis[i]){ prime[num_prime++] = i; vis…
Problem A : Electric Bill 题目大意:进行电量分级制收费,1000kwh及以下一档收费,1000kwh以上按另一档收费,给出每个人的电量总额,问每人应支付多少钱. 思路:基础if else题,对于每个电量判断是否大于1000,再分别计算≤1000的价格和>1000的价格,最后相加并输出. #include<algorithm> #include<iostream> #include<cstring> #include<cstdio&g…
M-SOLUTIONS Programming Contest 2020 题解 目录 M-SOLUTIONS Programming Contest 2020 题解 A - Kyu in AtCoder B - Magic 2 C - Marks D - Road to Millionaire E - M's Solution F - Air Safety 题目质量好高啊,做完感觉好难涨智商了诶.(除了某一道程序又臭又长的F) A - Kyu in AtCoder 我们可以放很多个if来判断,但…
QUIZ 7COMP9021 PRINCIPLES OF PROGRAMMING$ python3 quiz_7.pyEnter four integers: 0 2 2 8Here is the grid that has been generated:1 1 0 1 1 1 1 11 0 0 1 0 0 1 0Enter four integers: 3 0 4 1Will compute the number of good paths from (3, 0) to (4, 1)...Th…
Exercise Session for Introductioninto Computer Science(for non Informatics studies, TUM BWL)(IN8005), WS 2019/2020Sheet 8• Homework are to be worked out independently.• Submission is done via moodle.https://www.moodle.tum.de/course/view.php?id=49786•…
1001 : http://ideone.com/4omPYJ1002 : http://ideone.com/BZr9KF1003 : http://ideone.com/48NJNh1004 : 1005 : 1006 : 1007 : 1008 : 1009 : 1010 : 1011 : 1012 : 1013 : 1014 : 1015 : 1016 : 1017 : 1018 : 1019 : 1020 : 1021 : 1022 : 1023 : 1024 : 1025 : 102…
B. Coach 题目连接: http://www.codeforces.com/contest/300/problem/A Description A programming coach has n students to teach. We know that n is divisible by 3. Let's assume that all students are numbered from 1 to n, inclusive. Before the university progra…
Description A programming coach has n students to teach. We know that n is divisible by 3. Let's assume that all students are numbered from 1 to n, inclusive. Before the university programming championship the coach wants to split all students into g…
Ural doctors worry about the health of their youth very much. Special investigations showed that a lot of clever students instead of playing football, skating or bicycling had participated in something like Programming Olympiads. Moreover, they call…
SELECT * FROM user , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,…
JQUERY 插件开发——CITYLINKAGE(省.市.县城市联动选择) 第一部分:背景   开发源于需求,本次城市联动选择插件算是我写插件的一个特例吧,不是我目前工作需要些的,算是兴趣驱使吧.之前呢,一直想写这个插件,然后错过了一个写这个插件的机会(这个得回顾到很久以前了...此处省去N个字).然后最近“瘾”又犯了,呵呵,随手就拿这个“欠”了很久的插件开刀了.大家都应该知道“某宝”的这个插件写的还是很强大的,支持到街道(镇)级别...可见他们维护的前端数据有多大...不过呢,临渊羡鱼,不如退…
先来看看效果图吧,嘻嘻~~~~~~~~~~~~~~~~~~~· 代码在下面: 示例一: html: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>省市区三级联动,可自动补全</title> <link href="css/select.css" rel="stylesheet" /> <…
Circle   Memory Limit: 32768KB   64bit IO Format: %lld & %llu Status Description Your task is so easy. I will give you an undirected graph, and you just need to tell me whether the graph is just a circle. A cycle is three or more nodes V1, V2, V3, ..…
 Team named TAH    不管一个人多么有才能,但是集体常常比他更聪明和更有力. --奥斯特洛夫斯基     *introduce team and teamate 先说说TAH的含义,是风雨兼程的首写字母简称,代表我们团队的同一种意志与信仰.创建这个团队的初衷是因为项目,然而比赛并不是最终的目的也不是永久的目标,后来发现,将一个项目完整的实现并且运行起来,实在需要很多时间与努力,慢慢地,我们开始着眼于自身的学习与项目有效的分工. TAH里的每个人都对此付出过很多时间与努力,林晓君负…
文:徐超,<React进阶之路>作者 授权发布,转载请注明作者及出处 React 深入系列2:组件分类 React 深入系列,深入讲解了React中的重点概念.特性和模式等,旨在帮助大家加深对React的理解,以及在项目中更加灵活地使用React. React 组件有很多种分类方式,常见的分类方式有函数组件和类组件,无状态组件和有状态组件,展示型组件和容器型组件.好吧,这又是一篇咬文嚼字的文章.但是,真正把这几组概念咬清楚.嚼明白后,对于页面的组件划分.组件之间的解耦是大有裨益的. 函数组件和…
文:徐超,<React进阶之路>作者 授权发布,转载请注明作者及出处 React 深入系列3:Props 和 State React 深入系列,深入讲解了React中的重点概念.特性和模式等,旨在帮助大家加深对React的理解,以及在项目中更加灵活地使用React. React 的核心思想是组件化的思想,而React 组件的定义可以通过下面的公式描述: UI = Component(props, state) 组件根据props和state两个参数,计算得到对应界面的UI.可见,props 和…
文:徐超,<React进阶之路>作者 授权发布,转载请注明作者及出处 React 深入系列4:组件的生命周期 React 深入系列,深入讲解了React中的重点概念.特性和模式等,旨在帮助大家加深对React的理解,以及在项目中更加灵活地使用React. 组件是构建React应用的基本单位,组件需要具备数据获取.业务逻辑处理.以及UI呈现的能力,而这些能力是要依赖于组件不同的生命周期方法的.组件的生命周期分为3个阶段:挂载阶段.更新阶段.卸载阶段,每个阶段都包含相应的生命周期方法.因为是深入系…
文:徐超,<React进阶之路>作者 授权发布,转载请注明作者及出处 React 深入系列5:事件处理 React 深入系列,深入讲解了React中的重点概念.特性和模式等,旨在帮助大家加深对React的理解,以及在项目中更加灵活地使用React. Web应用中,事件处理是重要的一环,事件处理将用户的操作行为转换为相应的逻辑执行或界面更新.在React中,处理事件响应的方式有多种,本文将详细介绍每一种处理方式的用法.使用场景和优缺点. 使用匿名函数 先上代码: //代码1 class MyCo…
DataFrame是一个表格型的数据结构,含有一组有序的列,每列可以是不同的值类型(数值.字符串.布尔值等),DataFrame就行索引也有列索引,可以被看做由Series组成的字典(共用同一个索引).跟其他类似的数据结构相比,DataFrame中面向行和面向列的操作基本上是平衡的. 构建DataFrame的方法有很多,最常用的一种是直接传入一个由等长列表或Numpy数组组成的字典. 结果DataFrame会自动加上索引,且全部列会被有序排列. In [10]: import pandas as…