当前位置:网站首页>2022 Henan Mengxin League Game (5): University of Information Engineering C - Throwing a Handkerchief
2022 Henan Mengxin League Game (5): University of Information Engineering C - Throwing a Handkerchief
2022-08-10 06:33:00 【WA_Automata】
C - 丢手绢
求一下 x + m ∗ 1 0 k x + m * 10^{k} x+m∗10k 就可以了,Remember to take the modulo in the middle
#include<iostream>
using namespace std;
typedef long long LL;
LL ksm(LL a,LL b,LL p)
{
LL res=1;
for(;b;b>>=1)
{
if(b&1) res=res*a%p;
a=a*a%p;
}
return res;
}
int main()
{
LL n,m,k,x;
cin>>n>>m>>k>>x;
cout<<(x+m*ksm(10,k,n)%n)%n<<endl;
return 0;
}
边栏推荐
猜你喜欢
随机推荐
tqdm高级使用方法(类keras进度条)
强化学习_08_Datawhale针对连续动作的深度Q网络
Analysis of minix_super_block.s_nzones of mkfs.minix.c
Kernel Image File Format
Unity扩展编辑器EditorWindow 小玩意(一)
COLMAP+OpenMVS实现物体三维重建mesh模型
2022河南萌新联赛第(五)场:信息工程大学 C - 丢手绢
About MongoDb query Decimal128 to BigDecimal problem
强化学习_06_pytorch-DQN实践(CartPole-v0)
order by injection and limit injection, and wide byte injection
高质量WordPress下载站模板5play主题
语法基础(判断语句)
请问一下。Oracle CDC 连接器支持 LogMiner 和 XStream API 两种方式捕
Unity2D动画生成操作(简单)
背包问题 c语言版
强化学习_10_Datawhale稀疏奖励
Reproduce dns out-band data combined with sqlmap
Introduction to KDE Framework
Qt借助隐藏控件和QSS绘制重复元素
Two-dimensional cartoon rendering of strokes