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

acwing刷题

目录

6122. 农夫约翰的奶酪块

6123. 哞叫时间


6122. 农夫约翰的奶酪块

#include <iostream>
using namespace std;
int res;
int n, q;
int X[1010][1010];
int Y[1010][1010];
int Z[1010][1010];
void solve()
{int x, y, z;cin >> x >> y >> z;X[x][y]++;Y[y][z]++;Z[x][z]++;if (X[x][y] == n){res++;}if (Y[y][z] == n){res++;}if (Z[x][z] == n){res++;}cout << res << endl;
}
int main()
{cin >> n >> q;while (q--){solve();}return 0;
}

6123. 哞叫时间

#include <iostream>
#include <algorithm>
using namespace std;
#define int long long
void solve()
{int n;cin >> n;int s[500010] = {0};int left = n / 2 + 1;int x = 1e15;for (int i = 1; i <= n; i++){int t;cin >> t;s[i] = s[i - 1] + t;if (i >= left){x = min(x, s[i] - s[i - left]);}}int y = s[n] - x;cout << x << " " << y << endl;
}
signed main()
{int t;cin >> t;while (t--){solve();}return 0;
}

相关文章:

  • 江科大IIC读取MPU6050hal库实现
  • 在Windows本地部署Dify详细操作
  • Linux入门(十二)服务管理
  • 建筑兔零基础人工智能自学记录101|Transformer(1)-14
  • LG P5048 [Ynoi2019 模拟赛] Yuno loves sqrt technology III Solution
  • 若依框架-定制化服务搭建
  • 信息安全之什么是公钥密码
  • 大模型应用开发之预训练
  • vue3的watch用法
  • 产品规格书写作结构、规范(编写指南)
  • 力扣热题100之翻转二叉树
  • 26考研——文件管理_文件目录(4)
  • 电机驱动器辐射骚扰整改
  • 关于用Cloudflare的Zero Trust实现绕过备案访问国内站点说明
  • HackMyVM-Ephemeral3
  • 考研系列—操作系统:第三章、内存管理(part.2)
  • AI书签管理工具开发全记录(八):Ai创建书签功能实现
  • MySQL事务与锁机制详解:确保数据一致性的关键【MySQL系列】
  • PostIn入门教程 - 使用IDEA插件快速生成API接口定义
  • Halcon
  • 自己网站做短链接/徐州网站建设
  • wordpress打开网站打不开/北京千锋教育培训机构怎么样
  • 杭州知名网站建设/美发培训职业学校
  • 微信企业号可以做微网站吗/搜索引擎优化目标
  • 空间商指定的网站目录/西安网站开发
  • 建设营销型网站的目的有哪些/网络广告策划的内容