思路:

概率结论题,好像属于线性递推,现在也不太懂(lll¬ω¬)

 #define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#include <cstdio>//sprintf islower isupper
#include <cstdlib>//malloc exit strcat itoa system("cls")
#include <iostream>//pair
#include <fstream>
#include <bitset>
//#include <map>
//#include<unordered_map>
#include <vector>
#include <stack>
#include <set>
#include <string.h>//strstr substr
#include <string>
#include <time.h>//srand(((unsigned)time(NULL))); Seed n=rand()%10 - 0~9;
#include <cmath>
#include <deque>
#include <queue>//priority_queue<int, vector<int>, greater<int> > q;//less
#include <vector>//emplace_back
//#include <math.h>
//#include <windows.h>//reverse(a,a+len);// ~ ! ~ ! floor
#include <algorithm>//sort + unique : sz=unique(b+1,b+n+1)-(b+1);+nth_element(first, nth, last, compare)
using namespace std;//next_permutation(a+1,a+1+n);//prev_permutation
#define mem(a,b) memset(a,b,sizeof(a))
#define fo(a,b,c) for(a=b;a<=c;++a)//register int i
#define fr(a,b,c) for(a=b;a>=c;--a)
#define pr printf
#define sc scanf
void swapp(int &a,int &b);
double fabss(double a);
int maxx(int a,int b);
int minn(int a,int b);
int Del_bit_1(int n);
int lowbit(int n);
int abss(int a);
//const long long INF=(1LL<<60);
const double E=2.718281828;
const double PI=acos(-1.0);
const int inf=(<<);
const double ESP=1e-;
const int mod=(int)1e9+;
const int N=(int)1e6+; long long qpow(long long a,long long b,long long mod)
{
long long ans;
a%=mod;
ans=;
while(b!=)
{
if(b&)
ans=(ans*a)%mod;
b/=;
a=(a*a)%mod;
}
return ans;
} int main()
{
int T;
sc("%d",&T);
long long ans=,res;
while(T--)
{
long long n,m;
sc("%lld%lld",&n,&m);
if(n==)
{
res=;
}
else
{
if(m==)
{
res=;
}
else
res=qpow(n-,mod-,mod);
}
ans=ans*res;
ans%=mod;
pr("%lld\n",ans);
}
return ;
} /**************************************************************************************/ int maxx(int a,int b)
{
return a>b?a:b;
} void swapp(int &a,int &b)
{
a^=b^=a^=b;
} int lowbit(int n)
{
return n&(-n);
} int Del_bit_1(int n)
{
return n&(n-);
} int abss(int a)
{
return a>?a:-a;
} double fabss(double a)
{
return a>?a:-a;
} int minn(int a,int b)
{
return a<b?a:b;
}

最新文章

  1. C++ 函数形参发生动态绑定时指针增长步长与静态类型一致
  2. 封装好的AFN网络请求框架和MBProgress
  3. jQuery 学习笔记
  4. NSString和NSMutableString的创建及其一些常用方法
  5. webservice远程调试开启
  6. blade模版之页面的嵌套
  7. 2016 Al-Baath University Training Camp Contest-1 G
  8. js正则表达式中的特殊字符
  9. 【转】[WCF REST] 帮助页面与自动消息格式(JSON/XML)选择
  10. PHP操作cookie
  11. 微信小程序wepy开发,$apply()不能更新页面数据的情况
  12. centos 查看USB接口的版本
  13. BZOJ2160: 拉拉队排练
  14. 关闭R语言载入包时候的警告
  15. MySQL 组合查询 concat
  16. k8s本地搭建相信步骤
  17. Single Image Haze Removal(图像去雾)-CVPR’09 Best Paper
  18. 表单元素 disabled 和 readonly 辨析
  19. 使用virtualenv为应用提供了隔离的Python运行环境
  20. HDU 5501——The Highest Mark——————【贪心+dp】

热门文章

  1. [科普] CPU, GPU, TPU的区别
  2. func&lt;T&gt; 和 action&lt;T&gt;
  3. jmeter参数化之 CSV data set config
  4. vxworks 开发环境搭建
  5. 一个继承的 DataGridView
  6. LC 763. Partition Labels
  7. -moz-box-shadow
  8. mongdb mapReduce聚合操作
  9. U盘文档自动备份
  10. 五十六:flask文件上传之上传文件与访问上传的文件