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

歡迎訪問 生活随笔!

生活随笔

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

编程问答

欢乐纪中某B组赛【2019.1.20】

發布時間:2023/12/3 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 欢乐纪中某B组赛【2019.1.20】 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

有回來做BBB組了,話說第3道題就是AAA組第一道。


成績

RankRankRank是有算別人的
今天XJQXJQXJQ不在

RankRankRankPersonPersonPersonScoreScoreScoreAAABBBCCC
1112017wyc2017wyc2017wyc270270270100100100100100100707070
1010102017hjq2017hjq2017hjq130130130100100100303030000
1010102017zyc2017zyc2017zyc130130130100100100303030000
1616162017xxy2017xxy2017xxy120120120100100100202020000
3939392017lw2017lw2017lw303030000303030000
4646462017hzb2017hzb2017hzb202020000202020000
4646462017lrz2017lrz2017lrz202020000202020000

正題


T1:jzoj4229?T1:jzoj4229-T1:jzoj4229?學習神技【逆元,,,費馬小定理】

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


T2:jzoj4230?T2:jzoj4230-T2:jzoj4230?淬煉神體【0/10/10/1分數規劃】

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


T3:jzoj4231?T3:jzoj4231-T3:jzoj4231?尋找神格【線段樹,,,數學】

神TM這道題有SPJ,讓我輸出3位小數,輸出到10位就過了
誓死力爭,還我AK!
博客鏈接:
https://blog.csdn.net/Mr_wuyongcong/article/details/86561899


someofcodesome\ of\ codesome?of?code


T2暴力

#include<cstdio> #include<algorithm> using namespace std; int n,k,a[16],b[16]; double ans; int v[16]; double check() {int sum_a=0,sum_b=0;for(int i=1;i<=n;i++)if(v[i]) sum_a+=a[i],sum_b+=b[i];return (double)sum_a/sum_b; } void dfs(int dep,int c){if(c==k){ans=max(check(),ans);if(ans>=2000)ans++,ans--;check();return;}if(dep>n) return;v[dep]=1;dfs(dep+1,c+1);v[dep]=0;dfs(dep+1,c); } int main() {freopen("data.in","r",stdin);freopen("data.anss","w",stdout);scanf("%d%d",&n,&k);for(int i=1;i<=n;i++)scanf("%d",&a[i]);for(int i=1;i<=n;i++)scanf("%d",&b[i]);dfs(1,0);printf("%0.3lf",ans); }

T2隨機數據

#include<cstdlib> #include<algorithm> #include<cstdio> #include<ctime> #define random(x) rand()%x+1 using namespace std; int main() {freopen("data.in","w",stdout);srand(time(0));printf("15 %d\n",random(15));for(int i=1;i<=15;i++)printf("%d ",random(1000));printf("\n");for(int i=1;i<=15;i++)printf("%d ",random(1000)); }

T3暴力

#include<cstdio> #define ll long long using namespace std; ll n,m,p[5010]; int main() {//freopen("data.in","r",stdin);//freopen("data.ans","w",stdout);scanf("%lld%lld",&n,&m);for(ll i=1;i<=n;i++)scanf("%lld",&p[i]);for(ll i=1;i<=m;i++){ll t,a,b;scanf("%lld%lld%lld",&t,&a,&b);if(t==0) p[a]+=b;else if(t==1){ll z;scanf("%lld",&z);for(ll i=a;i<=b;i++)p[i]+=z;}else if(t==2){ll ans=0;for(ll i=a;i<=b;i++)ans+=p[i];printf("%lld\n",ans);}else{double n=(b-a+1),ans=0,sum=0;for(ll i=a;i<=b;i++)sum+=p[i];sum/=n;for(ll i=a;i<=b;i++)ans+=(double(p[i])-sum)*(double(p[i])-sum);ans/=n;printf("%0.3lf\n",ans);}} }

T3隨機數據

#include<cstdio> #include<ctime> #include<cstdlib> #include<algorithm> using namespace std; int n,m,k; int main() {srand(time(0));//freopen("data.in","w",stdout);n=5;m=5;k=10;printf("%d %d\n",n,m);for(int i=1;i<=n;i++)printf("%d ",rand()%k*2-k);printf("\n");for(int i=1;i<=n;i++){int t=rand()%4,a=rand()%n+1,b=rand()%n+1;printf("%d ",t);if(a>b) swap(a,b);if(t==0)printf("%d %d\n",a,rand()%k*2-k);else if(t==1) printf("%d %d %d\n",a,b,rand()%k*2-k);else if(t==2)printf("%d %d\n",a,b);else printf("%d %d\n",a,b);} }

尾聲

誓死力爭,還我AK!

總結

以上是生活随笔為你收集整理的欢乐纪中某B组赛【2019.1.20】的全部內容,希望文章能夠幫你解決所遇到的問題。

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