Codeforces Round #262 (Div. 2) B

【TCGA-CRC】TCGA数据读取 本文介绍了如何从TCGA数据库中处理结肠癌(COAD)和直肠癌(READ)的RNA测序数据。首先,通过data.table::fread函数读取基因表达量文件,并检查基因ID和基因名称的一致性。接着,批量读取所有样本的TPM(Transcripts Per Million)数据,并将其合并为表达矩阵。随后,通过匹配样本ID和文件名,确保表达矩阵的列名与样本ID一致。最后,筛选出编码蛋白质的基因,并将处理后的数据保存为Rdata文件。整个过程涉及数据读取、合并、匹配和筛选,为后续的基因表达分析提供了基础。 阅读详情

题目:

B. Little Dima and Equation
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Little Dima misbehaved during a math lesson a lot and the nasty teacher Mr. Pickles gave him the following problem as a punishment.

Find all integer solutions x (0 < x < 109) of the equation:

x = b·s(x)a + c, 

where a, b, c are some predetermined constant values and function s(x) determines the sum of all digits in the decimal representation of number x.

The teacher gives this problem to Dima for each lesson. He changes only the parameters of the equation: a, b, c. Dima got sick of getting bad marks and he asks you to help him solve this challenging problem.

Input

The first line contains three space-separated integers: a, b, c (1 ≤ a ≤ 5; 1 ≤ b ≤ 10000;  - 10000 ≤ c ≤ 10000).

Output

Print integer n — the number of the solutions that you've found. Next print n integers in the increasing order — the solutions of the given equation. Print only integer solutions that are larger than zero and strictly less than 109.

Sample test(s)
input
3 2 8
output
3
10 2008 13726 
input
1 2 -18
output
0
input
2 2 -1
output
4
1 31 337 967 

题意分析:

题意很清楚,就是计算x和x各位和s(x)的一个关系等式是否成立,成立就输出x。这题思路形成得还是比较快,枚举s(x)。s(x)的范围是1到81(我最开始SB的以为10的9次方是9位数,开始写的72哭)。然后就对着式子敲出来就行了,注意long long和x的范围小于1e9,这两个地方是这道题的cha点,各种血腥的cha啊。我提交的过的代码没有判断小于1e9,然后我就天真的把lock了。呵呵呵呵呵,然后被cha了,呵呵呵呵呵呵。还好考5 2 100 cha到一个人挽回点损失~

代码:

#include <cstdio>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <iostream>

using namespace std;

int d[100000];
int main()
{
    int a,b,c,sum,cou;
    long long temp,flag;
    while(cin>>a>>b>>c)
    {
        memset(d,0,sizeof(d));
        cou=0;
        for(int i=1;i<=81;i++)
        {
            sum=0;
            temp=1;
            for(int j=0;j<a;j++)
            {
                temp*=i;
            }
            temp=b*temp;
            temp=c+temp;
            //printf("%d ",temp);
            flag=temp;
            while(temp)
            {
                sum+=temp%10;
                temp/=10;
            }
            if(sum==i&&flag>0&&flag<(1e9))
                d[cou++]=flag;
        }
        if(cou==0)
            printf("0\n");
        else
        {
            printf("%d\n%d",cou,d[0]);
            for(int i=1;i<cou;i++)
            {
                printf(" %d",d[i]);
            }
            printf("\n");
        }
}
}


基于stm32的数控恒压恒流电源设计方案 基于stm32的数控恒压恒流电源设计方案 基于stm32的数控恒压恒流电源设计方案 不包实物,可自己动手制作,可代做 本设计采用220V市电输入工频变压器,将220V交流电压降为24V交流电压,经过全桥整流加电容滤波,输出约32V直流电压.可调输出电压方案采用线性稳压调整器方案,即运放处于比较调整状态,运放输出驱动P型MOS管,电压输出端由电阻分压反馈至运放同相输入端,运放反相输入端由STM32单片机控制TLC5615数模转换器输入模拟电压,根据运放构成比较器原理,运放的同相端和反相端始终趋向于电压相等的特 阅读详情

相关推荐

一觉醒后ChatGPT 被淘汰了

近日,AI 界貌似出现了一种新的趋势:自主人工智能。这不是空穴来风,最近一个名为 AutoGPT 的研究开始走进大众视野。特斯拉前 AI 总监、刚刚回归 OpenAI 的 Andrej Karpathy 也为其大力宣传,并在推特赞扬:「AutoGPT 是 prompt 工程的下一个前沿。」

Rocky006的博客 13万+

Codeforces Round #262 (Div. 2) A,B,C

A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n pairs of socks. In the mornin

码代码的猿猿 1629

ad新版本学习笔记(基本包含一套流程)Altium Designer(ad20/ad21/ad22/ad23)

ad20-ad23学习笔记,逐渐补全

安和的博客 4万+

Codeforces Round #262 (Div. 2)-A,B,C,D

A. Vasya and Socks 水题就不用多说了,直接暴力枚举就完事了。 #include #include #include #include #include #include #include using namespace std; #define LL __int64 int main() { int n,k; while(~scanf("%d%d",&n,&

青竹梦 1220

T265摄像头插着开机后,需要重新插拔才能正常启动

T265摄像头插着开机后,需要重新插拔才能正常启动

