日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

ssl提高组周六模拟赛【2018.9.22】

發布時間:2023/12/3 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ssl提高组周六模拟赛【2018.9.22】 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

這周居然考兩道數學,反正是我的弱項。然后第一題考試的時候zz了竟然忘了怎么二分


成績

只放Rank1~10Rank\ 1\sim10Rank?110

RankRankRankPersonPersonPersonScoreScoreScoreAAABBBCCC
1112015hjw2015hjw2015hjw210210210100100100707070404040
2222017myself2017myself2017myself165165165202020606060858585
3332017xjq2017xjq2017xjq160160160000606060100100100
4442015yjy2015yjy2015yjy145145145100100100101010353535
5552015lzx2015lzx2015lzx100100100100100100000000
6662015gjh2015gjh2015gjh100100100000606060404040
7772017lw2017lw2017lw555555101010303030151515
8882015zzy2015zzy2015zzy555555000303030252525
9992015trx2015trx2015trx454545000303030151515
1010102017lrz2017lrz2017lrz454545000101010353535

正題


T1:nssl1155?T1:nssl1155-T1:nssl1155?遨游【二分答案,SPFA,SPFA,SPFA

博客鏈接:https://blog.csdn.net/Mr_wuyongcong/article/details/82812117


T2:nssl1156?T2:nssl1156-T2:nssl1156?今天你AKAKAK了嗎???【康托展開,,,高精度,,,二分答案,,,樹狀數組】

博客鏈接:https://blog.csdn.net/Mr_wuyongcong/article/details/82813059


T3:nssl1157?T3:nssl1157-T3:nssl1157?簡單數學題【約數,,,換元法】

博客鏈接:https://blog.csdn.net/Mr_wuyongcong/article/details/82813365


someofcodesome\ of\ codesome?of?code


T1-70分代碼

#include<cstdio> #include<algorithm> #include<queue> #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); }

T2-60分代碼

#include<cstdio> 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;} }

尾聲

明天見

總結

以上是生活随笔為你收集整理的ssl提高组周六模拟赛【2018.9.22】的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。