zoj1180 Self Numbers

6.6kW的车载充电器(On-Board Charger, OBC)电路分析 图片展示了6.6kW的车载充电器(On-Board Charger, OBC)电路,其中包含双向和单向两种拓扑结构。接下来我们将深入分析每个模块的设计、原理及其优势,以帮助理解不同结构在实际应用中的选型和应用。 阅读详情
  1. //zoj1180 Self Numbers
  2. //Accepted 1180 C++ 00:00.29 1360K
  3. #include <stdio.h>
  4. #include <string.h>
  5. #define MAXN 1000000
  6. bool flag[MAXN+1];//index is self number
  7. int sum(int n)
  8. {
  9.        int s = 0;
  10.        while (n){
  11.               s += n%10;
  12.               n /= 10;
  13.        }
  14.        return s;
  15. }
  16. void generate()
  17. {
  18.        int i;
  19.        memset(flag,false,sizeof(flag));
  20.        for (i=1; i<=MAXN; ++i)
  21.               if (!flag[i]) {
  22.                      int n = i+sum(i);
  23.                      while (n<=MAXN && !flag[n]){
  24.                             flag[n] = true;
  25.                             n = n+sum(n);
  26.                      }
  27.               }
  28.        for (i=1; i<=MAXN; ++i)
  29.               if (!flag[i]) printf ("%d/n",i);
  30. }
  31. int main()
  32. {
  33.        generate();
  34.        return 0;
  35. }
  36.  
Freeswitch DTMF 按键无法接收问题修复 freeswitch 在接收到 update后,会更新成新的 payload type,但是给的200响应,仍然是旧的,这时候就会导致手机侧认识需要发送旧的payload,所以发到 fs 后就会导致直接丢包,不去处理RTP包了。呼叫时需要设置通道变量 rtp_manual_rtp_bugs=ACCEPT_ANY_PAYLOAD ,这时候FS 就不会对包的payload进行判断,直接判定通过。应该修复 freeswitch 给响应时,应该根据收到的 payload 发送给手机,但是一直未找到正确的路径。 阅读详情

相关推荐

Sobel原理及计算过程详解

该算子包含两组3x3的矩阵,分别为横向及纵向,将之与图像作平面卷积,即可分别得出横向及纵向的亮度差分近似值。首先,我们需要构建一个Sobel算子,通常是一个 3x3 的矩阵。Sobel算子可以分别计算水平和垂直方向的梯度值,然后将两者合并得到总梯度值。索贝尔算子(Sobel operator)主要用作边缘检测,在技术上,它是一离散性差分算子,用来运算图像亮度函数的灰度近似值。所以,我们假设选择图像矩阵中的点A(1, 1),即第二行第二列的元素,对应的。接下来,我们将使用Sobel算子计算这个点的梯度值。

2301_76461741的博客 1万+

zoj 1180 Self Numbers(大数,灵活题)

In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for d

芒果街上的小屋(此博客暂时停用) 690

华为使用MicroG安装并使用Google服务教程

鉴于众多华为手机用户因无法使用Google服务而感到不便,我经过多次摸索和测试,总结了一份简单易懂的教程,希望能够帮助到大家。无论是需要使用Google Play商店下载应用,还是需要使用Google服务进行工作和学习,本文将详细介绍如何在华为手机上安装并使用Google服务。二、前置条件软件要求:Aurora Store(替代Google Play商店)、MicroG Companion、MicroG Server(替代Google框架)

weixin_41926602的博客 3万+

zoj 1180 Self Numbers

从1开始,以每一个标记为0的数为起点,产生序列,序列中的任何数的标记都置为1,最后找出标记为0的,即为所求数。 #include #include #include #define MAX 1000001 int a[MAX]; int getSum(int n){     int sum=n;     while(n>0){         sum+=(n%10);

journey_fan的专栏 570

Notepad++ XML Tools插件:手把手教你格式化混乱XML与一键语法检查(保姆级教程)

本文详细介绍了如何使用Notepad++的XML Tools插件格式化混乱的XML文件并进行一键语法检查。通过插件安装、格式化实战和语法排错的完整流程,帮助开发者高效处理XML数据,提升API通信和数据存储的工作效率。特别适合需要快速验证和整理XML配置的开发人员。

weixin_42619742的博客 328

STM32 USB AUDIO实战指南——从零构建音频设备

本文详细介绍了如何使用STM32F407构建USB音频设备,从硬件准备到软件配置,再到音频播放和录制功能的实现。通过STM32CubeMX配置和实战代码示例,帮助开发者快速掌握USB Audio Class规范,实现低延迟、高质量的音频传输,适用于语音交互、音乐播放等多种场景。

weixin_42549037的博客 484

[HDU4432][TJ02B]Sum of divisors

#include #include #include #include #include #include #include #include #include #define inf (1ull<<63)-1 #define N 100005 #define maxn 100005 #define pb(a) push_back(a) #define mem(a,b)

wgxlovezl 410

维护测试监控LLM应用

LangFuse: 开源 + SaaS(免费/付费),LangSmith 平替,可集成 LangChain 也可直接对接 OpenAI API;LangSmith: LangChain 的官方平台,SaaS 服务(免费/付费),非开源,企业版支持私有部署;调试 Prompt 的 Playground测试/验证系统的相关指标数据集管理各种指标监控与统计:访问量、响应时长、Token 费等等。

