Gym - 101652 部分题解

[拆分质因数] 求1e6区间内的数的因数之和 GYM 101652C https://vj.e949.cn/f8d37a96d021442108f4492dfd021271?v=1541730304     #include <bits/stdc++.h> #define ll long long #define ull unsigned long long using namespace std; const int mn = 1e6... 阅读详情

题目链接1  题目链接2

又是一场和库里布莱恩特的菜鸡互啄,这次还是三星gym,还是两个人一起做,比上次还惨,才6个题。

这场的题感觉很简单,就是有点坑,第二题是多组输入但题里并没有说,骰子那题也是大水题,就是题意难懂,机器人那题也是题目简单,但题意难懂。分块除法,新知识点。BR那题,转化,然后求最大子段和,没想到。还有就是二分,二分真的太好用了。

Gym - 101652Z  Forbidden Zero

最简单的一道题,意外拿到了一血。while循环找下一个数,知道找到一个不各个位中不包含0的数,输出即可。

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define eps 1e-8
#define mod 1e9+7
#define N 100010
const double pi=acos(-1.0);
using namespace std;
char s[110];
bool ok(int x)
{
    stringstream a;
    a<<x;
    a>>s;
    rep(i,0,strlen(s))
        if(s[i]=='0')
            return false;
        return true;
}
int main()
{
    int n;
    cin>>n;
    while(n++)
    {
        if(ok(n))
            {cout<<n;return 0;}
    }
    return 0;
}

Gym - 101652N Odd Palindrome

这道题有点迷,感觉题里的描述和AC的代码不符合。直接判断字符串长度就行就AC了......可能是数据太水了吧,谁知道呢

#include <bits/stdc++.h>

#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;

#define LL long long
#define INF 0x3f3f3f3f
#define mes(a, val) memset(a, val, sizeof a)
#define mec(b, a) memcpy(b, a, sizeof a)

string s;

int main()
{
    cin>>s;
    int n = s.length();
    if(n & 1)cout<<"Odd."<<endl;
    else cout<<"Or not."<<endl;

    return 0;
}

Gym 101652O Latin Squares

这题本来本简单,就是有一个大bug,就是这道题是多组输入,但是题目中并没有说......

用set或者用数组模拟都行,如果不是Latin Squares的话就输出No,如果是“Latin Squares的话,再判断第一行和第一列是不是升序,如果都是升序的话输出Reduced,否则输出Not Reduced。

贴一下库里布莱恩特的代码(代码风格不忍直视......一条语句还加括号)

#include <bits/stdc++.h>

#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;

#define LL long long
#define INF 0x3f3f3f3f
#define mes(a, val) memset(a, val, sizeof a)
#define mec(b, a) memcpy(b, a, sizeof a)

const int maxn = 50;
int a[maxn][maxn];
int n;
int visr[maxn], visc[maxn];
set<int>s;
int main()
{
    char ch;
    while(scanf("%d",&n)!=EOF){

    for(int i = 1; i <= n; i ++){
        for(int j = 1; j <= n; j ++){
            cin>>ch;
            if(ch >= '0' && ch <= '9'){
                a[i][j] = ch-'0';
            }
            else if(ch >= 'A' && ch <= 'Z'){
                a[i][j] = ch-'A'+10;
            }
        }
    }

    int flag = 0;

    for(int i = 1; i <= n; i ++){
        s.clear();
        for(int j = 1; j <= n; j ++){
            s.insert(a[i][j]);
        }
        if(s.size() < n){
//            cout<<s.size()<<endl;
            flag = 1;break;
        }
    }


    for(int j = 1; j <= n; j ++){
        s.clear();
        for(int i = 1; i <= n; i ++){
            s.insert(a[i][j]);
        }
        if(s.size() < n){
//            cout<<s.size()<<endl;
            flag = 1;break;
        }

    }
    if(flag == 1){
        cout<<"No"<<endl;
    }
    else {
        flag = 0;
        for(int j = 1; j <= n; j ++){
            if(a[1][j] != j-1){
                flag = 1;break;
            }
        }
        for(int i = 1; i <= n; i ++){
            if(a[i][1] != i-1){
                flag = 1;break;
            }
        }
        if(flag == 1){
            cout<<"Not Reduced"<<endl;
        }
        else {
            cout<<"Reduced"<<endl;
        }
    }
    }
    return 0;
}

