icp光谱分析仪_个人icp备案

icp光谱分析仪_个人icp备案输入44 21 2 4 84 0100 99 98 972 210000 100005 30 0 0 0 1696RichmanImpossible代码#include<bits/stdc++.h>using namespace std;typedef long long ll;const int N = 1e5 + 10;int a[N];int main(){ int T; cin>>T; while(T -..

大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。

Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺

在这里插入图片描述

在这里插入图片描述

输入

4
4 2
1 2 4 8
4 0
100 99 98 97
2 2
10000 10000
5 3
0 0 0 0 1
6
96
Richman
Impossible

代码

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e5 + 10;
int a[N];
int main(){ 
   
    int T;
    cin>>T;
    while(T --){ 
   
        int n,m;
        cin>>n>>m;
        for(int i = 0;i < n;i ++)cin>>a[i];
        
        int zerocount = 0;
        for(int i = 0;i < n;i ++)
               if(!a[i])zerocount ++;
        if(zerocount > m || m > n)cout<< "Impossible"<<endl;
        else{ 
   
            if(m == n)cout<< "Richman"<<endl;
            else{ 
   
                m = m - zerocount;
                ll res = 0,num = 0;
                int i;
                for(i = 0;i < n && num < m;i ++){ 
   
                    if(a[i]){ 
   
                        res += a[i];
                        num ++;
                    }
                }
                int mi = 0x3f3f3f3f;
                for(int k = i;k < n;k ++){ 
   
                    if(a[k])mi = min(a[k],mi);
                }
                    
                if(mi != 0x3f3f3f3f)cout<< (res + mi - 1)<<endl;
                
                else cout<<"Richman"<<endl;
            }
        }
        
    }
    return 0;
}
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/168829.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • yarn的安装和使用

    yarn的简介:Yarn是facebook发布的一款取代npm的包管理工具。yarn的特点:速度超快。Yarn缓存了每个下载过的包,所以再次使用时无需重复下载。同时利用并行下载以最大化资源利用率,因此安装速度更快。超级安全。在执行代码之前,Yarn会通过算法校验每个安装包的完整性。超级可靠。使用详细、简洁的锁文件格式和明确的安装算法,Yarn能够保证在不同…

    2022年4月3日
    73
  • 直接加QQ好友的链接或会话的方法

    出自本博客:qq_2300688967原文链接:https://blog.csdn.net/qq_2300688967/article/details/52162230下面是两种方法,一种直接会话,一种添加好友,只需将本人的QQ改成自己的就行了(1)下面这个代码,可直接临时会话tencent://message/?Menu=yes&amp;uin=2300688967&amp;…

    2022年4月9日
    129
  • 魔方第五步式视频教程_fpga滤波算法

    魔方第五步式视频教程_fpga滤波算法完整版教程下载地址:事隔五年之后,开启第2版DSP数字信号处理和CMSIS-NN神经网络教程,同步开启三代示波器,更至49章(2021-09-20)-STM32H7-硬汉嵌入式论坛-PoweredbyDiscuz!http://www.armbbs.cn/forum.php?mod=viewthread&tid=94547第49章STM32F429的自适应滤波器实现,无需Matlab生成系数(支持实时滤波)本章节讲解LMS最小均方自适应滤波器实现,无需Matla…

    2025年9月4日
    5
  • python进阶(15)多线程与多进程效率测试「建议收藏」

    python进阶(15)多线程与多进程效率测试「建议收藏」前言在Python中,计算密集型任务适用于多进程,IO密集型任务适用于多线程正常来讲,多线程要比多进程效率更高,因为进程间的切换需要的资源和开销更大,而线程相对更小,但是我们使用的Python大多

    2022年8月7日
    4
  • 物理地址介绍「建议收藏」

    物理地址介绍在存储器里以字节为单位存储信息,为正确地存放或取得信息,每一个字节单元给以一个唯一的存储器地址,称为物理地址(PhysicalAddress),又叫实际地址或绝对地址。计算(此类计算可直接使用计算机进行计算,总结来说就是进制之间的转换):地址(字节编址)10242^10b1KB100000000001K…

    2022年4月4日
    209
  • 莫比乌斯反演的两种形式及其证明

    莫比乌斯反演的两种形式及其证明莫比乌斯反演形式一 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 证明 把代入右边的式子 得 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 根据莫比乌斯函数的性质 有定理 nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp nbsp 因此 只有

    2025年6月28日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号