当前位置:网站首页>幂次方(暑假每日一题 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;
}
边栏推荐
猜你喜欢
【OAuth2】二十、OAuth2扩展协议 PKCE
张驰课堂:老板会武术,谁也挡不住!六西格玛培训的魅力
iwemeta metaverse: Ali's first COO: how to build a sales force
TensorFlow 2.9的零零碎碎(一)
VS2013-debug assembly code-generate asm file-structure memory layout-function parameter stack-calling convention
Unity—UGUI控件
DAY26: GetShell project
本地生活商家如何通过短视频赛道,提升销量曝光量?
It is obvious that a unique index is added, why does it still generate duplicate data?
PTA 习题2.2 数组循环左移
随机推荐
不同的命令行风格
Uni-app develops WeChat applet using local images as background images
推荐几个高质量的软件测试实战项目
Relaxation class: the boss will martial arts, who also can not hold up against!The charm of six sigma training
Rust learning: 6.4_ enumeration of composite types
NPU architecture and force analysis
[深入研究4G/5G/6G专题-56]: L3信令控制-5-无线承载管理
组合数模板
Class Notes (7) (1) - #647. Find the root and the child (root)
mySQL add, delete, modify and check advanced
【OAuth2】二十、OAuth2扩展协议 PKCE
[OAuth2] 20. OAuth2 Extended Protocol PKCE
1-31部 1-31套 和硬件工程师90天学习资料及笔记汇总
Solve the problem that the win10win7win8 system cannot find the specified module and cannot register the desert plug-in
VMware ESX Server常用命令行
Rust learning: 6.3_ Tuples of composite types
并查集模板
Process management (dynamic)
速卖通卖家如何抓住产品搜索权重
Rust learning: 6.1_Slices of composite types