Gym - 101652Y  Delayed Work

要找人装修房子,先要给每个人都支付x工资(与工作时间无关),这项工作一个人做的话需要k天,m个人就需要k/m天,在这k/m天中每人每天要支付p工资。给出k,p,x,问完成这项工作最少需要多少钱。假设找m个人完成这项工作,则需要支付费用m*x+k/m*p,然后由均值不等值的m*x+k/m*p>=2*sqrt(m*x*(k/m*p)),当且仅当m满足m*x==k/m*p时等号成立。所以这个题就是先算m,m必须取整是(因为m是人数),然后为了保险起见,让m+1,m-1都是一遍,看哪个费用少,还有一点,就是k/m可以不是整数,也就是说天数可以不是整数(我也是看了样例才知道的)。

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define eps 1e-8
#define mod 1e9+7
#define N 100010
const double pi = acos(-1.0);
using namespace std;
int m1,m2,m3;
double mm;
int main() {
    int k, p, x;
    cin >> k >> p >> x;
    mm=sqrt((k*p)*1.0/(x*1.0));
    m1=max(int(mm),1);
    m2=max(m1+1,1);
    m3=max(m1-1,1);
    double ans=0;
    double d1=(k*1.0/(m1*1.0));
    double d2=(k*1.0/(m2*1.0));
    double d3=(k*1.0/(m3*1.0));
    ans=min(min(m1*x+d1*p,m2*x+d2*p),m3*x+d3*p);
    printf("%.3f",ans);
    return 0;
}

 Gym - 101652X  Star Arrangements

给出n表示星号的数目,然后让你写出所有的排列方案。每个排列方案必须满足三个条件:1、每隔一排都有相同数量的星星。2、相邻的排之间的星星数目之差不能超过1。3、第一排不能比第二排少。所以while循环一下一个一个试就行了。

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define eps 1e-8
#define mod 1e9+7
#define N 100010
const double pi = acos(-1.0);
using namespace std;

int main()
{
    int s;
    int a,b;
    cin>>s;
    cout<<s<<":"<<endl;
    a=2;
    while(a<=s/2+1)
    {
        b=a-1;
        if(s%(a+b)==0||s%(a+b)==a)
            cout<<a<<","<<b<<endl;
        b=a;
        if(s%(a+b)==0||s%(a+b)==a)
            cout<<a<<","<<b<<endl;
        a++;
    }
    return 0;
}

Gym - 101652U Unloaded Die

哇,实际上这也是个大水题,题读懂了真的超简单。

给出6个数,表示骰子的6个面分别表示每个面朝上的概率,然后你可以改变一个面的值(可以是不是整数,甚至可以是负数),使得抛这个骰子,骰子的值的期望值是3.5,问改变之后的值和变之前的值的差的绝对值最小数多少。所以for循环一个一个试一下就行了......

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define eps 1e-8
#define mod 1e9+7
#define N 100010
const double pi = acos(-1.0);
using namespace std;
double a[7];
int main()
{
    rep(i,1,6)
        cin>>a[i];
    double sum=0;
    rep(i,1,6)
        sum+=(i*a[i]);
    double ans=inf;
    if(sum==3.5)
        {cout<<"0.000";return 0;}
        rep(i,1,6)
            ans=min(ans,abs(3.5-sum)/a[i]);
    printf("%.3f",ans);
    return 0;
}

Gym - 101652Q  Halfway

二分,还是二分。题意我懒得说了......

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define eps 1e-8
#define mod 1e9+7
#define N 100010
const double pi=acos(-1.0);
using namespace std;

int main()
{
    ll n;
    cin>>n;
    ll l=1,r=n;
    ll k=((n-1)*n/2+1)/2;
    while(l<=r)
    {
        ll mid=(l+r)/2;
        ll cnt=0;
        cnt=(2*n-1-mid)*mid/2;
        if(cnt-(n-mid)<k&&cnt>=k)
            {cout<<mid;return 0;}
        if(cnt<k)
            l=mid+1;
        else
            r=mid-1;
    }
    return 0;
}

 Gym 101652R  Straight Shot

哎,题意难懂,读懂了挺简单的,简直就是高一物理题,但还是有一个地方没想起来,vy不会求,哎。

