Codeforces 908A (New Year and Counting Cards)914A(Perfect Squares)

【AAAI2025】【小目标检测】FBRT-YOLO:更快速、更优的实时航拍图像检测方法 FBRT-YOLO是一种新型实时航拍图像检测方法,针对小目标检测的精度与效率平衡问题提出创新解决方案。该方法通过两个轻量级模块显著提升性能:特征互补映射模块(FCM)将浅层空间位置信息深度整合至网络深层,缓解信息失衡;多核感知单元(MKP)采用多尺度卷积增强多目标感知能力。实验表明,在VisDrone、UAVDT和AI-TOD数据集上,FBRT-YOLO在检测精度和速度方面均优于现有实时检测器,特别适用于资源受限的飞行设备。该模型通过精简网络结构,在保持高性能的同时降低了计算负担,为航拍实时检测提供了高效解 阅读详情

题目时空门

Your friend has n cards.

You know that each card has a lowercase English letter on one side and a digit on the other.

Currently, your friend has laid out the cards on a table so only one side of each card is visible.

You would like to know if the following statement is true for cards that your friend owns: “If a card has a vowel on one side, then it has an even digit on the other side.” More specifically, a vowel is one of ‘a’, ‘e’, ‘i’, ‘o’ or ‘u’, and even digit is one of ‘0’, ‘2’, ‘4’, ‘6’ or ‘8’.

For example, if a card has ‘a’ on one side, and ‘6’ on the other side, then this statement is true for it. Also, the statement is true, for example, for a card with ‘b’ and ‘4’, and for a card with ‘b’ and ‘3’ (since the letter is not a vowel). The statement is false, for example, for card with ‘e’ and ‘5’. You are interested if the statement is true for all cards. In particular, if no card has a vowel, the statement is true.

To determine this, you can flip over some cards to reveal the other side. You would like to know what is the minimum number of cards you need to flip in the worst case in order to verify that the statement is true.

Input
The first and only line of input will contain a string s (1 ≤ |s| ≤ 50), denoting the sides of the cards that you can see on the table currently. Each character of s is either a lowercase English letter or a digit.

Output
Print a single integer, the minimum number of cards you must turn over to verify your claim.

Examples
input
ee
output
2
inputCopy
z
output
0
inputCopy
0ay1
output
2
Note
In the first sample, we must turn over both cards. Note that even though both cards have the same letter, they could possibly have different numbers on the other side.

In the second sample, we don’t need to turn over any cards. The statement is vacuously true, since you know your friend has no cards with a vowel on them.

In the third sample, we need to flip the second and fourth cards.

题意:

有一堆卡片,每张牌一面是数字一面是字母。题目给出了一个规则:只要牌面是元音字母则它的对照面一定是偶数,然后给你一个字符串,问最少翻多少张最终判断这些牌面对照是对的

思路:

根据题意知道:元音字母对应的一定是偶数,则他的逆反命题也成立,奇数一定对应的非元音字母。所以直接统计奇数和元音字母出现的次数即可。

代码:

#include<stdio.h>
#include<string.h>

char s[55];

int main()
{
    scanf("%s",s);
    int l=strlen(s);
    int sum=0;
    for(int i=0;i<l;i++)
    {
        if(s[i]=='a'||s[i]=='e'||s[i]=='i'||s[i]=='o'||s[i]=='u'||s[i]=='1'||s[i]=='3'||s[i]=='5'||s[i]=='7'||s[i]=='9')
            sum++;
    }
    printf("%d\n",sum);
    return 0;
}

题目时空门

Given an array a1, a2, …, an of n integers, find the largest number in the array that is not a perfect square.

A number x is said to be a perfect square if there exists an integer y such that x = y^2.

Input
The first line contains a single integer n (1 ≤ n ≤ 1000) — the number of elements in the array.

The second line contains n integers a1, a2, …, an ( - 106 ≤ ai ≤ 106) — the elements of the array.

It is guaranteed that at least one element of the array is not a perfect square.

Output
Print the largest number in the array which is not a perfect square. It is guaranteed that an answer always exists.

Examples
inputCopy
2
4 2
output
2
inputCopy
8
1 2 4 8 16 32 64 576
output
32
Note
In the first sample case, 4 is a perfect square, so the largest number in the array that is not a perfect square is 2.

题意:

给你了一个定义:如果满足x=y^2则称他为完美数。让你求给你的n个数中不是完美数的最大的数。

思路:

直接遍历。

代码:

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <cmath>

using namespace std;
const int N=1e5+10;
char s[2010][2010];

int f(int x)
{
    double y=sqrt(x);
    int xx=sqrt(x);
    if(y==xx)
        return 1;
    else
        return 0;
}

