九度OJ 1442 A sequence of numbers

雷赛控制卡全方位使用指南:从硬件连接到高级应用 雷赛控制卡以其接口简单、编程便捷、性价比高的特点,成为中小自动化设备的理想选择。使用时需注意:硬件连接需注重抗干扰设计(屏蔽线、接地);软件开发需合理配置运动参数(脉冲当量、加减速);调试阶段需充分利用 DMCStudio 工具验证性能。通过本文介绍的方法,可快速实现从硬件搭建到复杂运动控制的全流程开发,满足雕刻、切割、装配等多场景的自动化需求。 阅读详情

题目地址:http://ac.jobdu.com/problem.php?pid=1442

题目描述:

Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of each sequence are recognizable. Xinlv wants to know some numbers in these sequences, and he needs your help.

输入:

The first line contains an integer N, indicting that there are N sequences. Each of the following N lines contain four integers. The first three indicating the first three numbers of the sequence, and the last one is K, indicating that we want to know the K-th numbers of the sequence.

You can assume 0 < K <= 10^9, and the other three numbers are in the range [0, 2^63). All the numbers of the sequences are integers. And the sequences are non-decreasing.

输出:

Output one line for each test case, that is, the K-th number module (%) 200907.

样例输入:
2
1 2 3 5
1 2 4 5
样例输出:
5
16
#include <stdio.h>
 
#define M 200907
 
long long fun1(long long data[], int k){
    long long p = data[1] - data[0];
    return ((data[0] % M) + (((k-1) % M) * (p % M)) % M) % M;
}
 
long long fun2(long long data[], int k){
    long long p = data[1] / data[0];
    long long ans = data[0];
    --k;
    while (k != 0){
        if (k % 2 == 1){
            ans = (ans * p) % M;
        }
        k /= 2;
        p = (p * p) % M;
    }
    return ans;
}
 
long long KthNumber(long long data[], int k){
    int flag;
 
    if ((data[1] - data[0]) == (data[2] - data[1]))
        flag = 0;
    else
        flag = 1;
    if (flag == 0){
        return fun1(data, k);
    }
    else{
        return fun2(data, k);
    }
}
 
int main(void){
    int n;
    long long data[3];
    int k;
    int i;
 
    while (scanf ("%d", &n) != EOF){
        while (n-- != 0){
            for (i=0; i<3; ++i){
                scanf ("%lld", &data[i]);
            }
            scanf ("%d", &k);
            printf ("%d\n", KthNumber (data, k));
        }
    }
 
    return 0;
}


「免费开源」从 OCR 识别到结构化输出:合同文本高效比对的完整解决方案! 本文将系统拆解这一解决方案的技术逻辑、实施步骤与落地价值,为企业合同管理数字化转型提供实操指南。字段提取:自动识别并提取预设的关键字段(如 “甲方”“乙方”“合同金额”“履约期限” 等),若遇到模糊表述(如 “付款时间为合同签订后 30 个工作日内”),系统可自动解析为 “履约期限:合同签订日 + 30 工作日”;预设结构化字段:根据合同类型(如采购合同、服务合同、租赁合同),定义需提取的关键字段(如 “甲方名称”“乙方名称”“合同金额”“有效期起 / 止日期”“履约地点”“违约金比例” 等); 阅读详情

相关推荐

用树莓派Pico低成本更新USB-C PD控制器固件实战指南

固件更新是嵌入式系统开发与维护中的核心环节,它直接决定了硬件设备的功能、性能与兼容性。其原理通常是通过特定的通信接口(如SWD、JTAG、UART或USB)与设备内部的Bootloader建立连接,将新的程序代码安全写入非易失性存储器。在USB Power Delivery(PD)和Type-C生态中,固件更新技术尤为重要,它能修复协议握手Bug、适配新设备并提升供电策略的灵活性。本文聚焦于一个典型的工程实践场景:如何利用广泛普及且成本极低的树莓派Pico开发板,作为USB-C协议到I²C协议的转换桥,实现

weixin_27869497的博客 458

A sequence of numbers (入门题-数学)

