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

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.xdnf.cn/news/10307.html

相关文章:

  • 【Rust 轻松构建轻量级多端桌面应用】
  • 【沉浸式求职学习day51】【发送邮件】【javaweb结尾】
  • Kafka 的 ISR 机制深度解析:保障数据可靠性的核心防线
  • 在RTX5060Ti上进行Qwen3-4B的GRPO强化微调
  • 尚硅谷redis7 93-97 springboot整合reids之总体概述
  • LeetCode - 206. 反转链表
  • IDM下载器 Internet Download Manager v6.42 Build 39
  • 高考加油!UI界面生成器!
  • 设计模式——系统数据建模设计
  • Qt SQL模块基础
  • 【Net】TCP粘包与半包
  • AI学习笔记(一)背景学习
  • 【Docker系列】Docker 容器内安装`ps`命令
  • 数据结构:栈(Stack)和堆(Heap)
  • 通过mqtt 点灯
  • SQL Server 事务详解:概念、特性、隔离级别与实践
  • leetcode hot100刷题日记——33.二叉树的层序遍历
  • 应急响应靶机-web2-知攻善防实验室
  • Kafka消息中间件
  • CentOS 7 安装docker缺少slirp4netnsy依赖解决方案
  • 如何评估CAN总线信号质量
  • 数字化浪潮下:信息化教学模式与人工智能的协同创新发展研究
  • 守护生命之光:进行性核上性麻痹的全方位健康护理指南
  • [SC]SystemC在CPU和GPU等复杂SoC验证中的应用
  • EEPROM库详解
  • 颠覆传统!单样本熵最小化如何重塑大语言模型训练范式?
  • Linux 网络流量监控实战:使用 iftop 精准定位高带宽连接
  • 跟我学c++中级篇——隐式转换的意义
  • PostgreSQL的扩展 dblink
  • MySQL--day10--数据处理之增删改