当前位置:网站首页>幂次方(暑假每日一题 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;
}
边栏推荐
猜你喜欢

ShardingSphere入门

ABAP Data Types 和XSD Type 映射关系以及XSD Type属性

怎么使用【jmeter正则表达式提取器】解决返回值作参数的问题

90. (cesium house) cesium height monitoring events

The precise effect of network integration promotion outsourcing in the era of Internet of Things-Shenzhen Win-Win World News

UGUI - Events, iTween Plugin

day16--抓包工具Charles的使用

2022-08-01 网工进阶(二十三) VLAN高级技术-VLAN聚合、MUX VLAN

第十六天&charles的基本操作

Rust学习:6.3_复合类型之元组
随机推荐
深度剖析“八大排序”(上)_ 探寻一些不为人知的细节
Rust学习:6.5_复合类型之数组
The precise effect of network integration promotion outsourcing in the era of Internet of Things-Shenzhen Win-Win World News
mySQL add, delete, modify and check advanced
js reduce
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?
Different command line styles
Go-Excelize API源码阅读(十一)—— GetActiveSheetIndex()
【Unity入门计划】2D游戏实现敌人来回移动控制脚本
NPU architecture and force analysis
Johnson全源最短路
【OAuth2】十九、OpenID Connect 动态客户端注册
ShardingSphere入门
Spotify使用C4模型表达其架构设计
DAY26: GetShell project
Uni-app develops WeChat applet using local images as background images
【业务架构】价值链分析:提高客户价值和盈利能力
DGIOT 30 million meters set pressure reading
物联网时代下的网络整合推广外包精准化效果-深圳双赢世讯
【NeRF】原始论文解读