徐州A
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define ms(arr,a) memset(arr,a,sizeof arr)
#define debug(x) cout<<"< "#x" = "<<x<<" >"<<endl
const int mod=1e9+7;
int quick_pow(int a,int n)
{
int ret=1;
while(n)
{
if(n&1)ret=1LL*ret*a%mod;
a=1LL*a*a%mod;
n>>=1;
}
return ret;
}
int n,k,ek;
int main()
{
//freopen("Input.txt","r",stdin);
//freopen("Output.txt","w",stdout);
int t;scanf("%d",&t);
while(t--)
{
scanf("%d%d",&n,&k);
ek=quick_pow(2,k);
int ans=ek;
for(int i=(n&1)+2;i<=n;i=i+2)
{
ans=(1LL*ans+1LL*ek*(ek-2)%mod*quick_pow(ek-1,i-2)%mod)%mod;
//debug(ans);
}
printf("%d\n",ans);
}
//freopen("CON","w",stdout);
//system("start Output.txt");
}
徐州A的更多相关文章
- Trace 2018徐州icpc网络赛 (二分)(树状数组)
Trace There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xx ...
- 2018 ICPC 徐州网络赛
2018 ICPC 徐州网络赛 A. Hard to prepare 题目描述:\(n\)个数围成一个环,每个数是\(0\)~\(2^k-1\),相邻两个数的同或值不为零,问方案数. solution ...
- 徐州网络赛B-BE,GE or NE【记忆化搜索】【博弈论】
In a world where ordinary people cannot reach, a boy named "Koutarou" and a girl named &qu ...
- 徐州网络赛A-Hard To Prepare【dp】【位运算】【快速幂】
After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a ...
- 徐州网络赛J-Maze Designer【最小生成树】【LCA】
After the long vacation, the maze designer master has to do his job. A tour company gives him a map ...
- 徐州网络赛G-Trace【线段树】
There's a beach in the first quadrant. And from time to time, there are sea waves. A wave ( xx , yy ...
- 徐州网络赛H-Ryuji doesn't want to study【线段树】
Ryuji is not a good student, and he doesn't want to study. But there are n books he should learn, ea ...
- 徐州网络赛F-Feature Trace【暴力】
Morgana is learning computer vision, and he likes cats, too. One day he wants to find the cat moveme ...
- 徐州网络赛C-Cacti Lottery【DFS】
54.19% 2000ms 262144K Morgana is playing a game called cacti lottery. In this game, morgana has a 3 ...
- 计蒜客 1460.Ryuji doesn't want to study-树状数组 or 线段树 (ACM-ICPC 2018 徐州赛区网络预赛 H)
H.Ryuji doesn't want to study 27.34% 1000ms 262144K Ryuji is not a good student, and he doesn't wa ...
随机推荐
- 2019级第一次月赛暨ACM工作室第一次招新赛、补题赛
A:最简单签到,没有之一 Description 此题简单如题意,就是求最大值 Input 多组输入 每组输入输入一串字符串(包括字母和数字),长度小于500 Output 每行输出字符ASCII值与 ...
- docker 容器容器之间网络通信 docker-compose.yaml 配置固定ip
1.创建自己的桥接网络 $ docker network create --subnet=172.18.0.0/16 mynetwork 2.docker-compose.yaml 文件格式demo ...
- 配置附加权限和LDAP
配置附加权限和LDAP 补充:调整root的权限为rwx(读,写,执行) 步骤:采用数值形式将目录/root的权限调整为rwx------ 1)查看原来的权限 [root@svr7~]#ls -ld ...
- 电商平台--Mysql主从搭建(2)
Master上授权从库: ```grant replication slave on *.* to slave1@ip identified by 'password';``` 基于数据库hotcop ...
- 【前端】CSS总结
======================== CSS层叠样式表======================== 命名规则:使用字母.数字或下划线和减号构成,不要以数字开头 一.css的语法-- ...
- ERC20代币(ETH)空投工具-创建代币
代币空投工具地址:http://tool.ethhelp.cn 适用币种: ETH和ERC20代币 使用建议: ERC代币空投,直投,ETH批量转小号 优势介绍: 1.可节省30%手续费 2.转几千地 ...
- docker 私有仓库 删除镜像
1.查找官方删除法 https://github.com/burnettk/delete-docker-registry-image 2.民用删除法 https://segmentfault.com/ ...
- String 对象-->split() 方法
1.定义和用法 split() 方法用于把一个字符串分割成字符串数组. 语法: string.split(separator,limit) 参数: separator:可选.字符串或正则表达式,从该参 ...
- 八、路由详细介绍之动态路由OSPF(重点)
一.OSPF介绍 OSPF优点:无环路.收敛快.扩展性好.支持认证 二.工作原理: 图中RTA.RTB.RTC每个路由器都会生成一个LSA, 通过LSA泛洪进行互相发送相互学习,形成LSDB (链路状 ...
- springboot https证书配置
如果公司有提供证书如: 拿到证书秘钥可直接在springboot 的配置文件中配置: server.ssl.key-store=classpath:cert.pfx server.ssl.key-st ...