oftest

Codeforces 1354C2

倾然丶 夕夏残阳落幕 提交于 2020-08-09 10:58:33
题面 Time limit per test: 2 seconds Memory limit per test: 256 megabytes Description You are given a regular polygon with 2⋅n vertices (it's convex and has equal sides and equal angles) and all its sides have length 1 . Let's name it as 2n -gon. Your task is to find the square of the minimum size such that you can embed 2n -gon in the square. Embedding 2n -gon in the square means that you need to place 2n -gon in the square in such way that each point which lies inside or on a border of 2n -gon should also lie inside or on a border of the square. You can rotate 2n -gon and/or the square. Input

Easy Integration(Wallis积分)(2020牛客多校第一场J题)

流过昼夜 提交于 2020-08-06 20:31:54
原题题面 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K Given n, find the value of ∫ 0 1 ( x − x 2 ) n   d x \int_0^1 {(x-x^2)^n} \,{\rm d}x ∫ 0 1 ​ ( x − x 2 ) n d x . It can be proved that the value is a rational number p q \frac{p}{q} q p ​ . Print the result as p ⋅ q − 1 m o d 998244353 p·q^{-1}\ mod\ 998244353 p ⋅ q − 1 m o d 9 9 8 2 4 4 3 5 3 . 输入描述 he input consists of several test cases and is terminated by end-of-file. Each test case contains an integer n. 1 ≤ n ≤ 1 0 6 1 \leq n \leq 10^6 1 ≤ n ≤ 1 0 6 The number of test cases does not exceed 1 0 5 10^5 1 0 5 . 输入样例 1 2 3 输出样例

【揭秘】阿里测试框架,各大CTO良心力荐

旧时模样 提交于 2020-08-04 19:20:52
自动化测试因其节约成本、提高效率、减少手动干预等优势已经日渐成为测试人员的“潮流”,从业人员日益清楚地明白实现自动化框架是软件自动化项目成功的关键因素之一。本篇文章将从 什么是真正的自动化测试框架、自动化脚本如何工作以及自动化测试框架会如何在测试过程中为你提供竞争优势 三个方面进行阐述,让您通过这一篇文章,踏入自动化测试框架的领域。 自动化测试的优势 自动化测试的流行和诸多优势并不意味着它是灵丹妙药,定制型项目、周期短、测试易用性等情况并不适合自动化测试。但不可否认的是,如果认真计划和执行自动化测试框架,确实会为软件开发和测试公司带来以下好处: 最短时间-最大收益 构建任何可行的自动化测试框架和自动化脚本都可以最大程度地减少编写和运行测试所花费的时间,从而可以在短时间内获得最大的输出。另外,拥有优秀的自动化测试框架后,人力就可以从诸如同步、错误管理、本地配置,报告生成、解释等这些常见问题中解脱出来。 可重复使用和可读的自动化代码 当你使用现有组件库中提到的代码时,大可以放心,它在以后的时间内仍然是可读和可重复使用的,并且所有相关任务(如报告、同步和故障排除)都将变得更易访问。 资源优化 一些公司没有如设想的一般从自动化实施中受益,因为从自动化测试中获得的效益取决于采用它的灵活性。 如果自动化系统是灵活的,并且与从事各个组件的不同团队兼容

Prime Path素数筛与BFS动态规划

筅森魡賤 提交于 2020-05-09 09:01:48
埃拉托斯特尼筛法(sieve of Eratosthenes ) 是古希腊数学家埃拉托斯特尼发明的计算素数的方法。对于求解不大于 n 的所有素数,我们先找出 sqrt(n) 内的 所有素数p1到pk ,其中 k = sqrt(n) ,依次剔除 Pi 的倍数,剩下的所有数都是素数。 具体操作如上述 图片所示。 C++实现 #include<iostream> #include<vector> using namespace std; int main() { int n; cin >> n; vector<bool> isprime(n + 5, true); vector<int> ans; for (int i = 2; i <= n; i++) { if (isprime[i]) { ans.push_back(i); for (int j = i * i; j <= n; j += i)isprime[j] = false; } } for (auto i : ans)cout << i << " "; cout << endl; return 0; } 整除问题 给定n,a求最大的k,使n!可以被a k整除但不能被a (k+1)整除。 输入描述 两个整数n(2<=n<=1000),a(2<=a<=1000) 输出描述 示例1 输入 555 12 输出 274

Mr. Frog’s Game(模拟连连看)

天涯浪子 提交于 2020-05-06 07:09:16
Description One day, Mr. Frog is playing Link Game (Lian Lian Kan in Chinese). In this game, if you can draw at most three horizontal or vertical head-and-tail-connected lines over the empty grids(the lines can be out of the whole board) to connect two non-empty grids with the same symbol or the two non-empty grids with the same symbol are adjacent, then you can change these two grids into empty and get several more seconds to continue the game. Now, Mr. Frog starts a new game (that means there is no empty grid in the board). If there are no pair of grids that can be removed together,Mr. Frog

Plants vs. Zombies(2018ICPC青岛站E题) 二分

怎甘沉沦 提交于 2020-05-04 06:13:32
Plants vs. Zombies                                                ZOJ - 4062 BaoBao and DreamGrid are playing the game Plants vs. Zombies . In the game, DreamGrid grows plants to defend his garden against BaoBao's zombies There are plants in DreamGrid's garden arranged in a line. From west to east, the plants are numbered from 1 to and the -th plant lies meters to the east of DreamGrid's house. The -th plant has a defense value of and a growth speed of . Initially, for all . DreamGrid uses a robot to water the plants. The robot is in his house initially. In one step of watering, DreamGrid will

2018山东省ACM省赛 G题Games

安稳与你 提交于 2020-05-03 23:29:16
时间限制: 2 Sec 内存限制: 128 MB 提交: 70 解决: 17 [提交][状态][讨论版][命题人:admin] 题目描述 Alice and Bob are playing a stone game. There are n piles of stones. In each turn, a player can remove some stones from a pile (the number must be positive and not greater than the number of remaining stones in the pile). One player wins if he or she remove the last stone and all piles are empty. Alice plays first. To make this game even more interesting, they add a new rule: Bob can choose some piles and remove entire of them before the game starts. The number of removed piles is a nonnegative integer, and not greater than a

2018ACM山东省赛 Games(dp取数)

£可爱£侵袭症+ 提交于 2020-05-03 21:04:55
Games Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Problem Description Alice and Bob are playing a stone game. There are n n piles of stones. In each turn, a player can remove some stones from a pile (the number must be positive and not greater than the number of remaining stones in the pile). One player wins if he or she remove the last stone and all piles are empty. Alice plays first. To make this game even more interesting, they add a new rule: Bob can choose some piles and remove entire of them before the game starts. The number of removed piles is a nonnegative integer,

Java基础知识常见面试题汇总 第三篇

浪子不回头ぞ 提交于 2020-05-02 03:26:33
本篇博客讲解1个常见的面试题:Java中final finally finalize的区别。 按我的个人理解,这个题目本身就问的有点问题,因为这3个关键字之间没啥关系,是相对独立的,我猜想这道题的初衷应该是想了解面试者对Java中final finally finalize的使用方法的掌握情况,只是因为3个关键字比较像,而成了现在网上流传的题目“Java中final finally finalize的区别”。 既然是想了解面试者对Java中final finally finalize的使用方法的掌握情况,那么我们就分别讲解下final,finally,finalize的使用方法。 1. final用法 我们先看下final的英文释义:最终的;决定性的;不可更改的,不禁要推测被final修饰的变量,方法或者类是不是不可修改的呢? 1.1 final修饰类 在Java中,被final修饰的类,不能被继承,也就是final类的成员方法没有机会被继承,也没有机会被重写。 在设计类的时候,如果这个类不需要有子类,类的实现细节不允许改变,那么就可以设计为final类。 我们在开发中经常使用的String类就是final类,以下为部分源码: public final class String implements java.io.Serializable, Comparable<String>,

HDU 6656 Kejin Player (期望DP 逆元)

别说谁变了你拦得住时间么 提交于 2020-04-30 04:20:56
2019 杭电多校 7 1011 题目链接: HDU 6656 比赛链接: 2019 Multi-University Training Contest 7 Problem Description Cuber QQ always envies those Kejin players, who pay a lot of RMB to get a higher level in the game. So he worked so hard that you are now the game designer of this game. He decided to annoy these Kejin players a little bit, and give them the lesson that RMB does not always work. This game follows a traditional Kejin rule of "when you are level i, you have to pay $a_i$ RMB to get to level $i+1$". Cuber QQ now changed it a little bit: "when you are level $i$, you pay $a_i$ RMB, are you get to level