qq_35598561的博客 1079

ABB机器人绝对精度实战:从焊接路径优化到TCP控制(附配置步骤)

本文深入探讨了ABB机器人绝对精度在焊接路径优化中的核心价值。通过对比重复定位精度,阐明绝对精度如何补偿机械误差,确保TCP在整个运动路径上的轨迹精度。文章提供了从示教器激活绝对精度功能的详细配置步骤,并分享了针对焊接抖动和实现0.2mm路径精度的进阶调优技巧,包括TCP标定、伺服参数优化与系统维护。

weixin_29053073的博客 351

Codeforces Round #262 (Div. 2) B. Little Dima and Equation

Little Dima misbehaved during a math lesson a lot and the nasty teacher Mr. Pickles gave him the following problem as a punishment. Find all integer solutions x (0 x 9) of the equation: x = b·s(x)

Grit_ICPC的博客 786

SAP Parallel Accounting(平行分类账业务)配置及操作手册【适用于多国家会计准则】

在SAP系统中,分类账(Ledger)是用于会计核算的核心概念,它允许企业根据不同的会计原则和货币进行财务记录。定义分类账是配置平行账(Parallel Accounting)的第一步。分类账的创建:通过事务代码OX18可以创建新的分类账。通常,一个SAP系统会有一个主分类账(如0L),它代表法定会计和实时传输至管理会计(CO)的账本。分类账属性:在创建分类账时,需要定义其属性,如会计年度变式、货币、会计原则等。这些属性将决定分类账的核算规则和适用性。

数字化2025 4618

Codeforces Round #262 (Div. 2) 460B. Little Dima and Equation(枚举)

Codeforces Round #262 (Div. 2) 460B. Little Dima and Equation(枚举)

1544

GitHub 国内加速完全指南(最新):镜像、代理与优化技巧

在国内使用 GitHub 时,经常遇到 clone 慢、打开仓库卡、GitHub Actions 不稳定 等问题。下面是整理好的 GitHub 国内镜像和加速方法大全,高效使用 GitHub。

moton2017的博客 1万+

全网详细解决:无法将 “xxx” 项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次

全网详细解决:无法将 “xxx” 项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。

念兮为美 5万+

Codeforces Round #262(div2) B. Little Dima and Equation

B. Little Dima and Equation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Dima misbehaved during a

ACway的专栏 1991

【CASS精品教程】032:CASS11台阶画法案例大全

一、普通无边台阶 二、普通有边台阶 三、普通圆弧无边台阶 四、U型台阶 五、曲线U型台阶 六、L型台阶

智慧空间实验室 7466

Codeforces Round #262 (Div. 2) (460A 460B 460C 460D)

460A Vasya and Socks 题意:n个物品每天用一个  m天得一个  问  最多连续用几天 思路: 没思路…  就是暴力… 代码: #include #include #include #include #include #include #include #include #include using namespace std; int main() {

House 1314

Devexpress16.2.6破解工具

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

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

Codeforces Round #262 (Div. 2) B. Little Dima and Equation

B. Little Dima and Equation time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Dima misbehaved during a math lesso

flyljg的专栏 455

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

Codeforces Round #262 (Div. 2)B. Little Dima and Equation

#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include

博客搬家啦 481

visio安装包

Microsoft Office Visio 是一款专业的制图软件。利用经过更新的形状、协作工具和数据链接图表,创建专业级图表以简化复杂的信息。

CF460B Little Dima and Equation (水题?

Codeforces Round #262 (Div. 2) B B - Little Dima and Equation B. Little Dima and Equation time limit per test 1 second memory limit per test 256 megabytes input standard...

weixin_33805557的博客 155

Codeforces Round #262 (Div. 2)解题报告

Codeforces Round #262 (Div. 2)解题报告

robotcator 985

Codeforces Round #262 (Div. 2)

Codeforces Round #262 (Div. 2) A:水题,直接不断模拟就可以 B:因为s(x)大小最大到1e9,所以数位和最多为81,这样仅仅要枚举s(x),就仅仅要枚举1到81就可以,然后在计算出x,推断是否符合,符合就加进答案 C:二分高度,然后推断的时候for一遍,每次不符合的位置就去浇水,从左往右推一遍就可以 D:构造。假设k &...

adr5970的博客 90

Codeforces Round #262 (Div. 2)总结

#include int main() { int n,m,x=0; scanf("%d%d",&n,&m); int num=n;x=n; while(num>=m) { x+=num/m; num=num/m+num%m; } printf("%d\n",x); return 0; }

野生的TFgirl 616

Codeforces Round #479 (Div. 3)(A-F)题解

Codeforces Round #479 (Div. 3)(A-F)题解 传送门 A. Wrong Subtraction 思路:签到题,根据题意模拟即可。 时间复杂度:O(k)O(k)O(k) #include<bits/stdc++.h> using namespace std; typedef long long ll; const int N=1e5+5,M=1e6+5,inf=0x3f3f3f3f,mod=1e9+7; #define mst(a) memset(a,0,sizeof

Harris-H的博客 718
上一篇: Codeforces Round #262 (Div. 2) A
下一篇: Codeforces Round #262 (Div. 2) C
Notdeep__acm
博客等级 码龄12年 20粉丝 53原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值