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

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;
}

相关文章:

  • 建网站需要身份证吗网站关键词优化案例
  • 微信公众号 网站开发 2016太原百度快速优化
  • 公司网站建设工作通知如何开发一款app软件
  • 做色情网站需要多少钱seo学途论坛网
  • 洛阳公司做网站无锡seo网站排名
  • 企业门户网站建设案例google seo整站优化
  • 【MySQL】索引下推减少回表次数
  • Vue 核心技术与实战day07
  • 电脑驱动程序更新工具, 3DP Chip 中文绿色版,一键更新驱动!
  • MAC上怎么进入隐藏目录
  • 设计模式——系统数据建模设计
  • 23种设计模式概览
  • LeetCode Hot100刷题——划分字母区间
  • C++学习-入门到精通【11】输入/输出流的深入剖析
  • 5.2 初识Spark Streaming
  • day15 leetcode-hot100-28(链表7)
  • LeetCode hot100-9
  • 网络系统中安全漏洞扫描为何重要?扫描啥?咋扫描?
  • qwen 2.5 并行计算机制:依靠 PyTorch 和 Transformers 库的分布式能力
  • MySQL锁机制
  • 【PostgreSQL 03】PostGIS空间数据深度实战:从地图服务到智慧城市
  • QT入门学习
  • 4.2.4 Spark SQL 数据写入模式
  • CppCon 2014 学习:Pragmatic Type Erasure
  • vue3 el-input type=“textarea“ 字体样式 及高度设置
  • Axure中继器交互完全指南:核心函数解析×场景实战×避坑策略(懂得才能应用)