Window
![1741735-20190820183143991-902970535.png](https://i-blog.csdnimg.cn/blog_migrate/134835bb4f1b715539aea69264bd05fb.png)
![1741735-20190820183212346-118142418.png](https://i-blog.csdnimg.cn/blog_migrate/64ce3aa8b7ff0a88cdf4a85f06da130d.png)
Tournament Chart
![1741735-20190820183225765-410936425.png](https://i-blog.csdnimg.cn/blog_migrate/d6b1f82a51ea6db2c5761333aa110c5d.png)
![1741735-20190820183237265-506132150.png](https://i-blog.csdnimg.cn/blog_migrate/6a3713f550c45dfbfea25d665fbc3c64.png)
![1741735-20190820183302175-1147577994.png](https://i-blog.csdnimg.cn/blog_migrate/1527c47fd3cc4290c39fe9b640605e88.png)
Prime-Factor Prime
![1741735-20190820183313947-298546926.png](https://i-blog.csdnimg.cn/blog_migrate/624ff3a7560f047a5e641f1c56ae9450.png)
![1741735-20190820183317601-1748106108.png](https://i-blog.csdnimg.cn/blog_migrate/c6c5e4e803542ae6ff199d9e8a507432.png)
#pragma GCC optimize(3,"Ofast","inline")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int l,r;
int prime[32000],tot;
bool vis[32000],prie[32000];
vector<int>a[1000001];
void init() {
for (int i = 2; i <= 31652; i++) {
if (!vis[i]) {
prime[tot++] = i;
prie[i] = 1;
}
for (int j = 0; j < tot && 1ll*prime[j] * i <= 31652; j++) {
vis[prime[j] * i] = 1;
if (i % prime[j] == 0) {
break;
}
}
}
}
int main() {
init();
int ans = 0;
scanf("%d%d", &l, &r);
for (register int i = 0; i < tot; ++i) {
for (register int j = l/prime[i]*prime[i];j<=r; j += prime[i]) {
if (j >= l)
a[j - l].push_back(prime[i]);
}
}
for (register int i = l; i <= r; ++i) {
int x = i;
int cnt = 0, sz = a[i - l].size();
for (register int j = 0; j < sz; ++j) {
while (x % a[i - l][j] == 0) {
cnt++;
x = x / a[i - l][j];
if (x == 1) break;
}
}
if (x>1){
cnt++;
}
if (prie[cnt]) {
ans++;
//printf("%d ",i);
}
}
printf("%d\n", ans);
}
Coin Slider
![1741735-20190820183340400-402549811.png](https://i-blog.csdnimg.cn/blog_migrate/1bb5fc38f3be3ebde9f10848716cc2c9.png)
![1741735-20190820183345881-1258411761.png](https://i-blog.csdnimg.cn/blog_migrate/c9c87d8577076e126c211f5af29b8e67.png)
#include <bits/stdc++.h>
using namespace std;
const int maxn=30;
const int maxm=1<<17;
int sx[maxn],sy[maxn],tx[maxn],ty[maxn],n,r[maxn],dp[maxm];
const double eps=1e-5;
struct Point{
int x,y;
Point(){};
Point(int _x,int _y):x(_x),y(_y){};
Point operator-(const Point &a)const {
Point tmp=*this;
tmp.x-=a.x;
tmp.y-=a.y;
return tmp;
}
};
struct Line{
Point s,t;
Line(Point _s,Point _t):s(_s),t(_t){};
};
double xmult(Point p1,Point p2,Point p0)
{
return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y);
}
double distance(Point p1,Point p2)
{
return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
}
double disptoline(Point p,Point l1,Point l2)
{
return fabs(xmult(p,l1,l2))/distance(l1,l2);
}
int intersect_seg_circle(Point c,double r, Point l1,Point l2)
{
double t1=distance(c,l1)-r,t2=distance(c,l2)-r;
Point t=c;
if (t1<eps||t2<eps)
return t1>-eps||t2>-eps;
t.x+=l1.y-l2.y;
t.y+=l2.x-l1.x;
return xmult(l1,c,t)*xmult(l2,c,t)<eps&&disptoline(c,l1,l2)-r<eps;
}
double d;
vector<Point>point;
vector<int>R;
int main() {
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d%d%d%d%d", &r[i], &sx[i], &sy[i], &tx[i], &ty[i]);
dp[0] = 1;
for (int i = 0; i < 1 << n; i++) {
if (dp[i]) {
for (int j = 0; j < n; j++) {
if (((i >> j) & 1) == 0) {
Line L(Point(sx[j], sy[j]), Point(tx[j], ty[j]));
point.clear();
R.clear();
for (int k = 0; k < n; k++) {
if (j != k) {
if ((i >> k) & 1) {
point.push_back(Point(tx[k], ty[k]));
R.push_back(r[k]);
} else {
point.push_back(Point(sx[k], sy[k]));
R.push_back(r[k]);
}
}
}
int f = 1, sz = point.size();
for (int k = 0; k < sz; k++) {
if (intersect_seg_circle(point[k],r[j]+R[k],L.s,L.t)) f = 0;
}
if (f) dp[i + (1 << j)] = 1;
}
}
}
}
int ans = 0;
for (int i = 0; i < 1 << n; i++) {
int k = 0;
if (dp[i]) {
for (int j = 0; j < n; j++) {
if ((i >> j) & 1)
k++;
}
}
ans = max(ans, k);
}
printf("%d\n", ans);
}
Conveyor Belt
![1741735-20190820183411553-272103660.png](https://i-blog.csdnimg.cn/blog_migrate/2766535aa32333992c44a41067324552.png)
![1741735-20190820183414551-1912131803.png](https://i-blog.csdnimg.cn/blog_migrate/c7d4e6f17b616cd45c37323c3d8a095a.png)
![1741735-20190820183420312-1051814313.png](https://i-blog.csdnimg.cn/blog_migrate/b140bd8df85a2c2d69e7d9b50d9fa6f6.png)