Codeforces Round #449 (Div. 2) B. Chtholly's request

5G NR 物理层 流程一:从帧结构到TB块,PDSCH/PUSCH 资源映射与TBS计算实战 本文详细解析了5G NR物理层流程,从帧结构到TB块的计算,重点介绍了PDSCH/PUSCH资源映射与TBS计算的实战方法。通过具体案例和公式推导,帮助工程师掌握5G NR资源分配、MCS选择及TBS量化过程,解决实际部署中的常见问题。 阅读详情
B. Chtholly's request
time limit per test2 seconds
memory limit per test256 megabytes
inputstandard input
outputstandard output
— Thanks a lot for today.
— I experienced so many great things.

— You gave me memories like dreams... But I have to leave now...

— One last request, can you...

— Help me solve a Codeforces problem?

— ......

— What?

Chtholly has been thinking about a problem for days:

If a number is palindrome and length of its decimal representation without leading zeros is even, we call it a zcy number. A number is palindrome means when written in decimal representation, it contains no leading zeros and reads the same forwards and backwards. For example 12321 and 1221 are palindromes and 123 and 12451 are not. Moreover, 1221 is zcy number and 12321 is not.

Given integers k and p, calculate the sum of the k smallest zcy numbers and output this sum modulo p.

Unfortunately, Willem isn't good at solving this kind of problems, so he asks you for help!

Input
The first line contains two integers k and p (1 ≤ k ≤ 105, 1 ≤ p ≤ 109).

Output
Output single integer — answer to the problem.

Examples
input
2 100
output
33
input
5 30
output
15
Note
In the first example, the smallest zcy number is 11, and the second smallest zcy number is 22.
In the second example,(11+22+33+44+55)%30=15.

题目大意:
给你一个k和p,求前k个偶数数字回文的和并对p余。这个题唯一的坑点就在于1e5时它最大的数据是1000000001,所以单纯的打表是会超时的。而这里队友的思路就把这个题目简单化了。你只需求前1e5的偶数数字回文,再加上(它乘pow(10,它本身的位数)+它的逆置)然后不断累加前k个 就得得到了最终答案

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
const long long N=1e5+1;
const int M=3e5+10;
long long s[M];
int flag[M];

long long f(long long n) //求逆置
{
    long long k=0,m;
    m=n;
    while(m)
    {
        k=k*10+m%10;
        m/=10;
    }
    return k;
}
int fff(long long n) //判断是否是回文
{
    long long k;
    k=f(n);
    if(k==n)
        return 1;
    else
        return 0;

}
long long ff(long long n) //判断位数
{
    long long k=0;
    while(n/10>0)
    {
        k++;
        n/=10;
    }
    k++;
    return k;
}

int main()
{
    ios::sync_with_stdio(false);
    long long k,p;
   long long i;
   int j=0,tmp=0;
    memset(s,0,sizeof(s));


    while(cin>>k>>p)
    {
        long long ans=0;

        for( i=1; i<=k; i++)
        {
            ans=(ans+i*(long long)pow(10,ff(i))+f(i))%p;
        }
        cout<<ans<<endl;
    }
    return 0;
}
控制算法研发工程师(博士)职位深度解析与面试指南 摘要:广东万和新电气股份有限公司招聘控制算法研发工程师(博士),工作地点佛山顺德。职位要求2026届博士学历,电子信息工程或控制科学与工程专业。主要职责包括:1)燃气热水、热泵等系统的电控软件设计与优化;2)开发PID、模糊控制、ADRC、MPC等智能算法,应用于恒温控制、变频调节等场景。重点考察算法研发能力、系统稳定性优化及嵌入式实现经验。该职位提供三年资深工程师培养计划,需具备扎实的控制理论基础和工程实践能力,能够处理非线性系统、多工况自适应等复杂控制问题。 阅读详情

相关推荐

利用HFSS仿真优化圆极化微带天线的耦合馈电设计

本文深入探讨了利用HFSS仿真软件优化圆极化微带天线性能的关键方法。通过对比传统直接馈电与耦合馈电方式,详细阐述了耦合馈电在提升阻抗匹配、改善轴比带宽及增强设计鲁棒性方面的显著优势。文章结合FR4板材的实战案例,逐步演示了在HFSS中建立模型、进行参数扫描与圆极化性能优化的完整流程,为设计高性能、高纯度的圆极化天线提供了实用指南。