int main()
{
    ios::sync_with_stdio(false);
    int n;
    while(cin>>n)
    {
        int x;
        int maxx=-1e6-10;
        for(int i=1;i<=n;i++)
        {
            cin>>x;
            if(!f(x))
            {
                if(maxx<x)
                    maxx=x;
            }
        }
        cout<<maxx<<endl;
    }
    return 0;
}
【STM32 CubeMX】I2C中断方式与DMA方式 在STM32 CubeMX环境中,I2C(Inter-Integrated Circuit)通信协议的实现可以采用中断方式或DMA(Direct Memory Access)方式。中断方式通过触发中断来处理数据传输,而DMA方式则利用直接内存访问技术来实现数据传输,减轻了CPU的负担。在选择I2C通信方式时,开发者需要根据具体的应用需求和性能要求来选择合适的方式。STM32 CubeMX提供了图形化配置工具,使得配置I2C通信方式变得更加便捷。 阅读详情

相关推荐

prometheus 从入门到精通(史上最全)

Prometheus(由go语言开发)是一套开源的监控&报警&时间序列(按照时间排序)数据库的组合。因为kubernetes(俗称k8s)的流行带动了prometheus的发展。它可以监控主机,服务,容器,支持多种exporter采集数据,还支持pushgateway进行数据上报,Prometheus性能足够支撑上万台规模的集群。原文链接:https://blog.csdn.net/qq_45277554/article/details/130917620时间序列数据。

流水_鱼鱼的博客 1万+

New Year and Counting Cards

New Year and Counting Cards Your friend has n cards. You know that each card has a lowercase English letter on one side and a digit on the other. Currently, your friend has laid out the car

codeswarrior的博客 396

从零到一:RJ71EN71 ModbusTCP配置的避坑指南与实战技巧

本文详细解析三菱RJ71EN71模块的ModbusTCP配置全流程,涵盖GX Works3参数设置、地址映射、通信调试等核心环节。针对工业环境中常见的IP冲突、软元件分配错误、通信超时等高频问题提供实战解决方案,帮助工程师快速构建高可靠性通信网络,避免项目延期风险。

zzz56的博客 331

CodeForces - 908A New Year and Counting Cards

Your friend has n cards. You know that each card has a lowercase English letter on one side and a digit on the other. Currently, your friend has laid out the cards on a table so only one side of eac

UncleJokerly 747

Android HTTPS抓包证书配置全解:Proxyman实战避坑指南

HTTPS抓包本质是中间人(MITM)通信的可信建立过程,其核心在于客户端对代理根证书的信任链配置。在Android平台,自7.0起系统默认不信任用户安装的CA证书,必须通过Network Security Config显式声明trust-anchors,将Proxyman导出的PEM格式根证书纳入App级信任锚点。这一机制区别于iOS和桌面浏览器,导致大量开发者卡在‘证书已安装却无法解密’的误区。技术价值在于打通开发调试闭环:精准定位SSLHandshakeException、绕过证书固定、支持React

weixin_32175665的博客 648

WRF模型下中国土地利用数据替换USGS-24分类的完整实践指南

本文提供了在WRF模型中,将中国土地利用数据替换默认USGS-24分类的完整实践指南。详细阐述了替换下垫面数据的必要性,并分步讲解了数据准备、坐标转换、分类体系重映射、格式转换及配置文件修改等核心操作,旨在帮助用户提升针对中国区域的模拟精度。

salt的博客 777

codeforces 908A New Year and Counting Cards

