当前位置: 首页 > news >正文

(蓝桥杯)1125 第 4 场算法双周赛题解+AC代码(c++/java)

题目一:验题人的生日【算法赛】

验题人的生日【算法赛】 - 蓝桥云课 (lanqiao.cn)

思路:

1.又是偶数,又是质数,那么只有2喽

AC_Code:C++

#include <iostream>
using namespace std;
int main()
{cout<<2;return 0;
}

AC_Code:java

import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner scan = new Scanner(System.in);System.out.println(2);scan.close();}
}

题目二:蓝桥小课堂【算法赛】

蓝桥小课堂【算法赛】 - 蓝桥云课 (lanqiao.cn)

思路:

1.组成三角形的条件,任意两边大于第三边

2.注意不要用sqrt函数,因为输出的是面积的平方,最后直接输出即可,用sqrt函数时可能有的数据不是平方数,开放后会有精度损失,导致一直无法AC

AC_Code:C++

#include <iostream>
using namespace std;typedef long long LL;int main()
{LL a,b,c;   cin>>a>>b>>c;if(a+b>c&&a+c>b&&b+c>a){  //任意两边大于第三边LL s=(a+b+c)/2;LL ans=s*(s-a)*(s-b)*(s-c);cout<<ans<<endl;}else cout<<-1<<endl;return 0;
}

AC_Code:java

import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner sc = new Scanner(System.in);long a=sc.nextLong(),b=sc.nextLong(),c=sc.nextLong();if(a+b>c&&a+c>b&&b+c>a){ //任意两边大于第三边long s=(a+b+c)/2;long ans=s*(s-a)*(s-b)*(s-c);System.out.println(ans);}else System.out.println(-1);}
}

题目三:压缩矩阵【算法赛】

压缩矩阵【算法赛】 - 蓝桥云课 (lanqiao.cn)

思路:找规律/数学

1.第一行和最后一行是两个数,其他行都是三个数

2.先算出行,算出行后让列也等于行,用x模3看余数是几,看是需要偏移,余数为1向右偏移一位,余数为2向左偏移一位,余数为0不需要偏移

3.算行的话就是找规律了,(x+4)/3就是行

AC_Code:C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include<stack>
#include<cmath>
#include <unordered_set>
#include <unordered_map>
#include<set>
#include <map>using namespace std;typedef long long LL;
typedef pair<int,int>PII;#define x first
#define y second
#define ls u<<1
#define rs u<<1|1
#define all(ss) ss.begin(),ss.end()int const mod1=998244353;   
int const mod2=1e9+7;
int const N=2e5+7;
int const INF=0x3f3f3f3f;int T;
int m;
int a[N];
string s;void solve(){LL n;scanf("%lld%d", &n, &m);while (m -- ){LL x;scanf("%lld", &x);LL row=(x+4)/3; //计算行LL col=row;//看是否需要向左右偏移if(x%3==2)  col--;else if(x%3==1) col++;printf("%lld %lld\n",row,col);}
} void init(){                     }int main()
{//std::ios::sync_with_stdio(false);   cin.tie(0); cout.tie(0);T=1;//cin>>T;//scanf("%d",&T);init();while(T--){solve();}return 0;
}

AC_Code:java

import java.util.Scanner;public class Main {public static void main(String[] args) {Scanner sc=new Scanner(System.in);long n=sc.nextLong();int q=sc.nextInt();while(q-->0) {long x=sc.nextLong();long row=(x+4)/3; //算出行long col=row;//看是否要向左右偏移if(x%3==1)  col++;else if(x%3==2)  col--;System.out.println(row+" "+col);}}
}

题目四:恒纪元【算法赛】

恒纪元【算法赛】 - 蓝桥云课 (lanqiao.cn)

思路:

1.乱纪元的增长速度是非常快的,(2^40>1e12)所以乱纪元是非常少的,那么可以预处理出所有的乱纪元

2.对于每一个询问s,暴力找到大于s的第一个恒纪元t,再暴力(二分也可以)找到第一个大于t的乱纪元,用第一个大于t的乱纪元-t就是恒纪元可以持续的天数了

3.这个的预处理其实是一个谜(预处理不好很容易只能过25%的测试样例),预处理出小于1e13次方的乱纪元就可以过

AC_Code:C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include<stack>
#include<cmath>
#include <unordered_set>
#include <unordered_map>
#include<set>
#include <map>using namespace std;typedef long long LL;
typedef pair<int,int>PII;#define x first
#define y second
#define ls u<<1
#define rs u<<1|1
#define all(ss) ss.begin(),ss.end()int const mod1=998244353;   
int const mod2=1e9+7;
int const N=2e5+7;
LL const INF=1e13;int T;
int n,q;
int x,y,z;
set<LL>vis; //存储乱纪元LL qpow(int a,int b){LL res=1;for(int i=0;i<b;i++){res=res*a;if(res>INF) return -1;  //大于正无穷了}return res;
}void solve(){scanf("%d%d%d",&x,&y,&z);for(int i=0;i<=40;i++){LL a=qpow(x,i);if(a==-1)   break;//大于正无穷了for(int j=0;j<=40;j++){LL b=qpow(y,j);if(b==-1)   break;//大于正无穷了for(int k=0;k<=40;k++){LL c=qpow(z,k);if(c==-1)   break;//大于正无穷了LL s=a+b+c;if(s>INF)   break;  //三者相加大于正无穷vis.insert(s);}}}scanf("%d",&q);while(q--){LL s;   scanf("%lld",&s);   LL t=s+1;while(vis.count(t)) t++;    //找到第一个恒纪元//二分找到第一个大于t的乱纪元,相减求恒纪元持续了多少天printf("%lld %lld\n",t,*vis.upper_bound(t)-t);}
} void init(){                     }int main()
{//std::ios::sync_with_stdio(false);   cin.tie(0); cout.tie(0);T=1;//cin>>T;//scanf("%d",&T);init();while(T--){solve();}return 0;
}

AC_Code:java


import com.sun.source.tree.Tree;import java.util.*;public class Main {static final long INF=(long)1e13;static long qpow(int a,int b){long res=1;for(int i=0;i<b;i++)    {res=res*a;if(res>INF) return -1;}return res;}public static void main(String[] args) {Scanner sc=new Scanner(System.in);TreeSet<Long> vis=new TreeSet<>();List<Long> list=new ArrayList<>();int x=sc.nextInt(),y=sc.nextInt(),z=sc.nextInt();//预处理乱纪元for(int i=0;i<=40;i++){long a=qpow(x,i);if(a==-1)   break; //大于正无穷for(int j=0;j<=40;j++){long b=qpow(y,j);if(b==-1)   break; //大于正无穷for (int k = 0; k < 40; k++) {long c=qpow(z,k);if(c==-1)   break;  //大于正无穷long s=a+b+c;if(s>INF)   break;  //三者相加大于正无穷if(!vis.contains(s)){list.add(s);vis.add(s);}    }}}Collections.sort(list); //集合排序int q=sc.nextInt();while(q-->0){long s=sc.nextLong();long t=s+1;//找到第一个恒纪元while(vis.contains(t))  t++;//找到大于第一个横纪元的乱纪元int idx=-1;for (int i = 0; i < list.size(); i++) {if(list.get(i)>t){idx=i;break;}}//第一个大于t的乱纪元-减去恒纪元System.out.println(t+" "+(list.get(idx)-t));// System.out.println(t+" "+(vis.ceiling(t+1)-t));   //二分}                   //ceiling相当于lower_bound}
}

题目五:充能计划【算法赛】

充能计划【算法赛】 - 蓝桥云课 (lanqiao.cn)

思路:

简述题意:n个引擎,m种宝石,q个询问,每个询问选出一种宝石p,放到第k个引擎上,此时区间[k,min(n,k+s[p]-1)]都会放入p这个宝石,s数组为每个宝石的充能范围,最后问n种引擎宝石的数量

1.对n个引擎开n个set,对每个询问的合法区间都加入宝石p,最后对每个引擎输出set的大小,时间复杂度o(n^2),会tle的,怎么优化呢?

2.可以对每种宝石分组,对每一个询问记录区间,最后对每种宝石合并区间(注意合并区间前要对左端点排序),合并区间后用差分记录左右端点位置

3.最后累加差分,计算答案

AC_Code:C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include<stack>
#include<cmath>
#include <unordered_set>
#include <unordered_map>
#include<set>
#include <map>using namespace std;typedef long long LL;
typedef pair<int,int>PII;#define x first
#define y second
#define ls u<<1
#define rs u<<1|1
#define all(ss) ss.begin(),ss.end()int const mod1=998244353;   
int const mod2=1e9+7;
int const N=2e5+7;
int const INF=0x3f3f3f3f;int T;
int n,m,q;
int s[N];
vector<PII>line[N]; //line[i]:存储宝石i的所有区间
int diff[N];void solve(){scanf("%d%d%d", &n, &m,&q);for(int i=1;i<=m;i++)   scanf("%d",s+i);while(q--){int p,k;    scanf("%d%d",&p,&k);line[p].push_back({k,min(n,k+s[p]-1)});}for(int i=1;i<=m;i++){if(line[i].empty()) continue;sort(line[i].begin(),line[i].end());  //按左端点排序int l=line[i][0].x,r=line[i][0].y;//区间合并,差分for(PII p:line[i]){if(r>=p.x)  r=max(r,p.y);else{diff[l]++;diff[r+1]--;l=p.x;r=p.y;}}diff[l]++;  diff[r+1]--;}int ans=0;  //累加查分计算答案for(int i=1;i<=n;i++){ ans+=diff[i];printf("%d ",ans);}} void init(){                     }int main()
{//std::ios::sync_with_stdio(false);   cin.tie(0); cout.tie(0);T=1;//cin>>T;//scanf("%d",&T);init();while(T--){solve();}return 0;
}

AC_Code:java

import com.sun.source.tree.Tree;import java.util.*;public class Main {static int N=(int)1e5+7;static int[] s=new int[N];static List<Line>[] line=new ArrayList[N];static int[] diff=new int[N];public static void main(String[] args) {Scanner sc=new Scanner(System.in);int n=sc.nextInt(),m=sc.nextInt(),q=sc.nextInt();for(int i=1;i<=m;i++)   {s[i]=sc.nextInt();line[i]=new ArrayList<Line>();}while(q-->0){int p=sc.nextInt(),k=sc.nextInt();line[p].add(new Line(k,Math.min(n,k+s[p]-1)));  //按宝石种类分组}for(int i=1;i<=m;i++) {if (line[i].isEmpty()) continue;Collections.sort(line[i]);  //排序//区间合并,差分操作int l = line[i].get(0).l, r = line[i].get(0).r;for (Line p : line[i]) {if (r >= p.l) r = Math.max(r, p.r);else {diff[l]++;diff[r + 1]--;l = p.l;r = p.r;}}diff[l]++;diff[r + 1]--;}int ans=0;  //计算答案for(int i=1;i<=n;i++){ans+=diff[i];System.out.print(ans+" ");}}
}class Line implements Comparable<Line>{int l,r;public Line(int l, int r) {this.l = l;this.r = r;}public int compareTo(Line o) {return l-o.l;}
}

题目六:大风起兮【算法赛】

大风起兮【算法赛】 - 蓝桥云课 (lanqiao.cn)

思路:

1.动态求平均数,可以用两个multiset,一个存放一半较小的数,一个存放一半较大的数

2.对于每一个询问,先删除一个数,再计算中位数

AC_Code:C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include<stack>
#include<cmath>
#include <unordered_set>
#include <unordered_map>
#include<set>
#include <map>using namespace std;typedef long long LL;
typedef pair<int,int>PII;#define x first
#define y second
#define ls u<<1
#define rs u<<1|1
#define all(ss) ss.begin(),ss.end()int const mod1=998244353;   
int const mod2=1e9+7;
int const N=2e5+7;
int const INF=0x3f3f3f3f;int T;
int n,m;
int a[N];
string s;void solve(){scanf("%d", &n);vector<int>b;for(int i=1;i<=n;i++)   {scanf("%d",a+i);b.push_back(a[i]);}sort(b.begin(),b.end());multiset<int>mx,mi; //n为奇数,mi多放一个数for(int i=0;i<(n+1)/2;i++)  mi.insert(b[i]);    for(int i=(n+1)/2;i<n;i++)  mx.insert(b[i]);scanf("%d", &m);while(m--){int x;  scanf("%d",&x);if(mi.count(a[x])){ //删除小的数那一堆mi.erase(mi.find(a[x]));if(mx.size()>mi.size()){int temp=*mx.begin();mi.insert(temp);mx.erase(mx.find(temp));}}else{ //删除大的数那一堆mx.erase(mx.find(a[x]));if(mi.size()-mx.size()>1){int temp=*mi.rbegin();mx.insert(temp);mi.erase(mi.find(temp));}}//输出答案if(mi.size()>mx.size()) printf("%.1lf ",*mi.rbegin()*1.0);else printf("%.1lf ",(*mi.rbegin()+*mx.begin())/2.0);}} void init(){                     }int main()
{//std::ios::sync_with_stdio(false);   cin.tie(0); cout.tie(0);T=1;//cin>>T;//scanf("%d",&T);init();while(T--){solve();}return 0;
}

AC_Code:java

题目七:时空追捕【算法赛】

不会写,占时更新,

相关文章:

(蓝桥杯)1125 第 4 场算法双周赛题解+AC代码(c++/java)

题目一&#xff1a;验题人的生日【算法赛】 验题人的生日【算法赛】 - 蓝桥云课 (lanqiao.cn) 思路&#xff1a; 1.又是偶数&#xff0c;又是质数&#xff0c;那么只有2喽 AC_Code:C #include <iostream> using namespace std; int main() {cout<<2;return 0; …...

也可Adobe Animate

Animate CC 由原Adobe Flash Professional CC 更名得来&#xff0c;2015年12月2日&#xff1a;Adobe 宣布Flash Professional更名为Animate CC&#xff0c;在支持Flash SWF文件的基础上&#xff0c;加入了对HTML5的支持。并在2016年1月份发布新版本的时候&#xff0c;正式更名为…...

【面试HOT200】回溯篇

系列综述&#xff1a; &#x1f49e;目的&#xff1a;本系列是个人整理为了秋招面试的&#xff0c;整理期间苛求每个知识点&#xff0c;平衡理解简易度与深入程度。 &#x1f970;来源&#xff1a;材料主要源于【CodeTopHot300】进行的&#xff0c;每个知识点的修正和深入主要参…...

JVM——内存溢出和内存泄漏

目录 1. 内存溢出和内存泄漏内存泄漏的常见场景解决内存溢出的思路1.发现问题 – Top命令2.发现问题 – VisualVM3.发现问题 – Arthas4.发现问题 – Prometheus Grafana5.发现问题 – 堆内存状况的对比![在这里插入图片描述](https://img-blog.csdnimg.cn/direct/058d113715b…...

《凤凰项目》读书笔记

文章目录 一、书名和作者二、书籍概览2.1 主要论点和结构2.2 目标读者和应用场景 三、核心观点与主题3.1 DevOps的核心原则与文化变革3.2 持续交付与自动化3.3 变更管理与风险控制3.4 关键绩效指标与持续改进 四、亮点与启发4.1 最有影响的观点4.2 对个人专业发展的启示 五、批…...

熬夜会秃头——beta冲刺Day4

这个作业属于哪个课程2301-计算机学院-软件工程社区-CSDN社区云这个作业要求在哪里团队作业—beta冲刺事后诸葛亮-CSDN社区这个作业的目标记录beta冲刺Day4团队名称熬夜会秃头团队置顶集合随笔链接熬夜会秃头——Beta冲刺置顶随笔-CSDN社区 一、团队成员会议总结 1、成员工作进…...

HTML5+CSS3+Vue小实例:浪漫的心形文字动画特效

实例:浪漫的心形文字动画特效 技术栈:HTML+CSS+Vue 效果: 源码: 【HTML】 <!DOCTYPE html> <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><meta name="viewport" conte…...

数据结构-基数排序

基数排序 基本思想 基数排序其实就是依靠多位关键字进行排序&#xff0c;现在我们有一个数据为101&#xff0c;那么“101”就是一个三位 关键字&#xff0c;分别为&#xff1a;“百位->1”、“十位->0”、“个位->1”。 此时我们就可以按照三位关键字进行排序&…...

基于ASP.NET MVC技术的图书管理系统的设计与实现

基于ASP.NET MVC技术的图书管理系统的设计与实现 摘要&#xff1a;图书管理系统是一套高新科学技术和图书知识信息以及传统历史文化完美结合的体现。它改变了传统图书收藏的静态书本式图书服务特征&#xff0c;实现了多媒体存取、远程网络传输、智能化检索、跨库无缝链接、创造…...

C++17中的结构化绑定

C17中的结构化绑定(structured binding):将指定名称绑定到初始化程序的子对象或元素。简而言之&#xff0c;它们使我们能够从元组或结构中声明多个变量。与引用一样&#xff0c;结构化绑定是现有对象的别名&#xff1b;与引用不同&#xff0c;结构化绑定不必是引用类型(referen…...

Mover Creator 用户界面

1 “开始”对话框 首次打开 Mover Creator 时&#xff0c;出现的第一个页面是“开始”对话框&#xff0c;如下所示。从这里开始&#xff0c;用户可以选择开始设计飞机、武器或发动机。在上述每种情况下&#xff0c;用户都可以创建新模型或编辑现有模型。 1.1 新建模型 如果用…...

『Nginx安全访问控制』利用Nginx实现账号密码认证登录的最佳实践

&#x1f4e3;读完这篇文章里你能收获到 如何创建用户账号和密码文件&#xff0c;并生成加密密码配置Nginx的认证模块&#xff0c;实现基于账号密码的登录验证 文章目录 一、创建账号密码文件1. 安装htpasswd工具1.1 CentOS1.2 Ubuntu 二、配置Nginx三、重启Nginx 在Web应用程…...

MongoDB导入导出命令

&#xff08;1&#xff09;mongoexport命令 例如&#xff1a; mongoexport --db testdb --collection person --out person.json mongoexport --db testdb --collection person --fields name,age --out person.json mongoexport --db testdb --collection person --query {&qu…...

软件工程期末复习(1)

学习资料 软件工程知识点总结_嘤桃子的博客-CSDN博客 软件工程学习笔记_软件工程导论第六版张海藩pdf-CSDN博客 【软件工程】软件工程期末试卷习题课讲解&#xff01;&#xff01;_哔哩哔哩_bilibili 【拯救者】软件工程速成(期末考研复试软考)均适用. 支持4K_哔哩哔哩_bil…...

nextjs入门

创建项目 npx create-next-app 项目名 体验文件路由 nextjs提供了文件路由的功能, 根据文件系统的目录结构, 可以识别为对应的页面路由 创建页面 首先, 在src下创建pages目录, 然后创建一个about文件(对应about页面)和main/index.js文件(对应首页) pages/main/index con…...

【C语言】字符串函数strlen #strcpy #strcmp #strcat #strstr及其模拟实现

在C语言中&#xff0c;有一种特殊的数据类型&#xff0c;即字符串类型。C 并没有专门定义一个字符串类型&#xff0c;这对我们使用字符串造成了一定的麻烦。但是&#xff0c;C标准库<string.h> 中定义了各种字符串函数&#xff0c;这对于我们来说是一件值得庆幸的事情。…...

递归实现组合型枚举

递归实现组合型枚举 #include<iostream> #include<vector>int n, m; std::vector<int>res; bool st[30];void Print() {for(int i0;i<res.size();i){printf("%d ",res[i]);}puts(""); }void dfs(int num) {if (res.size() m){Print(…...

SCAU:1065 数组中的指针

1065 数组中的指针 时间限制:1000MS 代码长度限制:10KB 提交次数:3436 通过次数:1692 题型: 编程题 语言: G;GCC Description 设有如下数组定义&#xff1a; int a[3][4]{{1,3,5,7},{9,11,13,15},{17,19,21,23}}; 计算下面各项的值&#xff08;设数组a的首地址为2000&…...

找不到msvcp110.dll如何修复?分享5个亲测有效的修复方法

在计算机使用过程中&#xff0c;我们经常会遇到一些错误提示&#xff0c;其中之一就是“msvcp110.dll丢失”。这个错误通常发生在运行某些程序时&#xff0c;系统无法找到所需的动态链接库文件。那么&#xff0c;msvcp110.dll到底是什么呢&#xff1f;它又有什么作用&#xff1…...

LeetCode刷题笔记第80题:删除有序数组中的重复项 II

LeetCode刷题笔记第80题&#xff1a;删除有序数组中的重复项 II 题目&#xff1a; 删除升序数组中超过两次的元素后的数组长度 想法&#xff1a; 使用快慢指针的方法完成&#xff0c;使用快指针遍历整个数组&#xff0c;使用慢指针完成相同元素最多保留两个。在快指针遍历到…...

Appium+python自动化(十六)- ADB命令

简介 Android 调试桥(adb)是多种用途的工具&#xff0c;该工具可以帮助你你管理设备或模拟器 的状态。 adb ( Android Debug Bridge)是一个通用命令行工具&#xff0c;其允许您与模拟器实例或连接的 Android 设备进行通信。它可为各种设备操作提供便利&#xff0c;如安装和调试…...

Auto-Coder使用GPT-4o完成:在用TabPFN这个模型构建一个预测未来3天涨跌的分类任务

通过akshare库&#xff0c;获取股票数据&#xff0c;并生成TabPFN这个模型 可以识别、处理的格式&#xff0c;写一个完整的预处理示例&#xff0c;并构建一个预测未来 3 天股价涨跌的分类任务 用TabPFN这个模型构建一个预测未来 3 天股价涨跌的分类任务&#xff0c;进行预测并输…...

oracle与MySQL数据库之间数据同步的技术要点

Oracle与MySQL数据库之间的数据同步是一个涉及多个技术要点的复杂任务。由于Oracle和MySQL的架构差异&#xff0c;它们的数据同步要求既要保持数据的准确性和一致性&#xff0c;又要处理好性能问题。以下是一些主要的技术要点&#xff1a; 数据结构差异 数据类型差异&#xff…...

【Go】3、Go语言进阶与依赖管理

前言 本系列文章参考自稀土掘金上的 【字节内部课】公开课&#xff0c;做自我学习总结整理。 Go语言并发编程 Go语言原生支持并发编程&#xff0c;它的核心机制是 Goroutine 协程、Channel 通道&#xff0c;并基于CSP&#xff08;Communicating Sequential Processes&#xff0…...

数据库分批入库

今天在工作中&#xff0c;遇到一个问题&#xff0c;就是分批查询的时候&#xff0c;由于批次过大导致出现了一些问题&#xff0c;一下是问题描述和解决方案&#xff1a; 示例&#xff1a; // 假设已有数据列表 dataList 和 PreparedStatement pstmt int batchSize 1000; // …...

宇树科技,改名了!

提到国内具身智能和机器人领域的代表企业&#xff0c;那宇树科技&#xff08;Unitree&#xff09;必须名列其榜。 最近&#xff0c;宇树科技的一项新变动消息在业界引发了不少关注和讨论&#xff0c;即&#xff1a; 宇树向其合作伙伴发布了一封公司名称变更函称&#xff0c;因…...

LRU 缓存机制详解与实现(Java版) + 力扣解决

&#x1f4cc; LRU 缓存机制详解与实现&#xff08;Java版&#xff09; 一、&#x1f4d6; 问题背景 在日常开发中&#xff0c;我们经常会使用 缓存&#xff08;Cache&#xff09; 来提升性能。但由于内存有限&#xff0c;缓存不可能无限增长&#xff0c;于是需要策略决定&am…...

R 语言科研绘图第 55 期 --- 网络图-聚类

在发表科研论文的过程中&#xff0c;科研绘图是必不可少的&#xff0c;一张好看的图形会是文章很大的加分项。 为了便于使用&#xff0c;本系列文章介绍的所有绘图都已收录到了 sciRplot 项目中&#xff0c;获取方式&#xff1a; R 语言科研绘图模板 --- sciRplothttps://mp.…...

ubuntu系统文件误删(/lib/x86_64-linux-gnu/libc.so.6)修复方案 [成功解决]

报错信息&#xff1a;libc.so.6: cannot open shared object file: No such file or directory&#xff1a; #ls, ln, sudo...命令都不能用 error while loading shared libraries: libc.so.6: cannot open shared object file: No such file or directory重启后报错信息&…...

[USACO23FEB] Bakery S

题目描述 Bessie 开了一家面包店! 在她的面包店里&#xff0c;Bessie 有一个烤箱&#xff0c;可以在 t C t_C tC​ 的时间内生产一块饼干或在 t M t_M tM​ 单位时间内生产一块松糕。 ( 1 ≤ t C , t M ≤ 10 9 ) (1 \le t_C,t_M \le 10^9) (1≤tC​,tM​≤109)。由于空间…...