栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

2022杭电杯第二场个人题解

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

2022杭电杯第二场个人题解

C++ to Python

签到题

输出''('、')'、 ','及数字

Problem - 7151 (hdu.edu.cn)

#include 
using namespace std;
#define js ios::sync_with_stdio(false);cin.tie(0); cout.tie(0)
#define debug system("pause")
#define endl "n"

int main(){
    int T;cin>>T;
    string s,ans;
    while(T--){
        cin>>s;
        ans.clear();
        for(int i=0;i='0' and s[i]<='9'){
            ans+=s[i];
        }
        cout<

ShuanQ

数论题

输出P*Q-1的质因子,并要求其大于max(P,Q,E)

Problem - 7158 (hdu.edu.cn)

#include
using namespace std;
typedef long long ll;
int main(){
    int T;cin>>T;
    ll P,Q,E;
    while(T--){
        cin>>P>>Q>>E;
        ll maxx=max(P,Q);
        maxx=max(maxx,E);
        ll u = P*Q-1;
        for(ll i=2;i<=sqrt(u);i++){
            while(u%i==0) u/=i;
        }
            if(u>maxx) cout< 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1027209.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号