【CF Edu 28 B. Math Show】】的更多相关文章

time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Polycarp takes part in a math show. He is given n tasks, each consists of k subtasks, numbered 1 through k. It takes him tj minutes to solve…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given an array of n integer numbers. Let sum(l, r) be the sum of all numbers on positions from l to r non-inclusive (l-th element is…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Hideo Kojima has just quit his job at Konami. Now he is going to find a new place to work. Despite being such a well-known person, he still n…
[2020.11.28提高组模拟]T1染色(color) 题目 题目描述 给定 \(n\),你现在需要给整数 \(1\) 到 \(n\) 进行染色,使得对于所有的 \(1\leq i<j\leq n\),若 \(i - j\) 为质数,则 \(i\) 和 \(j\) 不同色. 求出颜色尽可能少的染色方案.如果有多种方案,输出任意一种即可. 输入格式 第一行一个整数 \(n\). 输出格式 第一行一个整数 \(k\),表示颜色数. 第二行 \(n\) 个整数 \(col_i\)(\(1 \leq…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output In a building where Polycarp lives there are equal number of flats on each floor. Unfortunately, Polycarp don't remember how many flats are o…
time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Merge sort is a well-known sorting algorithm. The main function that sorts the elements of array a with indices from [l, r) can be implement…
time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output You are given a string s consisting only of characters 0 and 1. A substring [l, r] of s is a string slsl + 1sl + 2... sr, and its length equa…
序列(array) 题目描述 ​给定一个长为 \(m\) 的序列 \(a\). 有一个长为 \(m\) 的序列 \(b\),需满足 \(0\leq b_i \leq n\),\(\sum_{i=1}^m a_ib_i \leq D\) 且 \(b_i\) 为整数. ​求 \(\sum b_i + k \min_{i=1}^m{b_i}\) 的最大值. 输入格式 ​第一行一个正整数 \(T\),表示数据组数. ​对于每组数据,第 \(1\) 行四个整数 \(n, m, k, D\). ​第 \(2…
day08[String类.static.Arrays类.Math类] String类static关键字Arrays类Math类 教学目标能够使用String类的构造方法创建字符串对象能够明确String类的构造方法创建对象,和直接赋值创建字符串对象的区别能够使用文档查询String类的判断方法能够使用文档查询String类的获取方法能够使用文档查询String类的转换方法能够理解static关键字能够写出静态代码块的格式能够使用Arrays类操作数组能够使用Math类进行数学运算 day08_…
B. Lost Number[CF交互题 暴力] This is an interactive problem. Remember to flush your output while communicating with the testing program. You may use fflush(stdout) in C++, system.out.flush() in Java, stdout.flush() in Python or flush(output) in Pascal to…