首页 > TAG信息列表 > onsite

XIX Open Cup Onsite: E - Power of Function (数位+思维)

观察到:我们可以从高位到第低位枚举第一个l和r不同的位置,记为diff,那么使得m取得最大的n有两种情况:要么n=r,要么n!=r,如果n!=r,那么要使得m最大,只有在 \[diff<=x<最大的位数 \]时,在[0,x-1]位上,n与r相同,x位上n=mr[x]-1,[x+1,最大位数]上全部填上k-1,故可以枚举x,加一个前缀和优化,复杂度是

The 2021 CCPC Weihai Onsite

比赛链接: https://codeforces.com/gym/103428 A. Goodbye, Ziyin! 题目大意: \(n - 1\) 条边连接 \(n\) 个点,但是不知道根节点是哪个,判断有多少个节点作为根节点时,树是二叉树。 思路: 当某个节点的度等于 3 的时候,它肯定不能作为根节点。 当某个节点的度大于 3 的时候,不论如何都不可

3个月疫情倒闭了近90000家企业,为什么互联网公司每天都在招人?招聘一个程序员要多少成本

1、假如一个勤奋的中级程序员工程师,一年薪水 20w 的话,一年 365 天,大约有 52 周,扣掉双休日还有 365-52x2 = 261 天,加上法定假大概 10 天,休假大约 3 周,还有乱七八糟的病假、事假大约 10 天,也就是说,工作的时间只有 261-10-3x7-10=221 天,平均每个工作日的薪水是 200k/221≈905元,

The 2021 CCPC Guangzhou Onsite, Practice Session China, Guangzhou, November 13, 2021(B题

Kongming’s Password Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 512 megabytes In the ancient period of Three Kingdoms, Zhuge Kongming, the Prime Minister of Kingdom Shu, was the most famous and wise statesman

2020-2021 ICPC, NERC, Northern Eurasia Onsite BEIJ 题解

B. Button lock 题意:有 \(d\) 个 01 按键以及一个 reset 按键,你需要把所有题目给定的 \(n\) 个密码全部表示一遍。只有按下 reset 按键后才能使所有 01 按键弹回。试使得按键次数最少。 做法:可以观察到 \(ans = \sum_{u \in endvertex} (bitcount(u) + 1) - 1\),接下来要尽可能使 a

比赛题目训练系列08 (2019 China Collegiate Programming Contest Qinhuangdao Onsite)

比赛题目训练系列07 (2019 China Collegiate Programming Contest Qinhuangdao Onsite) 训练网址 A. Angle Beats 给定一个点,问有多少条点对,可以与这个点构成一个直角三角形。思路很简单,就是非常卡时间。我们分为 A

「ACM Shenyang Onsite 2016」E.Counting Cliques(dfs暴力+优化)

描述 传送门:我是传送门 A clique is a complete graph, in which there is an edge between every pair of the vertices. Given a graph with N vertices and M edges, your task is to count the number of cliques with a specific size S in the graph.  输入 The first l

2020 China Collegiate Programming Contest Changchun Onsite D. Meaningless Sequence

题目链接 https://codeforces.com/gym/102832/problem/D 题意 给定\(a_n\) 递推式,求\(0-n\)项和。 思路 找个规律如下图 令\(sum[i]\) 表示前\(2^{i} - 1\)项和的答案,由图可知 \(sum[i] = sum[i - 1] * c + sum[i - 1]\)。 对于二进制最高位的1,直接统计贡献即可, 对于后面的 1,考

2017 ICPC Asia Xian Onsite H. Arrangement for Contests #线段树#

Portal 很容易想到贪心+线段树查询维护 UVa上这题是假数据 O(nk)暴力都能0ms AC... 此外输入可能是空文件 坑!!! #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn = 1e5 + 10; struct node { int l, r, minv, minp, lz; } tree[maxn << 2]

2019 China Collegiate Programming Contest Qinhuangdao Onsite

目录 Contest Info Solutions A. Angle Beats D. Decimal F. Forest Program I. Invoker J. MUV LUV EXTRA Contest Info Practice Link Solved A B C D E F G H I J K L 5/12 O - - O - O - - - O Ø - O 在比赛中通过 Ø 赛后通过 ! 尝试了但是失败了 - 没有

Gym - 100920E 2010-2011 OpenCup IX Onsite, II Yandex Summer School E. Paint 暴力+状压DP

题面 题意:给你n(20)个点,m(40条边),让你给每条边染一种颜色,白色0元,红色2元,蓝色1元,现在要保证每一条白边相邻的有一条红边,问至少花多少 题解:刚开始想的时候,好像觉得只用染红色和白色就够了?乱搞一通就发现不对了         例如:5个点,5条边:1 2,   2 3  ,  3 4 , 4 5

CCPC-Wannafly Winter Camp Day1 (Div2, onsite) A B C E F I J

   A 机器人 链接:https://www.cometoj.com/contest/7/problem/A?problem_id=92 思路: 分两大类讨论: 1. B区没有点: (1)点都在起点左边 (2)点都在起点右边 (3)起点两边都有点 2.B区有点: (1)两个区的点都在起点左边 (2)两个区的点都在起点右边 (3)起点两边都有点 分类讨论下就好了,注意一个特殊情

CCPC-Wannafly Winter Camp Day4 (Div2, onsite)

D: /*贪心的 构造出来欧拉回路就是把度为3的点改一改方法是把4周的边隔一个扔一个这些扔掉的边一定要走两遍*/#include<cstdio>#include<cstring>#include<iostream>#define maxn 1010using namespace std;int n,m,ans;int main(){ scanf("%d%d",&n,&m);n--;m--; if(n==1){

牛客网暑期ACM多校训练营(第四场) J Hash Function /CCPC-Wannafly Winter Camp Day7 (Div2, onsite) E 线性探查法

链接:https://ac.nowcoder.com/acm/contest/142/J 来源:牛客网   Chiaki has just learned hash in today's lesson. A hash function is any function that can be used to map data of arbitrary size to data of fixed size. As a beginner, Chiaki simply chooses a hash ta