ICode9

精准搜索请尝试: 精确搜索
  • codeforce C. Boboniu and Bit Operations2022-04-24 14:00:30

    #include<stdio.h> #include<math.h> #include<string.h> #include<ctype.h> #include<iostream> #include<algorithm> #include<queue> #include<bitset> typedef long long ll; using namespace std; int a,b; int aa[2

  • Codeforce Round #640 Div42022-03-26 08:02:38

    Codeforce Round #640 Div4 一直听说cf之前搞过一场div4,所以找了个时间vp了一下,题目还是挺有意思的,感觉全是构造题。不知道为啥后来不办了,vp虚拟rank进了前30,前面写的有点慢,写简单题的速度还得在练练,简单写个题解把 A.Sum of Round Numbers 题意就是给你一个数,拆分成几个数,让拆分

  • codeforce div2 #7752022-03-08 09:00:07

    1/A题:  https://codeforces.com/contest/1649/problem/A 这一题其实很简单,就是要求最左边和最右边的最小距离(只能跨一次水,no more than once!!!) #include <iostream> #include <cstring> using namespace std; const int N = 1110; int q[N]; int t, n; int main() { cin >> t;

  • CodeForce div2 Round #7632022-01-04 19:02:33

    C-Balanced Stone Heaps 题目描述:给定\(n\)堆石子,规定第\(i(3\le i\le n)\)堆石子能够能够从中取出\(3d\)个石子(\(0<3d<h_i\),其中\(h_i\)为第\(i\)堆石子的数量),其中\(d\)个石子放入第\(i-1\)堆,\(2d\)个石子放入第\(i-2\)堆石子之中,我们从第\(3\)个石子往第\(i\)个石子遍历一次,问

  • CodeForce 常用模板2021-12-28 13:37:45

    目录代码模板KMPPrimeRandomST TableINT128MINT/CombineDSU(不带持久化) 代码模板 #include <bits/stdc++.h> using namespace std; #define DEBUG 0 // #define int long long #define fi first #define se second #define pb push_back #define vt std::vector #define lb lower_

  • 2021-11-272021-11-27 21:58:31

    周总结 1.打了三场codeforce,补了一些题,但并不满意自己的表现。后面的题有些思路,但都没时间写,感觉挺可惜的。提高读题和a题速度确实很重要 2.仔细又学了一遍二分法,做了洛谷上的一些题,对二分法的理解确实上升了。

  • codeforce round 753 div3 题解报告2021-11-17 04:31:07

    codeforce round 753 div3 题解报告 在vp比赛的时候只过了5题,后三题跨度还是挺大,不过也有前五题写的慢的愿意在里面,没有太多时间看后面的题。 A. Linear Keyboard 给你一个键盘的顺序,让你模拟打某个单词需要的步数,稍微对应建立映射即可 #include<bits/stdc++.h> using namespace s

  • CodeForce#230 B - T-primes2021-11-13 22:00:32

    /* *date:2021.11.13 *author:percation */ #include <bits/stdc++.h> using namespace std; #define ll long long const int N = 2e6 + 10, M = 1e6 + 100; int n,m; ll num; ll a[N]; int prime[N]; bool st[N]; int cnt = 0; void isprime(){ st[1] = 1; for(int

  • codeforce A. AB Balance2021-11-09 21:01:42

    A. AB Balance time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You are given a string s of length n consisting of characters a and/or b. Let AB(s) be the number of occurrences of string ab in s as

  • Codeforce---C--penalty2021-10-31 11:05:11

    题目如下:       分析:很关键的一句话就是:裁判是不知道预测结果的,所以,对于裁判的评测,必须要压倒性获胜才能结束对局。 接下来,讲解一下我的思路,首先,在没有问号的情况下,是很好判断对局的,那么,问号该怎么处理呢?,我先用pair分开储存1与?,接下来就是最关键的,假设当前局结束,一定说明某

  • CodeForce 208 A-Dubstep2021-10-25 12:34:42

    原题链接:https://codeforces.com/problemset/problem/208/A 学习链接:https://blog.csdn.net/cs_zlg/article/details/7782625 #include <bits/stdc++.h> using namespace std; //接收一行字符串,然后把中间的WUB删除(换成空格) int main(){ char s[205]; int len; //数组

  • CodeForce 82 A-Double Cola2021-10-23 23:31:53

    #include<bits/stdc++.h> using namespace std; int main(){ //1 2 3 4 //5 10 20 40 //等比数列 a^n = a^1 * q^(n - 1) //这个题的q是2 //比如说a^2 = a^1 * 2^1 //题目输入的数是和 求和公式是:a^1 * (1 - q^n) / (1 - q) //已知n求Sn,再求名字 int nn; //nn是

  • 【Codeforce Round 748 D2】2021-10-21 20:31:55

    https://codeforces.com/contest/1593/problem/D2 分析 枚举选中的\(n/2\)个数中最小的数,然后枚举大于其的数的所有因子,如果拥有某个因子的数的个数大于\(n/2\),则选中,求符合条件的最大的因子即可。 #include <bits/stdc++.h> using namespace std; #define LL long long #define

  • 【Codeforce Contest 1593 D】2021-10-21 17:04:14

    https://codeforces.com/contest/1593/problem/D1 分析 求最大公因子。 #include <bits/stdc++.h> using namespace std; #define LL long long int t,n,a[45],d[45]; int find(int a,int b) { if(a>b)swap(a,b); int r=b%a; while(r) { b=a; a=r; r=b%a; } ret

  • codeforce 154C - Double Profiles(hash)2021-10-19 22:05:44

    思路:要么是许多点两两相连,要么许多点两两互不相连。首先计算每个点对应的哈希值。对于两两相连的点集,可以计算每个点集中点对应的哈希值的和。对于两两互不相连的点集,可以计算这些点相邻的点哈希值的和。具体代码参考: https://github.com/wuli2496/OJ/blob/master/codeforces/15

  • 【Codeforce 746 C】Bakry and Partitioning2021-10-08 22:33:18

    https://codeforces.com/contest/1592/problem/C 分析 本题从“异或”的性质出发,已知一棵树若能符合题意地被分割成 i(2~k)个部分,那么它就可以被符合题意地分割成 i-2 个部分,则只需要考虑原来的树能否被符合题意地分割成 2 或 3 个部分。当 k=2 时,说明最多被分成 2 个部分,那么整棵树

  • Codeforce D. Ceil Divisions (构造+思维)2021-07-21 21:01:01

    题目链接 题意: 给你一个长度为 \(n\) 的序列 \(a\) 满足 \(a_i=i\) 你每次可以进行一次如下操作: 选择两个数 \(a_x,a_y\),将 \(a_x\) 修改为 \(\lceil\frac{a_x}{a_y}\rceil\) 你需要在 \(n+5\) 步之内将这个序列 \(a\) 修改为 \(n-1\) 个 1 和 1 个 2 的序列。 输出方案,即每一步

  • Codeforce 1195C 动态规划 状态转移方程2021-05-18 10:04:20

    原题链接:http://codeforces.com/problemset/problem/1195/C 题意:给出两行数字(个数相同),每两个数字不能上下或左右相邻,计算出所有数字满足条件的最大和。 思路:利用dp数组存储到达每一个位置的最大值,方法的核心在于选或不选。根据经典的背包问题,选则总价值增加,当前容量减少,不选则保

  • 【CodeForce】559B Equivalent Strings 等效字符串2021-04-03 16:57:26

    【CodeForce】559B Equivalent Strings 等效字符串 B. Equivalent Strings time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Today on a lecture about strings Gerald learned a new definition of string equ

  • codeforce_exercise_r312021-02-21 16:02:55

    目录 DDL 的恐惧 :问题描述题目简述输入/输出格式样例 问题分析解题思路参考代码 心得体会 DDL 的恐惧 : 问题描述 题目简述 还记得 NOIP 2011 提高组 Day1 中的铺地毯吗?时光飞逝,光阴荏苒,三年过去了。组织者精心准备的颁奖典礼早已结束,留下的则是被人们踩过的地毯。请

  • codeforce_exercise_r272021-02-17 17:59:26

    目录 通信网络(csp201709-4) :问题描述题目简述输入/输出格式样例 问题分析解题思路参考代码 心得体会 通信网络(csp201709-4) : 问题描述 题目简述 某国的军队由N个部门组成,为了提高安全性,部门之间建立了M条通路,每条通路只能单向传递信息,即一条从部门a到部门b的通路只能由

  • codeforce_exercise_r212021-02-07 16:30:50

    目录 游戏(csp201604-4) :问题描述题目简述输入/输出格式样例 问题分析解题思路参考代码 心得体会 游戏(csp201604-4) : 问题描述 题目简述 小明在玩一个电脑游戏,游戏在一个n×m的方格图上进行,小明控制的角色开始的时候站在第一行第一列,目标是前往第n行第m列。 方格图上有

  • codeforce_exercise_r112021-01-29 21:05:50

    目录 最优配餐(csp201409-4) :问题描述题目简述输入/输出格式样例 问题分析解题思路参考代码 心得体会 最优配餐(csp201409-4) : 问题描述 题目简述 栋栋最近开了一家餐饮连锁店,提供外卖服务。随着连锁店越来越多,怎么合理的给客户送餐成为了一个急需解决的问题。   栋栋

  • Codeforce 1451-C. String Equality2021-01-08 21:35:22

    题目: C. String Equality time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ashish has two strings aa and bb, each of length nn, and an integer kk. The strings only contain lowercase English

  • CodeForce 981F. Round Marriage2020-12-14 04:01:28

    题目链接 https://codeforces.com/contest/981/problem/F 题意 \(n\)个新郎和\(n\)个新娘围成一个环,长度为\(L\),第\(i\)个新郎位置为\(a_i\),第\(i\)个新娘位置为\(b_i\),需要将他们两两配对,最小化新郎和新娘距离的最大值。 思路 考虑二分答案。 二分答案之后如何判定是否能完美

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

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

ICode9版权所有