(http://www.elijahqi.win/2017/12/30/codeforces-908a-new-year-and-counting-cards/) Your friend has n cards. You know that each card has a lowercase English letter on one side and a digit on the other

Elijahqi 1139

pyinstaller+scrapy打包出现错误:OSError: could not get source code

错误如下: Traceback (most recent call last): File "scrapy\utils\defer.py", line 55, in mustbe_deferred File "scrapy\core\spidermw.py", line 60, in process_spider_input File "scrapy\core\scraper.py", line 152, in call_spider File "scrapy\utils\misc.py

kin的博客 1759

A. New Year and Counting Cards

time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Your friend has n cards. You know that each card has a lowerca

无知的我 966

微信小程序 实现拼图功能

微信小程序 实现碎片拼图

weixin_45689786的博客 2250

Linux内存管理(17):percpu 分配器——基本原理

随着 SMP(对称多处理器架构)的发展,在享受处理器更快的执行效率的同时,也为数据同步带来了更大的挑战,因为在 SMP 架构中,程序确实是在并发执行,从单 CPU 只需要考虑调度风险,到SMP 中还需要考虑多 CPU 中同时执行的风险,而且在单 CPU 下乱序执行也会在 SMP 架构中带来,从而也衍生了一些新的同步机制,例如:内存屏障、percpu 机制等等。

私房菜 1249

908A - New Year and Counting Cards

A. New Year and Counting Cards time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Your friend has n cards. Y

memory_qianxiao的博客 739

《UDS协议从入门到精通》系列——到底什么是DTC?

到底什么是DTC?看这里,深度图解DTC格式,详述DTC状态位、快照信息和扩展信息!!

车载系统攻城狮 1万+

Codeforces Round 903 (Div. 3) 题解 A-E

Codeforces Round 903 (Div. 3) 题解 A-E,模拟,思维,矩阵模拟,二分答案,大整数,动态规划

xiaoqian7758258的博客 532

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

ET2012新版免狗免安装绿色软件

ET2012新版免狗免安祖昂绿色软件。,新界面,新视觉,

Codeforces Round 903 (Div. 3).C Perfect Square

本题是一道典型的贪心算法,我们要学会透过事物的本质去分析元素,然后分析元素的关系和逻辑去刻画题型,这是我最近的一个新发现,本体就是先分析根本因素‘,再找其数学关系和逻辑关系即可解出。

hl6043的博客 207

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

New Year and Counting Cards(for(auto)循环+思维) CF-908A

题意: 一堆卡片,每个卡片两面分别写着字母和数字;验证 "元音字母’a’,‘e’,‘i’,‘o’,'u’后面一定是偶数"命题成不成立。我们可以翻卡片来检查,问最少需要翻多少次 分析: 元音字母:翻 辅音字母:不翻 奇数:翻 偶数:不翻 Code: #include<iostream> using namespace std; int main(){ string a; cin>>a; int t=0; for(auto &c:a) //即fo...

Yoyo的博客 231

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

Codeforces 908A New Year and Counting Cards

#define _CRT_SECURE_NO_WARNINGS #include &lt;iostream&gt; #include &lt;cstdio&gt; #include &lt;math.h&gt; #include &lt;string&gt; #include &lt;algorithm&gt; using namespace std; int ans; int main(...

Polanwind 176

codeforces 908A new year and counting cards

这题看着真TM吓人,其实很假 只要读懂题,都会做 题意: 如果一个字符是元音字母,则它对应的数字必为0,2,4,6,8(偶数)中的一个,否则为false。就是如果是元音字母,则要判断,如果是奇数也要判断(因为如果它的对应字符为元音,那么则为false)如果是偶数或非辅音字母则不用判断。要保证的是元音字母必对应偶数 #include&lt;stdio.h&gt; #include&lt;string...

sunnyorrainy的博客 228

A题博弈论CodeForces - 914B

Edogawa Conan got tired of solving cases, and invited his friend, Professor Agasa, over. They decided to play a game of cards. Conan has n cards, and the i-th card has a number ai written on it. They...

Parkerljc的博客 668

【Codecraft-18 and Codeforces Round #458 (Div. 1 + Div. 2, combined) A】 Perfect Squares

【链接】 我是链接,点我呀:) 【题意】 在这里输入题意 【题解】 N*1000暴力就好 【代码】 #include <bits/stdc++.h> using namespace std; const int N = 1e3; int n,a[N+10]; bool is(int x){ for (int i = 0;i <= 100...

AWCXV 128

914A Perfect Squares

题意:输入一个n然后,然后输入n个数,范围是-1e6到1e6,找出最大的一个不是完全平方数的数。输出。 题解:模拟  我先预处理出来1到1e3次方的完全平方数,然后一次从输入的n个数一次去在a数组里面找,有的话,就是完全平方数,没有的就不是,最后取个最大值的。昨晚做的时候,负数没有完全平方数,我就continue了,ans初始化为0,结果错了都不知道在哪里。。。真的有时候大脑短路,真想给自己一掌

memory_qianxiao的博客 477

C语言(CodeForces - 908A) New Year and Counting Cards

New Year and Counting Cards (CodeForces - 908A) Your friend has n cards. You know that each card has a lowercase English letter on one side and a digit on the other. Currently, your friend has laid ou...

weixin_46247544的博客 378

Codeforces Good Bye 2017

A. New Year and Counting Cards 题意:牌的正面是数字反面是字母,要判断是否所有的元音字母背面都是偶数。 题解:需要翻的牌是所有的元音字母与奇数。 #include #include #include #include #include #include #include #include #define maxn 100050 #define INF 0x

qq_35715891的博客 319

Educational Codeforces Round 35 D - Inversion Counting

#include #include #include #include #include #include #include #include #include #include #include #include #define PI acos(-1.0) #define in freopen("in.txt", "r", stdin) #define out freopen("out.txt"

床前明月光 224

LeetCode----Perfect Squares

Perfect Squares Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, return 3 because 12

whiterbear的专栏 1264

Codeforces 939A Love Triangle(三角恋问题)

题目:As you could know there are no male planes nor female planes. However, each plane on Earth likes some other plane. There are n planes on Earth, numbered from 1 to n, and the plane with number i like

Puppet__的博客 1315
上一篇: Codeforces 915B (Browser)
下一篇: 分解质因数
Puppet__
博客等级 码龄9年 319粉丝 328原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值