看这个:https://blog.csdn.net/Healer66/article/details/82423757 一看就懂。

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define eps 1e-8
#define mod 1e9+7
#define N 100010
const double pi = acos(-1.0);
using namespace std;
double l[110],r[110],v[110];
int main()
{
    int n;
    double X,V;
    cin>>n>>X>>V;
    rep(i,1,n)
        cin>>l[i]>>r[i]>>v[i];
    double vy=0;
    rep(i,1,n)
        vy+=(r[i]-l[i])*v[i];
    vy/=X;
    if(abs(vy)>=abs(V))
        cout<<"Too hard";
    else
    {
        double t=X/(sqrt(V*V-vy*vy));
        if(t>=2*X/V)
            cout<<"Too hard";
        else
            printf("%.3f",t);
    }
    return 0;
}

 Gym 101652S Purple Rain

转化一下,求最大字段和,哎,我当时想到转化了,但我以为求最大字段和要n方复杂度,所以就没搞,哎,太菜了。

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define eps 1e-8
#define mod 1e9+7
#define N 100010
const double pi=acos(-1.0);
using namespace std;
char ss[100010];
char s[100010];
int a[100010];
int st1,ed1,st2,ed2;
int main()
{
    scanf("%s",ss);
    int n=strlen(ss);
    rep(i,0,n-1)
        s[i+1]=ss[i];
    rep(i,1,n)
    {
        if(s[i]=='B')
            a[i]=1;
        else
            a[i]=-1;
    }

    int tmp1=1,sum1=0;
    int max1=-inf;
    rep(i,1,n)
    {
        sum1+=a[i];
        if(sum1>max1)
        {
            max1=sum1;
            st1=tmp1;
            ed1=i;
        }
        if(sum1<0)
        {
            tmp1=i+1;
            sum1=0;
        }
    }
    rep(i,1,n)
    {
        if(s[i]=='B')
            a[i]=-1;
        else
            a[i]=1;
    }
    int tmp2=1,sum2=0;
    int max2=-inf;
    rep(i,1,n)
    {
        sum2+=a[i];
        if(sum2>max2)
        {
            max2=sum2;
            st2=tmp2;
            ed2=i;
        }
        if(sum2<0)
        {
            tmp2=i+1;
            sum2=0;
        }
    }
    if(max1>max2)
        {cout<<st1<<" "<<ed1<<endl;return 0;}
    if(max2>max1)
        {cout<<st2<<" "<<ed2<<endl;return 0;}
    if(st1<st2)
        {cout<<st1<<" "<<ed1<<endl;return 0;}
    if(st2<st1)
        {cout<<st2<<" "<<ed2<<endl;return 0;}
    if(ed1<ed2)
        {cout<<st1<<" "<<ed1<<endl;return 0;}
    cout<<st2<<" "<<ed2<<endl;
    return 0;
}

Gym 101652P Fear Factoring

题意好懂,不说了。这个用到了分块除法,长知识了。

有篇博客写的不错,可以看一下。https://blog.csdn.net/qq_39599067/article/details/81807580

不过这题有个坑点,就是结果要用unsigned long long来存,因为最终结果可能爆long long。

