这周居然考两道数学,反正是我的弱项。然后第一题考试的时候zz了竟然忘了怎么二分
只放 R a n k 1 ∼ 10 Rank\ 1\sim10 Rank 1∼10
R a n k Rank Rank | P e r s o n Person Person | S c o r e Score Score | A A A | B B B | C C C |
---|---|---|---|---|---|
1 1 1 | 2015 h j w 2015hjw 2015hjw | 210 210 210 | 100 100 100 | 70 70 70 | 40 40 40 |
2 2 2 | 2017 m y s e l f 2017myself 2017myself | 165 165 165 | 20 20 20 | 60 60 60 | 85 85 85 |
3 3 3 | 2017 x j q 2017xjq 2017xjq | 160 160 160 | 0 0 0 | 60 60 60 | 100 100 100 |
4 4 4 | 2015 y j y 2015yjy 2015yjy | 145 145 145 | 100 100 100 | 10 10 10 | 35 35 35 |
5 5 5 | 2015 l z x 2015lzx 2015lzx | 100 100 100 | 100 100 100 | 0 0 0 | 0 0 0 |
6 6 6 | 2015 g j h 2015gjh 2015gjh | 100 100 100 | 0 0 0 | 60 60 60 | 40 40 40 |
7 7 7 | 2017 l w 2017lw 2017lw | 55 55 55 | 10 10 10 | 30 30 30 | 15 15 15 |
8 8 8 | 2015 z z y 2015zzy 2015zzy | 55 55 55 | 0 0 0 | 30 30 30 | 25 25 25 |
9 9 9 | 2015 t r x 2015trx 2015trx | 45 45 45 | 0 0 0 | 30 30 30 | 15 15 15 |
10 10 10 | 2017 l r z 2017lrz 2017lrz | 45 45 45 | 0 0 0 | 10 10 10 | 35 35 35 |
博客链接:https://blog.csdn.net/Mr_wuyongcong/article/details/82812117
博客链接:https://blog.csdn.net/Mr_wuyongcong/article/details/82813059
博客链接:https://blog.csdn.net/Mr_wuyongcong/article/details/82813365
#include
#include
#include
#define M 100010
#define N 50010
using namespace std;
struct line{
int from,to;
double w;
int next;
}a[M*2];
struct node{
double l,r;
}f[N];
queue<int> q;
int n,m,x,y,w,tot,ans;
int ls[N],mark[N],h[N],s,t;
bool v[N];
void addl(int x,int y,double w)
{
a[++tot]=(line){x,y,w,ls[x]};ls[x]=tot;
a[++tot]=(line){y,x,w,ls[y]};ls[y]=tot;
}
void spfa()
{
q.push(s);v[s]=true;
for(int i=1;i<=ans;i++)
f[i]=(node){0,2147483647};
f[s]=(node){2147483647,0};
while(!q.empty())
{
int x=q.front();
q.pop();
for(int i=ls[x];i;i=a[i].next)
{
int y=a[i].to;
if(min(f[x].l,a[i].w)>f[y].l||
(min(f[x].l,a[i].w)==f[y].l&&
max(f[x].r,a[i].w)<f[y].r))
{
f[y]=(node){min(f[x].l,a[i].w),max(f[x].r,a[i].w)};
if(!v[y])
{
v[y]=true;
q.push(y);
}
}
}
v[x]=false;
}
}
int main()
{
scanf("%d%d",&n,&m);
for(int i=1;i<=m;i++)
{
scanf("%d%d%d",&x,&y,&w);
addl(x,y,w);
}
for(int i=1;i<=n;i++)
{
scanf("%d",&t);
ans+=t;
for(int j=1;j<=t;j++)
{
scanf("%d",&x);
mark[x]=i;
}
}
for(int i=1;i<=n;i++)
scanf("%d",&h[i]);
for(int i=1;i<=tot;i++)
{
x=mark[a[i].from];y=mark[a[i].to];
a[i].w*=(h[x]+h[y])/2.0/100.0;
}
scanf("%d%d",&s,&t);
spfa();
double R=f[t].r;
if(R-(int)R>0) R++;
printf("%d %d\n",(int)f[t].l,(int)R);
}
#include
using namespace std;
long long n,k,tot,nI,a[19];
int main()
{
scanf("%lld%lld",&n,&k);nI=1;
for(int i=1;i<n;i++)
nI=nI*i;
for(int i=1;i<=n;i++)
a[i]=i;
tot=n;
for(int i=1;i<=n;i++)
{
int wz=(k-1)/nI+1;
printf("%lld ",a[wz]);
if(i==n) break;
for(int j=wz;j<tot;j++)
a[j]=a[j+1];
k=(k-1)%nI+1;
tot--;
nI/=tot;
}
}
明天见