本文为UserUnknown原创 题目大意 总共有 \(N\) 个车站,每两个相邻的车站有单向的车. 从第 \(i\) 个站到第 \(i+1\) 个站 需要时间 \(C_i\) 分钟,且第一趟车在 \(S_i\)分钟时发(之后每隔 \(F_i\) 分钟发一辆车). 并且 数据保证 \(F_i\) 能被 \(F_i\) 整除. 要你求出每以个点到 \(N\) 的最少时间. 思路 因为 \(N\) \(<\) \(500\),所以不用多考虑,可以直接暴力模拟. 只要枚举出每一个点到其他各个点所需要最…
Special Trains Problem Statement A railroad running from west to east in Atcoder Kingdom is now complete. There are NN stations on the railroad, numbered 11 through NN from west to east. Tomorrow, the opening ceremony of the railroad will take place.…
Problem hdu-2866 题意:求区间\([2,L]\)有多少素数\(p\)满足\(n^3+pn^2=m^3\),其中\(n,m\)属于任意整数 Solution 原式等价于\(n^2(p+n)=m^3\) 可证当\(p|\gcd(n^2,n+p)\)时,无解,因为当\(n=k\cdot p\)时 \(k^2p^3+k^3p^3=m^3\) \(m=p\sqrt [3]{k^2+k^3}\)可证无整数解,对于这一点,证明如下 \(k^2+k^3=k^2(1+k)\) 假如\(1+k\)为…
Content 给定一个整数 \(n\),请构造出一个长度为 \(n\) 的排列 \(\{a_i\}_{i=1}^n\),使得对于每个 \(a_i\),都有 \(a_i\neq i\). 我们称一个长度为 \(n\) 的数列为一个排列,当且仅当所有 \(1\sim n\) 的整数都出现且仅出现了一次.比如说 \([2,3,1,5,4]\) 就是一个长度为 \(5\) 的排列,而 \([1,2,2]\) 和 \([1,3,4]\) 都不是一个排列. 数据范围:\(1\leqslant t\leqs…
Problems     # Name     A Infinite Sequence standard input/output 1 s, 256 MB    x3509 B Restoring Painting standard input/output 1 s, 256 MB    x2519 C Money Transfers standard input/output 1 s, 256 MB    x724 D Tree Construction standard input/outp…
题目链接: I. Special Squares There are some points and lines parellel to x-axis or y-axis on the plane. If arbitrary chosen two lines parallel to x-axis and two lines parallel to y-axis, one rectangle, or sometimes a square, will be formed. If a square i…
题目链接: http://codeforces.com/contest/435/problem/D D. Special Grid time limit per test:4 secondsmemory limit per test:256 megabytes 问题描述 You are given an n × m grid, some of its nodes are black, the others are white. Moreover, it's not an ordinary gri…
Special subset sums: meta-testing Let S(A) represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are true: S(B) ≠ S(C); that is, sums of subse…
Special Tetrahedron 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5839 Description Given n points which are in three-dimensional space(without repetition). Please find out how many distinct Special Tetrahedron among them. A tetrahedron is called Sp…
D. Phillip and Trains Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/586/problem/D Description The mobile application store has a new game called "Subway Roller". The protagonist of the game Philip is located in one en…