How Many Sets I
来源:互联网 发布:德龙集团网络培训学院 编辑:程序博客网 时间:2024/05/20 12:25
注意本题有序,就当做是序偶就行了!!从而推导公式ans=(2^k-1)^n
代码:
#include <algorithm>#include <iostream>#include <cstring>#include <cstdlib>#include <vector>#include <queue>#include <cstdio>#include <cmath>#include <string>#include <stack>#include <cctype>using namespace std;#define mod 1000000007long long fun(long long a,long long p,long long m){ if(p==0) return 1; long long r=a%m; long long k=1; while(p>1) { if((p&1)!=0) { k=(k*r)%m; } r=(r*r)%m; p>>=1; } return (r*k)%m;}int main(){ long long n,k; while(cin>>n>>k) { long long sum; sum=fun(2,k,mod)-1; long long temp; temp=fun(sum,n,mod); cout<<temp<<endl; } return 0;}
- How Many Sets I
- How Many Sets I
- zoj3556 How Many Sets I-------容斥
- zoj How Many Sets I(组合计数)
- How Many Sets
- How Many Sets
- ZOJ 3556 How Many Sets I 解题报告(数论)
- [容斥原理] zoj 3556 How Many Sets I
- ZOJ 3556 How Many Sets I 二项式+容斥
- ZOJ 3556 How Many Sets I (容斥)
- ZOJ3556 How Many Sets I【容斥原理】
- zoj 3556 How Many Sets I - 容斥原理
- zoj 3556 How Many Sets I(容斥原理)
- Sicily 4428. How Many Sets
- Sicily 4428 How Many Sets
- zoj How Many Sets I 3556 (容斥原理&&规律)
- [2014Contest_1I]How Many Sets II
- ZOJ 3557 How Many Sets II
- JDK与JRE的区别,以及安装目录的关系
- 01-php连接mysql数据库初步
- WebService从零到项目开发使用3—技术研究之Axis2 POJO开发Web服务
- CentOS 6.4 图文安装教程
- Oracle创建主键自增表
- How Many Sets I
- Python写的deviantArt小爬虫
- QTreeWidget 和QTreeWidgetItem用法总结
- iis服务器设置Android apk下载的MIME 设置
- Android布局之Layout_weight属性解析
- telnet服务
- PowerDesigner在使用过程中的几处必要设置---整理
- FME及myfme最新安装包下载地址
- WebService从零到项目开发使用4—技术研究之Axis2 集成Spring框架