A sequence of numbers                                                                                   Time Limit: 1 Seconds    Memory Limit: 32 Mbyte 题目描述:       Xinlv wrote some sequences on t

2570

YOLOv8环境搭建+训练自己的数据详细项目

直接按照路径会有问题,找到自己 requirements.txt 文件路径,我这里是pip install -r D:\ultralytics-main\ultralytics-main\requirements.txt。首先去自己的anaconda的安装的envs(虚拟环境),在导航栏输入cmd,进入命令窗口。到官方网站下载yolo模型 ,下载好后解压,里面有个文件requirements.txt。然后安装ultralytics ,这是必须的。

m0_63172128的博客 2万+

hdu-2817 A sequence of numbers解题报告(快速幂)

目录题目描述思路分析完整代码 题目描述 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2817 大概意思:给你一组(三个)数,找出第k个数是多少,结果mod 200907 思路分析 这道题因为0 < K <= 10^9,比较大,直接算可能会超时,所以采用快速幂。主要就是记住模板。下面来说说理解: 我们都知道a^2=aa,而 (a ^2)(a...

nagisa2019的博客 554

Agisoft Metashape相机标定笔记

使用Metashape进行自动相机标定是可能的。(可选:使用打印的棋盘格图案,但需保证它是平坦的且单元格是正方形)。相机标定步骤支持全相机标定矩阵的估计,包含非线性的畸变参数。相机模型的细节请参照附录D——相机模型板块。:在通用的工作流程中,相机标定步骤可以跳过。因为Metashape会在图像定向过程中进行相机自标定。但是,如果定向结果不稳定,例如,由于影像之间缺乏连接点,额外进行单独的相机标定步骤也许是有用的。

天桥飞熊的博客 3974

基于YOLOv8的智能肿瘤检测系统:从图像到诊断的深度学习应用——含代码和论文

本文提出了一种基于YOLOv8深度学习的智能肿瘤检测系统,用于医学影像(CT/MRI/X光)的自动分析与诊断。针对传统人工阅片效率低、主观性强的问题,系统采用最新的YOLOv8目标检测算法,通过改进的C2F骨干网络、Anchor-Free检测头和解耦头等创新设计,实现高效精准的肿瘤定位。文章详细阐述了模型架构、数据处理流程、训练优化方法及PyQt5用户界面开发,为临床提供可靠的AI辅助诊断工具。实验结果表明,该系统在速度和准确率上达到良好平衡,有望提升肿瘤早期筛查效率。

FJN110的博客 199

快速幂之A sequence of numbers

HDU 2817 Problem Description Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of each sequence are recognizable. Xinlv wants to kn

kitalekita的博客 277

库存优化技术提升电商效率

第一部分:库存优化技术基础 第1章:库存优化的基本概念 库存优化是现代电商运营中至关重要的一个环节。简单来说,库存优化指的是通过一系列的策略和技术手段,使得库存管理更加高效、准确,从而降低运营成本,提高销售额。 1.1 库存优化的定义与重要性

AI天才研究院 1248

A sequence of numbers(快速幂)

Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of each sequence are recognizable. Xinlv wants to know some numbers in these sequ

cuijunrongaa的博客 290

PyTorch深度学习实战(6)——神经网络性能优化技术

神经网络性能优化技术是指通过改进神经网络的结构、参数初始化、正则化和训练过程等方面来提高其性能和泛化能力的方法。优化技术的选择和调试需要根据具体问题进行,通过不断实验和调整,找到最适合网络的优化策略。本节首先训练了一个简单的全连接网络,然后在此基础上介绍了简单有效的神经网络性能提升技巧。

盼小辉丶的博客 1万+

Modbus RTU/TCP协议栈手写实现:主从站设计、功能码、CRC、异常响应

本文从协议栈架构、帧结构、功能码、CRC校验、异常响应、主从站设计等多个维度,完整阐述了Modbus RTU/TCP协议栈的手写实现方案。帧间隔机制是RTU的核心,T3.5超时检测决定了帧边界识别CRC16查表法以512字节ROM换取8倍性能提升,适合嵌入式功能码路由表实现可扩展的代码架构,便于新增功能异常响应机制保障协议健壮性,每个错误都有明确反馈Modbus TCP在RTU基础上增加MBAP头,实现以太网扩展多核RTOS环境下的并发访问与线程安全RS-485总线的电气隔离与浪涌保护。

从事移动开发八年,csdn博客专家,阿里云特邀专家,华为云云享专家,高级网络信息安全工程师,大数据工程师(高级),python技术开发(高级),HarmonyOS 应用开发者高级认证,现在某学校任教。 1万+

题目1442:A sequence of numbers 九度OJ

题目1442:A sequence of numbers 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:4160 解决:1059 题目描述: Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometri

寻找如意的博客 408

【LOGO动态替换】记录一次关于LOGO动态替换引发的uboot代码分析及其实现

文章目录1.前言2.实现2.1 新增logo分区2.2 制作logo分区镜像2.2.1 查看logo.bmp和logo_kernel.bmp的文件大小。2.2.2 按规则将bmp写入logo.img3.分析3.1 uboot的启动分析3.2 uboot bmp load 显示部分3.2.1 rockchip_show_logo3.2.2 load_bmp_logo3.2.3 load_bmp_logo3.3 uboot bmp read部分3.3.1 read_logo_bmps3.3.1 read_bmp

wang 恒 的博客 1213

九度OJ-1442:A sequence of numbers

一道大数据处理的题目。因为数据过大故要注意两点:取模+二分求幂。   二分求幂就不细说了。取模用到了如下两个公式:   ①(a*b)%c=((a%c)*(b%c))%c   ②(a+b)%c=((a%c)+(b%c))%c 题目描述: Xinlv wrote some sequences on the paper a long time ago, they might

听风就是雨 848

visio安装包

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

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

九度OJ题目1442:A sequence of numbers

题目1442:A sequence of numbers             时间限制:1 秒 内存限制:128 兆 特殊判题:否 题目描述:                        Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geo

zpy2073的博客 367

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

【九度OJ】题目1442:A sequence of numbers 解题报告

【九度OJ】题目1442:A sequence of numbers 解题报告标签(空格分隔): 九度OJ原题地址:http://ac.jobdu.com/problem.php?pid=1442题目描述:Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric seq

负雪明烛 1800

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

九度OJ1442:A sequence of numbers 解题报告

题目描述:Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of each sequence are...

hongmeipopo73的博客 286

九度 题目1442:A sequence of numbers

九度 题目1442:A sequence of numbers

coding_sun的博客 277

HDU 2817(等差和等比数列问题)

A sequence of numbers<br />Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)<br />Total Submission(s): 529    Accepted Submission(s): 162<br /><br />Problem DescriptionXinlv wrote some sequences on the paper a long time ag

-- bird -- 1867

题目1442:A sequence of numbers

题目描述: Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of each sequence

u011325614的专栏 1078

A sequence of numbers

题目1442:A sequence of numbers 时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:2298 解决:541 题目描述: Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric

walker lee 725

HDOJ A sequence of numbers

A sequence of numbers Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 4   Accepted

欢迎 1210

【九度】题目1442:A sequence of numbers

时间限制:1 秒 内存限制:128 兆 特殊判题:否 提交:3104 解决:782 题目描述: Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very

菜鸟han要逆袭 ᕙ(⇀‸↼‵‵)ᕗ 578

HDU2817:A sequence of numbers(快速幂取模)

Problem Description Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric sequences. The numbers are not very clear now, and only the first three numbers of e

ACM!荣耀之路! 2439

九度 1441 1442 1443二分求幂法

【九度OJ】题目1441:人见人爱 A ^ B 解题报告 标签(空格分隔): 九度OJ 原题地址:http://ac.jobdu.com/problem.php?pid=1441 题目描述: 求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方” 输入: 输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1 输出: 对

Cattells的博客 542
上一篇: 九度OJ 1104 整除问题
下一篇: 九度OJ1198 a+b 【高精度整数】
JDPlus
博客等级 码龄15年 221粉丝 125原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值