#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<map>
#include<set>
#include<sstream>
#include<cstdlib>
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define repp(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define mem(a,x) memset((a),(x),sizeof ((a)))//x只能是0或-1或false或true
#define debug(x) cout<<"X: "<<(x)<<endl
#define de cout<<"************"<<endl
#define lowbit(x) ((x)&(-x))
#define lson rt<<1
#define rson rt<<1|1
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b/(__gcd(a,b))
#define inf 0x3f3f3f3f//1e9+6e7
#define eps 1e-8
#define mod 1e9+7
#define N 100010
const double pi = acos(-1.0);
using namespace std;
ull getsum(ll n)
{
    ull ret=0;
    ull l=1,r=1;
    for(l=1;r<=n&&l<=n;l=r+1)
    {
        r=n/(n/l);
        ret+=(n/l)*(r+l)*(r-l+1)/2;
    }
    return ret;
}
int main()
{
    ll a,b;
    cin>>a>>b;
    cout<<getsum(b)-getsum(a-1);
    return 0;
}

太菜了,还是得多刷题啊!

华为交换机与思科/华三设备LACP对接实战:手把手教你配置链路聚合 本文详细解析了华为交换机与思科、华三设备间的LACP链路聚合配置实战,涵盖核心原理、配置步骤及排错技巧。通过对比不同厂商的实现差异,提供可落地的跨厂商对接方案,助力企业网络工程师高效部署高可靠性链路聚合。 阅读详情

相关推荐

如何实现MCGS与S7-200SMART PLC以太网多台通信控制?

第九步:(设备工具箱—设备管理—鼠标依次点击通用TCP/IP父设备—西门子_ Smart200到设备窗口里面去)数据类型:第0位(指PLC地址变量小数点后面的位数,例如我地址是M0.0,那么在数据类型应填写通道的第00位)第十步:(鼠标双击打开通用TCPIP父设备0--[通用TCP/IP父设备]进入通信配置)通道地址:0(指小数点前面起始字节的地址,例如我地址是M0.0,那么应在通道地填写0)。第七步:(选择通用TCP/IP父设备,点击新增,右侧选定设备就会自动添加进去。

u010670857的博客 6730

(赛后补题)B - Latin Squares Gym - 101652O

我真的服了,明明要多组输入,为什么不说!为什么不说!为什么不说!啊啊啊啊啊!我做了两个小时啊,我真服了这煞笔题,带着怨恨往下写,气死我了气死我了 题意:多组输入(虽然题目里面丝毫没提起,怎么,真是做阅读理解呢?此处省略一万个消音词)......

weixin_62848089的博客 275

采用MPU6050的手势遥控器

随着社会的发展与进步,电子产品日益更新,个人家庭迎来了越来越多的智能家电。然而,现在的智能电子设备产品的遥控器多数都是按键形的。操作繁琐不直观,学习成本大。并且对于有老人小孩的家庭,给他们的操作带来了巨大的障碍。手势遥控器是指利用简单的手势来指挥电子设备,获得便捷的操作体验。让家庭成员都可以享受科技发展带来的福利。MPU6050是一个运动传感器,内置陀螺仪,再由电子设备利用判断结果做出相应的响应即...

Sakura的博客小站 6606

gym:Problem A Artwork(并查集思维题)

20162017-acmicpc-nordic-collegiate-programming-contest-ncpc-2016 Problem A Artwork 题目链接http://codeforces.com/gym/101550/attachments 题意:一个n×m的矩阵,每次在里面添加一条线段(横或竖),问每次添加之后把矩阵分成了几块。 解题思路:刚开始拿这个题没啥思路,...

二营长的意大利炮友 478

SIMPLIS实战:从零构建理想BUCK电路,精准计算与POP稳态分析

本文详细介绍了如何使用SIMPLIS软件从零开始构建并仿真一个理想的BUCK降压电路。通过设定关键参数、计算理想器件值,并搭建仿真模型,文章重点演示了暂态仿真以观察电路上电过程,并深入讲解了高效的POP(周期性工作点)稳态分析技术,帮助工程师快速验证设计、评估稳态性能,从而加速电源设计迭代。

weixin_29165465的博客 401

NoC架构深度解析:从拓扑结构到流量控制的全面指南

本文深入解析了片上网络(NoC)架构,从总线架构的瓶颈出发,阐述了NoC作为芯片内部“交通网”的核心优势。文章详细探讨了主流拓扑结构(如Mesh、Torus、Ring)的选型权衡,并系统介绍了数据包格式、路由算法、路由器流水线、流量控制机制以及网络接口(NI)设计,为理解现代多核SoC的通信基石提供了全面指南。

gg901的博客 1044

强化学习之Gym基础入门(1)

目录 简介 Gym安装方法(anaconda安装法) 程序代码-函数 简介 训练参数的基本平台openai的Gym,与tensorflow无缝连接,仅支持python,本质是一组微分方程,简单的模型手动推导,复杂的模型需要用一些强大的物理引擎,如ODE, Bullet, Havok, Physx等,Gym在搭建机器人仿真环境用的是mujoco,ROS里面的物理引擎是gazebo。 ...

会飞的小鸡的博客 5万+

《YOLOv8-seg改进》专栏指导书册 &手把手创新教程

学姐带你学习YOLOv8,从入门到创新,轻轻松松搞定科研;1)手把手教你如何训练YOLOv8-seg;2)模型创新,提升分割性能;3)独家自研模块助力分割;

会AI的学姐 3815

Gym - 101669部分题题解

A - Concerts(动规) 题意是给你一个子串b和一个主串a,问在满足条件下a串可以有多少种b的规划方式。 #include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 1e5 + 100; const int mod = 1e9 + 7; ll f[2][N]; int k, n; int num[30]; char a[10010], b[N]; int ma