weixin_29233333的博客 547

Codeforces Round #449 (Div. 2) B. Chtholly's request

题意:回文数求和取模,回文数必须满足:①偶数位数②回文数。输入k求前k项的回文数之和模p,(1<=k<=10^5) 思路:刚开始是直接去求回文数,那么肯定超时,之后找了一下规律,发现可以使用。求前k项之和,其实就是1,2,3,4......120.....k.....的于自己构成回文数之和(11,22,33,44.....120021......kk') #inc...

aisongdan0899的博客 152

原理图分享二(信盈达CorexM4核心板STM32F407VGT6)

这是第二张板子的原理图分享,这也是当时大学里学习的一个板子。 原理图分享二(信盈达CorexM4核心板STM32F407VGT6)

让学习成为一种习惯 6891

Codeforces Round #449 (Div. 2) B. Chtholly's request

B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output — Thanks a lot for today. — I expe

chu_shang_的博客 184

手把手教你用Multisim搭建FM直接调频电路(附完整波形分析)

本文通过Multisim仿真软件,手把手教你搭建FM直接调频电路。详细介绍了从核心概念理解、压控振荡器(VCO)参数设置、电路搭建与波形观测,到带通滤波器设计与信号优化的完整流程。通过对比滤波前后的时域波形与频谱分析,帮助读者直观理解频率调制原理,并提供了常见问题的排查思路与参数调试方法,将抽象的通信理论转化为可操作的实践技能。

weixin_29230773的博客 214

3D视觉-结构光测量-线结构光测量

线结构光测量中,由激光器射出的激光光束透过柱面透镜扩束,再经过准直,产生一束片状光。这片光束像刀刃一样横切在待测物体表面,因此线结构光法又被成为光切法。线结构光测量常采用二维面阵CCD作为接受器件,因此只要通过增加垂直于面阵探测器的第三维度方向,就可以实现对三维物体的测量。

qq_20660115的博客 3126

LDO不是黑盒稳压器:压差、环路、PSRR与热设计四大硬核维度

LDO(低压差线性稳压器)常被误认为简单电源器件,实则是决定系统稳定性的关键模拟闭环系统。其核心原理在于动态阻抗控制与多物理场耦合,技术价值体现在毫伏级电压精度、微秒级瞬态响应及高信噪比供电能力。典型应用场景包括高精度ADC参考源、RF收发器供电、医疗影像前端及车载ECU等对噪声、稳定性与温度鲁棒性要求严苛的领域。本文深入剖析LDO设计中四个易被忽视的硬核维度:压差的动态阈值本质、PCB布局对环路稳定性的隐性破坏、PSRR作为闭环噪声传递函数的真实表现,以及结-板热阻(RθJB)主导的热设计陷阱——所有结论

weixin_34258838的博客 265

手把手调试Android 14 ShellTransitions:用Log追踪ActiveTransition与Handler匹配过程

本文详细介绍了在Android 14中调试ShellTransitions机制的方法,重点通过Log追踪ActiveTransition与Handler的匹配过程。文章提供了关键日志点植入策略、Handler匹配机制解析及实战调试案例,帮助开发者解决窗口转场动画中的卡顿和错乱问题,提升系统动画性能。

weixin_42652674的博客 429

Codeforces Round #449 (Div. 2) B. Chtholly's request (思维

B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output — Thanks a lot for today. — I expe

1988的博客 477

Windows正在配置Xftp6在下面的框输入包含安装程序包“Xftp 6.msi“的文件夹的路径

Windows正在配置Xftp6在下面的框输入包含安装程序包“Xftp 6.msi"的文件夹的路径

m0_56588258的博客 2470

kali攻防第2章 内网称霸之渗透安卓系统

Kali内网称霸之渗透安卓系统   准备工具   1、准备一部实体android手机 2、使用KALI系统     要用到强大的msf工具(metasplot)   流程步骤 1、启动msf命令是msfconsole 2、在安卓手机上安装一个自己生成的apk木马程序 3、利用msf工具来远程连接Android系统   1)启动msf(注意这里是链接msf就行了不需要进

安全参透之旅 1万+

Codeforces Round #449 (Div. 2) B Chtholly's request (预处理)

B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output — Thanks a lot for today. — I expe

Sizaif's 小屋 356

AUTOSAR&UDS 理论要点及isolar实战-DEM模块

从这节开始,将讲解UDS诊断中非常重要的知识点:故障事件触发、故障信息上报、故障信息处理、故障信息存储和故障系统降级,后续会陆续更新。

cqaa11的博客 552

Codeforces Round #449 (Div. 2) B. Chtholly's request【偶数位回文数】

B. Chtholly's request time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output — Thanks a lot for today. — I experienced ...

weixin_34178244的博客 229

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

Codeforces Round #449 (Div. 2) B. Chtholly's request(打表找规律)

B. Ralph And His Magic Field time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Ralph has a magic field which is ...

weixin_30924239的博客 123

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

Codeforces Round #449 (Div. 2) A-C题解

A. Scarborough Fair time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Are you going to Scarborough Fair? Parsley, sage, rosemary and thyme. Remember me to one who lives there. He once was the true l

Ever_glow的博客 812

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

Codeforces Round #449 (Div. 2) 总结(12.2)

我发现最近比赛的状态真的很差, 两场CF都是solve 1 out 5,打CSP交了三百块钱第三题大模拟写到崩溃,第四题图论莫名其妙的70分的做法只有10分,估计还要去打一次CSP了。 武科新生赛前70min得了五个气球,后170min只做了一个题还把一个简单的题目看错考后才发现。

Gallinari的博客 376

Codeforces 939A Love Triangle(三角恋问题)

题目:As you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with number i like

Puppet__的博客 1315

Codeforces 932A Palindromic Supersequence (超级水)

题目:You are given a string A. Find a string B, where B is a palindrome and A is a subsequence of B.A subsequence of a string is a string that can be derived from it by deleting some (not necessarily con

Puppet__的博客 993

CodeForces 875B ( Sorting the Coins) 难度蛮大的一道题目 题目说了一堆主要还是找规律

B. Sorting the Coins time limit per test: 1 second memory limit per test: 512 megabytes input: standard input output: standard output Recently, Dima met

Puppet__的博客 910

Codeforces 908A (New Year and Counting Cards)914A(Perfect Squares)

题目时空门Your friend has n cards.You know that each card has a lowercase English letter on one side and a digit on the other.Currently, your friend has laid out the cards on a table so only one side of eac

Puppet__的博客 670

Codefroces 916A Jamie and Alarm Snooze

Jamie loves sleeping. One day, he decides that he needs to wake up at exactly hh: mm. However, he hates waking up, so he wants to make waking up less painful by setting the alarm at a lucky time. He wi

Puppet__的博客 662

CodeForces 844A Diversity (超级超级水唯一需要想得就是开个标记数组吧)

**A. Diversity** time limit per test :1 second memory limit per test: 256 megabytes input: standard input output: standard output Calculate the minimum number of

Puppet__的博客 659

Codeforces 939B(Hamster Farm)

这道题目很明显的就是一道翻译题 很简单没有坑 这里就不详细解释了,详解请看代码。题目:Dima has a hamsters farm. Soon N hamsters will grow up on it and Dima will sell them in a city nearby.Hamsters should be transported in boxes. If some box is

Puppet__的博客 648

Codeforces 919A (Supermarket)

题目时空门We often go to supermarkets to buy some fruits or vegetables, and on the tag there prints the price for a kilo. But in some supermarkets, when asked how much the items are, the clerk will say that

Puppet__的博客 556

(CodeForces 883A) The Meaningless Game 纯正的数学思维题(有点卡cin时间)

**A. The Meaningless Game** time limit per test: 1 second memory limit per test:256 megabytes input: standard input output: standard output Slastyona and her loy

Puppet__的博客 548
上一篇: 并查集(以hdu 1232 畅通工程为例)
下一篇: POJ 1260 简单dp问题 Pearls
Puppet__
博客等级 码龄9年 319粉丝 328原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值