SunnyRivers 1782

【2017多校】第四场C题:CountingDivisors

预备知识:一个大于11的正整NN,如果它的标准分解式为:N=Pa11Pa22⋯PannN = P_1^{a_1}P_2^{a_2}\cdots P_n^{a_n} ,那么它的正因数个数为σ0(N)=(1+a1)(1+a2)⋯(1+an)\sigma_0(N) = (1+a_1)(1+a_2)\cdots(1+a_n)。题目:Counting Divisors Time Limit: 10000

m674019130的博客 661

深入解析EtherCAT通讯DS402协议下的伺服电机控制模式选择与配置

本文深入解析了EtherCAT通讯DS402协议下的伺服电机控制模式选择与配置,详细介绍了六种核心控制模式(如PPM、CSP、CSV、CST)的应用场景及实战技巧。通过EtherCAT和DS402协议的高效配合,实现工业自动化中伺服电机的精准控制,提升设备性能与稳定性。

h0i1j2k3l的博客 1175

Visual Studio调试技巧与实用方法总结(实战经验分享)

本文根据多年的项目实战经验,详细介绍一些Visual Studio常用的高效调试手段与技巧。

dvlinker的技术专栏 3万+

POJ1316 ZOJ1180 UVA640 Self Numbers

//2_2_1: Self Numbers 10000以内的自数 POJ1316 ZOJ1180 UVA640 #include #include #include using namespace std; const int N = 10000 + 100; int sum(int n) { if(n < 10) return n; else return (n % 10) + su

301

嵌入式工程师成长之路(1)——元件基础(试读版)

上拉电阻阻值选错导致MCU反复重启?0欧电阻竟然能“背锅”信号干扰?高精密采样电阻的温漂毁了整个控制系统?——这些问题,都是基础不牢!优快云硬件领域头部博主十年经验汇总,涵盖电阻分类、封装、实战选型、避坑指南,附带职业进阶路径,助你从小白进阶为“电路医生”!

云轩阁 34万+

ZOJ1180 Self Numbers 开始刷水题模式

In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for dig

水题之王 378

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

ZOJ Problem Set–1180 Self Numbers

Time Limit: 10 Seconds Memory Limit: 32768 KB In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be...

dcl67283的博客 86

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

php C++ - zoj 1180 Self Numbers

AC - C++// Run Time(ms) 1160// Run Memory(KB) 1160#include #include #include using namespace std;int maxDigit = 6;const int NUMBER = 1000001;char arr[NUMBER];void run(int ndigit, i

jasonjiang1985的专栏 591

HDU1128 UVA640 UVALive5326 ZOJ1180 Self Numbers【水题】

Self Numbers Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8398    Accepted Submission(s): 3683 Problem Description In 1949 the Ind

海岛Blog 1016

Self Numbers POJ - 1316 ZOJ 1180 UVA640

In 1949 the Indian mathematician D.R. Kaprekar discovered a class of numbers called self-numbers. For any positive integer n, define d(n) to be n plus the sum of the digits of n. (The d stands for dig...

❂ 302

POJ1316 Self Numbers【水题】

Self Numbers Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 24481   Accepted: 13690 Description In 1949 the Indian mathematician D.R. Kaprekar discovered a

海岛Blog 1026

ZOJ-1180

水题,自己看吧 #include #include #include static int d(int n) { int sum = n; while (n) { sum += n % 10; n /= 10; } return sum; } int main() { int i, temp, *array = malloc(1000001 * sizeof(int));

xhldtc的专栏 683

CF_448E_Divisors

Divisors time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Bizon the Champion isn't just friendly, he also is a rigorous

OTTFF的博客 677

zoj 1180

 //1180#include using namespace std;#define MAX 1000001bool x[MAX];//from the initial to calculate the number.which satisfy the equation ABCD = abcd + a + b + c +d;int main(){ memset

Solidfish的专栏 1215

Divisors of the Divisors of An Integer

题目链接:Divisors of the Divisors of An Integer 我们直接看每个质因子的贡献即可。 假设这个质因子有x个,那么我们构造某一个数的时候可以选0,1,2,3,…,x个,然后对应的因子就有1,2,3,4,5,…,x个。 所以每个因子的贡献就是(x+1)*(x+2)/2 但是要注意1e7+7不是质数,所以没有逆元,需要在取模之前除以2. 然后对于阶乘分解我们可以提前预处理出所有质数。 复杂度:O(T*n) AC代码: #pragma GCC optimize("-Ofast

青烟绕指柔的博客 605

HDU 6069 Counting Divisors(求因子)

Counting Divisors Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others) Total Submission(s): 2316    Accepted Submission(s): 833 Problem Description In mat

Mr_Treeeee的博客 420

POJ1316 ZOJ1180 UVA640

本题是求1-10000以内的自私数,主要思想是利用帅选法进行求解。 首先:构造一个数组a,且a[i]=i 然后:设置a[d(i)]=i 最后:扫描数组a,筛选出a[i]=i的数 Java代码如下:

qq_33257238的博客 338
上一篇: zoj1160 Biorhythms
下一篇: zoj1216 Deck
fairylan
博客等级 码龄21年 2粉丝 33原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值