qq_47783181的博客 452

Java 类与对象 -- Java 语言的类与对象、构造器、static、final、包和 JAR

本篇文章我们将深入了解 Java 语言中的类与对象,探讨构造器、`static`、`final`、包和 JAR 文件。这些概念是面向对象编程的核心,对于理解和掌握 Java 至关重要。

栗筝i的博客 5044

PyTorch强化学习实战(3)——Gymnasium API扩展功能

我们已经学习了编写智能体必需的 Gymnasium 核心功能,其余 API 功能部分虽然非必需,但能显著提升开发效率和代码整洁度。在本节中,我们简要地介绍了 Gymnasium API 的扩展功能,学习了如何以模块化的方式扩展现有环境的功能,并熟悉了使用包装器可视化智能体活动的方法。

盼小辉丶的博客 1247

gym入门

gym入门 gym简介 gym是一个用于开发和比较强化学习算法的工具箱。它对代理(agent)的结构没有任何假设,并且与任何数值计算库(如TensorFlow或Theano)兼容。 gym库是一个测试问题的集合,即环境。你可以用它来制定你的强化学习算法。这些环境有一个共享的接口,允许您编写通用的算法。 gym安装 在cmd中输入: pip install gym 环境 下面是一个让某些东西运行的最小示例。这将为1000个时间步运行一个 CartPole-v0 环境的实例,并在每个步骤中呈现环境。你应该会看

weixin_49897963的博客 4775

【第2章>第10节】深度学习DenseNet模型分析与matlab仿真

本文介绍了基于DenseNet深度学习模型的图像分类MATLAB实现方法。主要内容包括:1. DenseNet模型原理,详细解析了初始卷积层、密集块、过渡层等核心结构;2. 在MATLAB环境下完成DenseNet工具箱安装和测试样本准备;3. 实现图像预处理(统一缩放为224×224)、模型训练和测试的完整流程;4. 提供了混淆矩阵和准确率等测试结果分析。文章附带完整的MATLAB程序代码和操作视频教程,适合深度学习初学者快速掌握DenseNet模型的图像分类应用。通过实际测试,验证了该方案的有效性。

FPGA/MATLAB学习教程/源码/项目合作开发 333

Gym 101652P Fear Factoring

Gym 101652P Fear Factoring 传送门Gym 101652P [toc] 题意 求a到b区间所有数的因数和 题解 很直接的就想到可以枚举因数,然后因数在a到b区间的个数。但是这道题a和b有1e12,所以就不知道怎么做了 然后就在找到了一个公式,可以通过唯一质数分解,求每个数的合数的和。就这么搞了一发,t了。 然后就卡住了。。。 最后是队里大佬告诉我的思路,让...

fnoi11awyfeng的博客 535

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

Gym - 101652W

蓝色左上只能是蓝色,红色右下只能是红色。 其实只要考虑一种就可以了,因为考虑了一种颜色 ,另一种就会和他叠起来。‘ #include<cstring> #include<cstdio> using namespace std; typedef long long ll; char s[40][40]; ll dp[40][40]; int a[40][40]; int n...

天道酬勤 283

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

Gym - 101652

回文子串长度为奇数。

m0_73673533的博客 241

大中型超市收银系统(可直接运行)

光步前台收银系统系统功能:商品销售、商品退货、挂单、收银员权限、会员销售、单品取消、整单取消、商品查询、脱机销售、脱机数据上传,基本资料下载,开钱箱、小票打印、收款结算,支持多币种付款方式(现金、储值卡、礼券、微信等),支持多种促销。运行环境:.net 4.0登陆信息用户名:1001 密码:123456内置商品信息,商品编码可输入00001000 - 00010000,测试效果相关功能键F5 结算 F9挂单 F11商品查询 F8退货 Insert单品取消 Del整单取消 F12开钱箱F2 会员 Ctrl+Z退出系统 Home 锁屏 相关源码待公开

Gym 101652T Security Badge (dfs)

原题地址:http://codeforces.com/gym/101652/attachments 题意:有nnn个点,mmm条边,还有一个总上界kkk,你需要从sss点走到t点,对于每条边u,v,l,ru,v,l,ru,v,l ,r,你手中持有的权值需要在[l,r][l,r][l, r]的范围内才能从uuu走到vvv,问有多少种不同的权值可以成功地从sss点走到ttt。 思路:一开始想的是从...

