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

cf每日刷题

目录

String(800)

Skibidus and Amog'u(800)

Apples in Boxes(1100)


 

String(800)

https://codeforces.com/problemset/problem/2062/A

#include <iostream>
#include <string>
using namespace std;
int main()
{int t;cin >> t;while (t--){int res = 0;string s;cin >> s;for (int i = 0; i < s.size(); i++){if (s[i] == '1'){res++;}}cout << res << endl;}return 0;
}

Skibidus and Amog'u(800)

https://codeforces.com/problemset/problem/2065/A

#include <iostream>
#include <string>
using namespace std;
int main()
{int t;cin >> t;while (t--){string s;cin >> s;for (int i = 0; i < s.size() - 2; i++){cout << s[i];}cout << "i" << endl;}return 0;
}

Apples in Boxes(1100)

https://codeforces.com/problemset/problem/2107/B

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define int long long
void solve()
{int n, k;cin >> n >> k;vector<int> a(n);for (int i = 0; i < n; i++){cin >> a[i];}sort(a.begin(), a.end());a[n - 1]--;sort(a.begin(), a.end());if (a[n - 1] - a[0] > k){cout << "Jerry\n";return;}int sum = 0;for (int i = 0; i < n; i++){sum += a[i];}if (sum % 2 == 0){cout << "Tom\n";}else{cout << "Jerry\n";}
}
signed main()
{int t;cin >> t;while (t--){solve();}return 0;
}

http://www.xdnf.cn/news/10192.html

相关文章:

  • RFID技术深度剖析:从原理、协议到S50卡与FM17550读写
  • 多类别分类中的宏平均和加权平均
  • SOC-ESP32S3部分:22-分区表
  • springMVC-9数据格式化
  • rtpinsertsound:语音注入攻击!全参数详细教程!Kali Linux教程!
  • CppCon 2014 学习:Multiplatform C++
  • 具有离散序列建模的统一多模态大语言模型【AnyGPT】
  • 可灵2.1 vs Veo 3:AI视频生成谁更胜一筹?
  • 【数据结构】——二叉树--链式结构
  • 定制开发开源AI智能名片S2B2C商城小程序:数字营销时代的话语权重构
  • elasticsearch低频字段优化
  • ubuntu/windows系统下如何让.desktop/.exe文件 在开机的时候自动运行
  • java程序从服务器端到Lambda函数的迁移与优化
  • 普中STM32F103ZET6开发攻略(一)
  • SAP学习笔记 - 开发15 - 前端Fiori开发 Boostrap,Controls,MVC(Model,View,Controller),Modules
  • Java 单例模式详解
  • Redis最佳实践——安全与稳定性保障之数据持久化详解
  • 2025-5-31-C++ 学习 字符串(终)
  • Springcloud Alibaba自定义负载均衡详解
  • 某航参数逆向及设备指纹分析
  • 告别硬编码!用工厂模式优雅构建可扩展的 Spring Boot 应用 [特殊字符]
  • STM32CubeMX定时器配置
  • 如何在 Ubuntu22.04 上安装并开始使用 RabbitMQ
  • QuickJS 在生物化学计算中的应用
  • MATLAB实战:实现数字调制解调仿真
  • 建造者模式:优雅构建复杂对象
  • Ubuntu下编译mininim游戏全攻略
  • 力扣HOT100之动态规划:139. 单词拆分
  • Spring之循环依赖源码解析
  • 现代数据湖架构全景解析:存储、表格式、计算引擎与元数据服务的协同生态