ICode9

精准搜索请尝试: 精确搜索
  • CF1477B Nezzar and Binary String2022-08-16 21:32:55

    题目链接: 洛谷 Codeforces Solution 我一开始以为是道结论题,一直想贪心策略,后来卡了二十多分钟,感觉不行,赶紧换方法。 这题不能正着做,只能反过来,从答案串往原串推,因为正着做有后效性,十分恶心。反过来做以后,顺序就变了,即先改后看,对于每一次检查的区间 \([l,r]\),我们这次修改,一定要改

  • CF1477A Nezzar and Board2021-10-15 09:01:52

    考虑 \(2x - y\) 我们改为 \(x + (x - y)\) 是一个更好的形式。 我们可以表示一个数为\(x_i + \sum_{j,k}(x_j - x_k) = K\) 我们考虑移到 \(\sum_{j,k}(a_j - a_k) = K - x_i\) 因为发现选取的数不会被擦除,所以不要自以为是的理解题意。 我们可以发现任何一个数都可以表示其他的

  • Solution -「CF 1477A」Nezzar and Board2021-05-10 14:33:30

    Description Link. $ n $ distinct integers $ x_1,x_2,\ldots,x_n $ are written on the board. Nezzar can perform the following operation multiple times. Select two integers $ x,y $ (not necessarily distinct) on the board, and write down $ 2x-y $ . Note tha

  • CF1477A Nezzar and Board(数论)(代办)2021-04-28 22:02:06

    CF1477A Nezzar and Board void solve() { cin >> n >> m; for(int i=1;i<=n;i++){ scanf("%lld",&a[i]); } /// 2x - y /// ll d = 0; for(int i=1;i<=n;i++){ d = __gcd(d,(a[i]-a[1])); }

  • CF1477A Nezzar and Board2021-03-13 16:36:02

    CF1477A Nezzar and Board 题意: 黑板上有 \(x_1,x_2,x_3,x_n\) 个数,可以在黑板上选择两个数,并在黑板上写上 \(2x- y\) ,求是否能在黑板上写上要求的数\(k\); 样例输入: 6 2 1 1 2 3 0 2 3 7 2 -1 31415926 27182818 2 1000000000000000000 1 1000000000000000000 2 -10000

  • Nezzar and Lucky Number2021-03-01 00:01:44

    题目: Nezzar’s favorite digit among 1,…,9 is d. He calls a positive integer lucky if d occurs at least once in its decimal representation. Given q integers a1,a2,…,aq, for each 1≤i≤q Nezzar would like to know if ai can be equal to a sum of several (o

  • Nezzar and Colorful Balls2021-02-28 23:59:14

    题目: Nezzar has n balls, numbered with integers 1,2,…,n. Numbers a1,a2,…,an are written on them, respectively. Numbers on those balls form a non-decreasing sequence, which means that ai≤ai+1 for all 1≤i<n. Nezzar wants to color the balls using the mi

  • [CF1477A] Nezzar and Board - 结论,裴蜀定理2021-02-28 19:35:34

    [CF1477A] Nezzar and Board - 结论,裴蜀定理 Description 原本黑板上写着 \(n\) 个数,先在每次操作可以选取其中两个数 \(x,y\),并写上 \(2x-y\) 而选取的数不会消失。问最终能否在黑板上写下 \(k\)。 Solution 手玩发现,通过不断地 2x-y,恰好可以凑出所有系数和为 1 的形式 相当于是

  • [CF1478B] Nezzar and Lucky Number - 结论2021-02-28 19:34:56

    [CF1478B] Nezzar and Lucky Number - 结论 Description 给定正整数 \(d(1\le d\le 9)\),如果正整数 \(k\) 的十进制表示中含有数码 \(d\),我们就把 \(k\) 称为“幸运数”。现在,给你一个长度为 \(q(1\le q\le 10^{4})\) 的数组 \(a_{1},a_{2},…,a_{q}(1\le a_{i}\le 10^{9})\),请依

  • CF1477D Nezzar and Hidden Permutations(构造)2021-02-10 23:01:12

    CF1477D Nezzar and Hidden Permutations(构造) 题目大意 你需要构造出两个排列 p, q,满足 m 个限制,第 i 个限制为 $ (p_{x_i}-p_{y_i})\times (q_{x_i}-q_{y_i}) \ge 0$,最大化 \(\sum [p_i \neq q_i]\) \(1 \le n,m \le 5\times 10^5\) 解题思路 还是牛逼的猜结论和构造题,但是我哪一

  • codeforces 698 Div1 A Nezzar and Board (构造+数论)2021-02-10 00:00:07

    题目链接:https://codeforces.com/contest/1477/problem/A A. Nezzar and Board time limit per test 2 seconds memory limit per test 512 megabytes input standard input output standard output nn distinct integers x1,x2,…,xnx1,x2,…,xn are written on the board.

  • CF1477 E. Nezzar and Tournaments 题解2021-02-06 12:34:40

    CF1477 E. Nezzar and Tournaments 题解 可以发现第i个人的得分= 可以发现如果固定了\(c_1\),则最优的放置是:第二队放在最前面,第一队放在最后面,第一队升序,第二队降序就可以了。 可以发现这是关于\(c_1\)的单峰函数,所以可以分别对于\(a_1...a_n\),\(b_1...b_m\)三分查找就可以了。

  • Codeforces1477B-Nezzar and Binary String2021-01-31 16:35:10

    题目大意:两个01串,q个询问,每次询问给定lr,串1lr内所有位置全为0或1,否则NO,询问后可以对lr内严格小于一半区间的字符进行修改,问q次询问过后,串1能否变为串2。 题目链接   解题思路:逆转时间,串1变为串2变为串2变串1,这样的好处是,对于询问来说,可以先修改再保证区间全为0或1,接下来就模拟就

  • Codeforces Round #698 (Div. 2) D题Nezzar and Board (数论,裴蜀定理)2021-01-31 16:33:16

    传送门 题意 黑板上有n个不同的数\(x_1,x_2,\cdot,x_n\),你可以选择黑板上已有的两个数\(x,y\),并将\(2x-y\)写在黑板上,问你通过一系列操作是否能写下数字k。 数据范围 \[2\leq n\leq 2\times 10^5 \]\[-10^{18}\leq k \leq 10^{18} \]\[-10^{18}\leq x_i\leq 10^{18} \]题解 首先

  • codeforces1478F Nezzar and Nice Beatmap2021-01-30 15:33:27

    题目: 在平面上按序给定 n n n个点,问能不能将这些点重新排序,使任意三个相邻的点形成的角都是锐角,若能就输出新的序列,不能输出-1。 (

  • Codeforces Round #698 (Div. 2)(A、B、C、D)2021-01-29 21:05:15

    Solved A、Nezzar and Colorful Balls B、Nezzar and Lucky Number C、Nezzar and Symmetric Array D、Nezzar and Board A、Nezzar and Colorful Balls 数量最多的数字的数量即是答案。 int a[105]; int num[105]; int main() { int T,n; cin>>T; while(T--){

  • Codeforces Round #698 (Div. 2) D. Nezzar and Board 裴蜀定理2021-01-29 15:03:45

    https://codeforces.ml/contest/1478/problem/D 目录 题意分析Code 题意 黑板上有n个数,你可以任选两个数x,y,然后将2x-y写到黑板上,问k是否能被写到黑板上 分析 我们将2x-y拆开来看一下,x+x-y相当于x这个数加上他和y的差值,那么我们可以处理出所有的差值。但数据范围是1e5如

  • CF1478-A. Nezzar and Colorful Balls2021-01-29 13:34:57

    CF1478-A. Nezzar and Colorful Balls 题意: 有\(n\)个球,每个球上面都有一个数字\(a_i\),这些数字是组成的序列是非递减的。现在你要给每个球涂色,你必须保证相同颜色的球上面的数字组成一个严格递增序列。问你最少多少种颜色可以实现上述要求? 思路: 比赛的时候卡题意了,题意确实有点

  • D. Nezzar and Board - Codeforces Round #698 (Div. 2)2021-01-29 12:05:00

    D. Nezzar and Board https://codeforces.com/contest/1478/problem/D 题解 题意为给出一个序列xi,你可以任意挑选两个数x,y将2·x-y加入序列中,询问在是否可以在序列中发现数k。 假设我们任意挑选4个数:x,y,p,q并且将2·x-y、2·p-q加入到序列中,挑选出新增的两个数:2·x-y、2`·p-q得到2

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有