yiqzq的博客 663

Gym 101652T Security Badge(DFS)

题意:有n个点,m条边,还有一个总上界k,你需要从s点走到t点,对于每条边u,v,l,r,你手中持有的权值需要在[l,r]的范围内才能从u走到v,问有多少种不同的权值可以成功地从s点走到t。 思路:一开始直接从[1,k]开始搜,到每个可行的区间就存下来,最后对合法区间求和,但是不行,可能回溯太耗时间? 将每一扇们门的上下界都存储起来,我们可以知道,最终合法的若干区间的端点值一定来自于这些点,那...

Endeavor_G的博客 324

B Gym 101652P Fear Factoring

B    Gym 101652P    Fear Factoring 这题求 b , a之间 所有数包括他的因子和。 看一眼肯定知道是筛选所有的因子。 a,b不超过 1e6。a , b ,不超过 1e12,1e6*1e6刚好1e12 所以我们枚举  1-1e6所有的数 ,然后求分别以这个为因子会出现的次数。 然后用 ,a 出现的因子和 -b 里面出现的因子和。 加入我们要求 x=10 ...

尘的博客 375

Gym - 101652S E - Purple Rain (贪心)

原题地址:http://codeforces.com/gym/101652/attachments 题意:给出一串只包含'B','R'的字符串,让你找出一段区间使得在这段区间里面'R'和'B'的数量之差最大. 思路;分两种情况考虑,一种是确定R比B多的情况下的最大差值.一种是B比R多的情况下的最大差值.然后取一个最值.至于判断,我们可以进行O(n)的扫一遍,确定最大差值以及区间范围. 具体看...

yiqzq的博客 878

K - Purple Rain Gym - 101652S(最大子段和)

K - Purple Rain Gym - 101652S Problem S — limit 1 second Purple Rain Purple rain falls in the magic kingdom of Linearland which is a straight, thin peninsula. On close observation however, Professor N...

tomjobs的博客 532

D - Halfway Gym - 101652Q

A friend of yours has written a program that compares every pair of a list of items. With n items, it works as follows. First, it prints a 1, and it compares item 1 to items 2, 3, 4, . . . , n. It then prints a 2, and compares item 2 to items 3, 4, 5, . .

qq_54783066的博客 248

Gym - 101652P B - Fear Factoring (数学题)

原题地址:http://codeforces.com/gym/101652/attachments 可以参考这篇除法分块博客https://www.cnblogs.com/Tony-Double-Sky/p/9490077.html 下面是我的代码以及一些注释 #include &lt;bits/stdc++.h&gt; #include &lt;cmath&gt; #include &l...

yiqzq的博客 722

【CodeForces】【二分】GYM 101652 Q Halfway

【题目】    【题意】n个数相互比较,1和2,1和3……1和n,2和3,2和4……,共比较xxx次,问第xxx/2次比较是“?”和xx的比较?               输出“?” 【代码】 #include&lt;bits/stdc++.h&gt; using namespace std; typedef long long ll; int main() { ll ...

swqeaaa的博客 384

Gym - 101652T Security Badge

Security Badge 题 意:有n个房间,m个门,k个员工,每个门有一个密码[ci,di]只有编号在这个范围类的员工才能通过这个门,k个员工每个员工都有一个唯一的编号。每个门由房间ai开向房间bi,密码为[ci,di]。题目保证不会有重边。输入s,t问有多少员工可以通过s,t。 数据范围: 1&lt;=n&lt;=1000 1&lt;=m&lt;=5000 1&lt;=k&lt...

子灬丶逾 625

Gym - 101652W Grid Coloring

Grid Coloring 题 意:有一个n*m的格子填颜色,蓝色格子的左上角只能填蓝色,红色格子的右下角只能填红色。现在输入样例已经输入了一些格子的颜色,问你有多少种填色方案。 数据范围: 1&lt;=n,m&lt;=30 输入样例: 3 2 .. B. .R 输出样例: 6 思 路:这题的数据范围有点大,肯定不是状压dp,状压dp一般适用于n的范围小于16。因为这是第一次接...

子灬丶逾 554
上一篇: Trie树 字典树
下一篇: Gym 101911A Coffee Break Gym - 101911C  Bacteria
flyzer
博客等级 码龄9年 27粉丝 146原创
评论 5
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值