Codeforces round#429 div2 C
来源:互联网 发布:差分演化算法及其应用 编辑:程序博客网 时间:2024/05/16 18:10
题目链接:点击打开链接
一个组合公式
(公式内左右内容写反了跪#越学越差系列
最后结果 F[n,k] = (n+1)/(k+1)
化简详情 :点击打开链接
AC代码如下:
#include <iostream>#include <cstring>#include <algorithm>using namespace std;int A[200005];int C[200005];struct BT{ int po; int num; int operator<(const BT& o) { return num<o.num; }};BT B[200005];int main(){ int m; while(cin>>m) { for(int i=1;i<=m;++i) cin>>A[i]; for(int i=1;i<=m;++i) { B[i].po = i; cin>>B[i].num; } sort(A+1,A+1+m); sort(B+1,B+1+m); for(int i=m;i>=1;--i) C[B[m-i+1].po] = A[i]; for(int i=1;i<=m;++i) cout<<C[i]<<" "; cout<<endl; } return 0;}
阅读全文
1 0
- Codeforces round#429 div2 C
- Codeforces Round #429 (Div2) C
- Codeforces round 181 div2 C
- codeforces div2 round#231 C
- codeforces div2 round#230 C
- Codeforces - Round.313.Div2.C
- codeforces Round #352 div2 C
- Codeforces Round #409 div2 C
- Codeforces Round #429 (Div2) B
- codeforces Round #237(div2) C解题报告
- codeforces Round #241(div2) C解题报告
- codeforces round #257 div2 C、D
- Codeforces Round #262(div2) C. Present
- codeforces Round #269(div2) C解题报告
- codeforces Round #267(div2) C解题报告
- codeforces Round #271(div2) C解题报告
- codeforces Round #272(div2) C解题报告
- codeforces Round #264(div2) C解题报告
- 算法竞赛入门经典java版程序CH3 UVa1368
- 安卓新版本升级,并自动安装apk
- 每天每周每月每年程序员该做的事情
- Leetcode--Longest Palindromic Substring(最长回文子序列)
- Execution failed for task ':app:mergeDebugResources'. > Error: java.util.concurrent.ExecutionExcepti
- Codeforces round#429 div2 C
- composer安装laravel
- 引入布局与创建自定义控件
- 常用的Linux命令
- 推荐一个网站
- NOIP2009普及组-细胞分裂
- 算法竞赛入门经典java版程序CH3 UVA1585
- 史上最全的软件工程师资料收集
- 网络判断