当前位置: 首页 > 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;
}

http://www.dtcms.com/a/224839.html

相关文章:

  • 江科大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
  • 力扣HOT100之动态规划:139. 单词拆分
  • 牛客周赛94
  • 极智项目 | 多模态大模型推理平台-Streamlit版(支持Qwen2.5/InternVL3/KimiVL三大模型)
  • 【CBAP50技术手册】#31 Observation(观察法):BA(业务分析师)的“现场侦探术”
  • 浮点数舍入规则_编程语言对比
  • CTFHub-RCE 命令注入-过滤运算符
  • [SC]SystemC在CPU/GPU验证中的应用(二)
  • R语言错误处理方法大全
  • CRISPR-Cas系统的小型化研究进展-文献精读137
  • python打卡day41