ICode9

精准搜索请尝试: 精确搜索
  • CodeForce 387D. George and Interesting Graph2020-12-08 09:03:07

    题目链接 https://codeforces.com/problemset/problem/387/D 题意 思路 \(N\)不大,考虑枚举中心点\(u\), 首先和\(u\)相连的边加上自环共有\(2 * n - 1\)条, 那么将不够的边补上。 每个边都和\(u\)有双向边之后, 入度和出度还剩1. 将剩下\(n - 1\) 个点拆成入度点和出度点, 那么每个

  • codeforce补题-简单思考的数学问题2020-11-22 09:57:57

    题目描述 Ridbit从一个整数n开始。 在一步棋中,他可以执行以下操作之一。 把n除以它的一个正因数,或者… 如果n大于1,则从n中减去1。 正除数是一个数的除数,不包括它本身。例如,1,2,4,5,10是20的正整除数,但20本身不是。 Ridbit最少要做多少次移动才能将n减为1? 输入 第一行包含一个整

  • Codeforce 基础dp专题2020-10-29 17:31:53

    链接:https://codeforces.com/contest/467/problem/C 这道题是求拿k个子序列且不能相交,问如何拿使得这些序列的值的和最大,那么阶段划分就很明显了,相当于这道问题对应的隐式DAG上一共可以被分成K层,接着就是枚举在哪个点转移,也就是是否取当前的往左m的区间,对应的就是在DAG求最短最长

  • Codeforce-Power Tower(欧拉降幂)2020-06-14 16:05:47

    Power Tower 题意: 一个序列有\(n\)个数,\(q\)次询问,将\(l\)到\(r\)这个区间的数叠起来模上\(M\) 思路: 欧拉降幂 #include<bits/stdc++.h> #define ll long long using namespace std; map<ll,ll>mp; const int M=1e5+10; ll a[M]; ll ol(ll x) { if(mp[x]) {

  • Hottest 30 of codeforce2020-06-05 20:09:05

    1. 4A.Watermelon 题目链接:https // s.com/problemset/problem/4/A 题意:两人分瓜,但每一部分都得是偶数 分析:直接 对2取余,且 w != 2 #include<bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n % 2 == 0 && n != 2)cout << "Y

  • codeforce #626 div22020-03-09 15:57:20

    # A.Even Subset Sum Problem # 题意 数组 

  • codeforce.C. Primitive Primes2020-03-05 19:02:46

    题意: 给出两个多项式,使两个多项式相乘,得到的多项式,存在系数不被p整除,则输出这个系数所在项的次幂。 思路: 其实读懂题意,很好做。因为想得到系数不能整除p,那 么两个项都不能整除p,那我们只要找到a里面不能整除p的,再找到b里面不能整除p的,就可以输出两项的次幂和了 #include

  • 开学篇 12020-02-27 16:03:48

    \qquad今天已经周四了,昨天上了一天的课,不知道为什么感觉很累。。。比在学校上课还累。 \qquad昨天刚刚补完codeforce的题目,目前,在补寒假累积的题目和知识点,这些题目估计得蚕食一段时间。顺着这些知识点在补充些题目感觉很舒服。 点赞 收藏 分享 文章举

  • codeforce Round #605(Div.3)2019-12-22 12:01:34

      A. Three Friends    题目链接:http://codeforces.com/contest/1272/problem/A   题目意思:有三个好朋友a,b,c。他们在一个坐标轴上,他们的位置分别是xa 和xb ,xc,他们三个人都可以往前或者往后走一步,只能走一步。问你他们走了(也可能不走)之后的abs(xa  -  xb) + abs(xb -

  • codeforce Round #599(Div.2)2019-11-10 21:53:37

    题目传送门 A. Maximum Square   题目意思是给你n个长条,每个长条的高度是num[i](0 < i < n),每一条的宽度都是 1 ;然后求这些长条可以组成的最大面积的正方形的宽度是多少,将它输出来。 题目分析 :因为要求的是正方形,而且面积是最大的,所以既要看它的宽度也要看它的高度。因为多余的面

  • codeforce B. Creating the Contest2019-10-20 23:56:28

      http://codeforces.com/contest/1029/problem/B   水题真快乐= =   1 public class Main { 2 public static void main(String[] args) { 3 Scanner io = new Scanner(System.in); 4 long n = io.nextInt() - 1, a = io.nextInt(), b, len = 1, ans =

  • codeforce A. Many Equal Substrings2019-10-20 23:54:58

      http://codeforces.com/contest/1029/problem/A   嗳,简单的题做起来是真的舒服qwq   1 public static void main(String[] args) { 2 Scanner io=new Scanner(System.in); 3 int n=io.nextInt(),k=io.nextInt(); 4 String str=io.nextLine(); 5

  • CodeForce 113B DP2019-09-27 18:01:56

    Gargari got bored to play with the bishops and now, after solving the problem about them, he is trying to do math homework. In a math book he have found k permutations. Each of them consists of numbers 1, 2, ..., n in some order. Now he should find the le

  • codeforce 270B2019-08-30 09:35:48

    B. Multithreading time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Emuskald is addicted to Codeforces, and keeps refreshing the main page not to miss any changes in the "recent actions"

  • Codeforce 1061 :D. TV Shows(multiset + 贪心 + 构造)2019-08-17 21:39:55

    题目大意:有 n 个电视节目,每个节目有一个播放时间[ai,bi],你可以租用电视机来播放节目,租用一台电视机要先付 xxx(类似定金什么的),如果你在[a,b]时间段租用,你需要付租用的费用:y∗(b−a)y * (b - a)y∗(b−a)。当电视机播放一个节目时,电视机不能中途跳转到播放其它节目,一个节目被

  • CodeForce Round 578 Div 2 E. Compress Words2019-08-15 09:54:57

    E. Compress Words Problem Amugae has a sentence consisting of \(n\) words. He want to compress this sentence into one word. Amugae doesn't like repetitions, so when he merges two words into one word, he removes the longest prefix of the second word

  • Codeforce Round #574(Div.2)2019-08-13 10:58:34

                                                                                                                 A. Drinks Choosing                                              

  • 【CodeForce】A. Hotelier(思维)2019-08-12 10:38:13

    Amugae has a hotel consisting of 10 rooms. The rooms are numbered from 0 to 9 from left to right. The hotel has two entrances — one from the left end, and another from the right end. When a customer arrives to the hotel through the left entrance, they

  • 暑假集训日记——8.1(牛客+codeforce)2019-08-01 17:01:27

    容斥原理的应用 正难则反,合取式 的情况不好求,就转化为求解 总数-容斥 小y的质数 题解:容斥原理 #include<bits/stdc++.h> #define mp make_pair using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, int> pli; typedef pair<ll, ll>

  • codeforce 165E Compatible Numbers2019-07-23 18:55:36

      题意 有集合 {ai} i = 1,2,3,...n 找出集合里面是否有与之相容的,x&y == 0  也就是,已知存在一个二进制数字 x (相当于有n个1组成),寻找一个 y (有 1 的地方跟 x 不一样)。   当然,在R里有很多满足题意的 y (1放的位置不同,以及1的数量不同),所以从inf开始往前将 x 提供给所有可以扩展

  • codeforce 679A Bear and Prime 100 (交互题)2019-05-05 20:48:49

    链接:http://codeforces.com/problemset/problem/679/A       题目: This is an interactive problem. In the output section below you will see the information about flushing the output. Bear Limak thinks of some hidden number — an integer from interval [2, 10

  • Codeforce Round #553(Div2)2019-05-03 15:49:48

    开的虚拟赛,做了ABCD,写一下BCD吧:   Bwa了三发.题意大概就是有一个n*m矩阵,从每一行拿出一个数,使得这n个数异或和大于0.想了一下就开始写:只要判断一下是否有一行有两个不同的数,其他行都去第一个,不就ok了?第一发WA了以后发现有这种情况:3 3\n2 2\n4 4\n6 6即一行中每一列都是

  • Codeforce 1118 D2019-02-21 09:41:06

    简单说一下题目,有n杯咖啡,第i杯能量为ai,一天之内可以喝任意杯,喝x杯可以写 a1+max(a2-1,0)+max(a3-2,0)+...+max(ax-x+1,0)篇文章,求最少要多长时间写完文章.(喝掉咖啡写的文章数>=要写的文章数m) 这又是一道二分查找的问题,通过问题的描述我们知道,做多能写∑ai篇文章(一天一杯)

  • Codeforce Round #538(Div2)2019-02-14 13:54:52

    比赛链接:https://codeforces.com/contest/1114 B.(字丑求轻喷QAQ)     

  • Codeforce 714A2019-02-02 17:38:54

    A. Meeting of Old Friends time limit per test:1 second memory limit per test:256 megabytes input:standard input output:standard output   Today an outstanding event is going to happen in the forest — hedgehog Filya will come to his old friend Sony

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

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

ICode9版权所有