当前位置:网站首页>幂次方(暑假每日一题 20)
幂次方(暑假每日一题 20)
2022-08-10 08:34:00 【sweetheart7-7】
对任意正整数 N N N,计算 X N m o d 233333 X^N~mod~233333 XN mod 233333 的值。
输入格式
共一行,两个整数 X X X 和 N N N。
输出格式
共一行,一个整数,表示 X N m o d 233333 X^N~mod~233333 XN mod 233333 的值。
数据范围
1 ≤ X , N ≤ 1 0 9 1≤X,N≤10^9 1≤X,N≤109
输入样例:
2 5
输出样例:
32
#include<iostream>
using namespace std;
typedef long long LL;
const int mod = 233333;
int pow(int x, int n){
int res = 1;
while(n){
if(n & 1) res = ((LL)res * x) % mod;
x = ((LL)x * x) % mod;
n >>= 1;
}
return res;
}
int main(){
int x, n;
cin >> x >> n;
cout << pow(x, n) << endl;
return 0;
}
边栏推荐
- mySQL增删改查进阶
- 1-31部 1-31套 和硬件工程师90天学习资料及笔记汇总
- In the SQL SERVER database, if the data of the table is added, deleted, or modified, will the index of the table be recorded in the ldf log?
- Rust learning: 6.2_ Tuples of composite types
- 【NeRF】原始论文解读
- js函数聚合的三种实现方式
- js读取excel时间格式转换
- 差分、前缀和模板
- UGUI - Events, iTween Plugin
- The implementation of the seemingly useless component (text gradient) in NaiveUI is so simple
猜你喜欢
【业务架构】价值链分析:提高客户价值和盈利能力
IDLE development wordCount program (5)
2022-08-01 网工进阶(二十四) STP进阶知识
J9数字论:关于DAO 特点的宏观分析
高性能短连接设计
The precise effect of network integration promotion outsourcing in the era of Internet of Things-Shenzhen Win-Win World News
明明加了唯一索引,为什么还是产生重复数据?
CTFSHOW七夕杯web
The sixteenth day & the basic operation of charles
NPU architecture and force analysis
随机推荐
【微信小程序】一文读懂页面导航
JS reduce
快速输入当前日期与时间
占位占位1
CV-人脸识别-2018:ArcFace
【一起学Rust | 进阶篇 | RMQTT库】RMQTT消息服务器——安装与集群配置
phpstudy starts automatically
Unity—UGUI control
NaiveUI中看起来没啥用的组件(文字渐变)实现原来这么简单
硬件工程师90天学习资料及笔记汇总
二叉树 --- 堆
SQL SERVER 数据库,表的数据发生增删改,该表的索引会在ldf日志中记录吗?
1499. 满足不等式的最大值 堆/双端队列
uni 小程序腾讯地图polygon背景透明度
[Learn Rust together | Advanced articles | RMQTT library] RMQTT message server - installation and cluster configuration
How AliExpress sellers seize product search weight
Rust学习:6.5_复合类型之数组
Spotify使用C4模型表达其架构设计
DAY26: GetShell project
UGUI—事件,iTween插件