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

2025-11-26

CF

构造(1300)

Problem - 1867C - Codeforces(交互)

#include <bits/stdc++.h>
using namespace std;
#define LL long long
const LL mod = 998244353;
const int N=2e5+10;
int a[N];void solve()
{int n;cin >> n;for (int i = 0; i < n;i++){cin >> a[i];}int i = 0;while(a[i]==i&&i<n){i++;}cout << i << endl;int y;while(1){cin >> y;if(y==-1||y==-2)break;cout << y << endl;}
}int main()
{ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int T;cin >> T;while (T--){solve();}
}

Problem - 1839C - Codeforces

#include <bits/stdc++.h>
using namespace std;
#define LL long long
const LL mod = 998244353;
const int N=2e5+10;
int a[N];void solve()
{int n;cin >> n;for (int i = 1; i <= n;i++){cin >> a[i];}if(a[n]==1){cout << "NO\n";return;}cout << "YES\n";int cnt = 0;for (int i = n; i >= 1;i--){if(a[i]==0){cout << "0 ";}else{cnt++;if(a[i-1]==0){cout << cnt << " ";cnt = 0;}else{cout << "0 ";}}}cout << endl;
}int main()
{ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int T;cin >> T;while (T--){solve();}
}
http://www.gsyq.cn/news/61964.html

相关文章:

  • 2025年11月砝码,无磁不锈钢砝码,定制砝码厂家推荐:行业权威盘点与品质红榜发布
  • 2025年11月不锈钢砝码,无磁不锈钢砝码,挂钩砝码厂家推荐,高精度与可靠性兼具的优质品牌
  • 上下文无关文法序列
  • ARCGIS Pro 绘图技巧——水文站的尖尖垂直于河流的水流方向
  • 优美的字符串
  • 【普中Hi3861开发攻略--基于鸿蒙OS】-- 第 31 章 WIFI 实验-华为 IoTDA 设备接入 - 教程
  • OpenHarmony与ArkUI-X的跨平台开发环境搭建细节版
  • OpenHarmony与ArkUI-X的跨平台开发环境搭建速通版
  • 卷积神经网络的引入4 —— 局部扰动与空间结构破坏下的鲁棒性验证
  • Python convert class list in CSV file via pandas.dataframe
  • RabbitMQ消息分发详解:从默认轮询到智能负载均衡 - 指南
  • 11月26日
  • slkjflksjdklflsdkjfjlksdlkjfsflkjsd
  • 十一月份《代码大全》观后感
  • [KaibaMath]1026 海明码校验位数求解方法的进一步简化
  • 2025年11月【口碑好的】通讯管理机【公司】【推荐】【哪家好】
  • Redhat-9-中编译-EFS-客户端工具-即过程中-报错提示-warning: aws-lc-fips-sys@0.13.9: Building with: CMake-解决方法
  • 05app抓包
  • 实用指南:基于 ComfyUI 的 Stable Diffusion 本地部署与使用教程
  • 2025年设计师与程序员专属:高级感简历模板 TOP5 排行榜
  • 什么是Go语言
  • 人工智能之数据分析 Matplotlib:第一章 简介和安装
  • feature map是什么
  • 重磅!图灵奖得主 Bengio 领衔 30 + 顶流学者联合发文!首次给 AGI 下量化定义
  • 零代码,分钟级定制:我用LLaMA-Factory轻松造了个“票务专家”AI
  • StackOverflow已经死亡了吗
  • 2025AI培训权威排名:AI时代新商学引领行业变革
  • Manim进阶:用背景图片让你的数学视频脱颖而出
  • 2025 AI 培训机构权威推荐榜排名揭晓:AI时代新商学引领行业破局之路
  • Lab4AI与国内顶会展开合作!一键体验 CVPR/ICCV/NeurIPS 顶会论文复现