CodeForces 545A

5G基站接收机灵敏度测试避坑指南:从标准解读到实操,为什么你的结果总差6dB? 本文深入解析5G基站接收机灵敏度测试中常见的6dB偏差问题,揭示其根源在于测试信号频谱分配的技术细节。通过标准解读和实操指南,提供射频测试中的关键配置步骤和解决方案,帮助工程师准确完成5G接收机测量,避免常见错误。 阅读详情

Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph.

There are n toy cars. Each pair collides. The result of a collision can be one of the following: no car turned over, one car turned over, both cars turned over. A car is good if it turned over in no collision. The results of the collisions are determined by an n × n matrix А: there is a number on the intersection of the і-th row and j-th column that describes the result of the collision of the і-th and the j-th car:

  •  - 1: if this pair of cars never collided.  - 1 occurs only on the main diagonal of the matrix.
  • 0: if no car turned over during the collision.
  • 1: if only the i-th car turned over during the collision.
  • 2: if only the j-th car turned over during the collision.
  • 3: if both cars turned over during the collision.

Susie wants to find all the good cars. She quickly determined which cars are good. Can you cope with the task?

Input

The first line contains integer n (1 ≤ n ≤ 100) — the number of cars.

Each of the next n lines contains n space-separated integers that determine matrix A.

It is guaranteed that on the main diagonal there are  - 1, and  - 1 doesn't appear anywhere else in the matrix.

It is guaranteed that the input is correct, that is, if Aij = 1, then Aji = 2, if Aij = 3, then Aji = 3, and if Aij = 0, then Aji = 0.

Output

Print the number of good cars and in the next line print their space-separated indices in the increasing order.

Sample Input

Input

3-1 0 00 -1 10 2 -1

Output

21 3

Input

4-1 3 3 33 -1 3 33 3 -1 33 3 3 -1

Output

0

///这是本次这周赛中传说最简单的一道题,抠英文抠了好半天就是读不懂题意,英语是硬伤啊>_<最后看明白的差不多了,输入的n是指小汽车的数量,矩阵中的-1是指小车不会和自己相撞,0表示两个车都不会撞坏,1表示矩阵中该行所表示的车号被撞坏,2表示矩阵中该列所表示的车号被撞坏,3表示都被撞坏。以下有两种方法:

 

法一:

#include<stdio.h>
#include<string.h>
int s[110][110], a[110], b[110], vis[110];

int main()
{
    int n, i, j;
    scanf("%d", &n);
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            scanf("%d", &s[i][j]);
        }
    }
    memset(vis,0,sizeof(vis));
    memset(a,0,sizeof(a));
    for(int i=0;i<n;i++)
    {
        a[i]=i;
    }
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            if(s[i][j]==1)
            {
                vis[i]=1;
            }
            else if(s[i][j]==2)
            {
                vis[j]=1;
            }
            else if(s[i][j]==3)
            {
                vis[i]=vis[j]=1;
            }
        }
    }
    int t=0, sum=0;
    for(int i=0;i<n;i++)
    {
        if(vis[i]==0)
        {
            b[t++]=a[i];
            sum++;
        }
    }
    printf("%d\n", sum);
    if(sum!=0)
    {
        for(int i=0;i<t;i++)
        {
            printf("%d", b[i]+1);
            if(i<t-1)
                printf(" ");
        }
    }
    return 0;
}

 

法二:

#include<stdio.h>
int main()
{
    int n;
    int s[110][110];
    scanf("%d", &n);
    for(int i=0; i<n; i++)
    {
        for(int j=0; j<n; j++)
        {
            scanf("%d", &s[i][j]);
        }
    }
    int f;
    int a[110], t=0, sum=0;
    for(int i=0; i<n; i++)
    {
        f=1;
        for(int j=0; j<n; j++)
        {
            if(s[i][j]==1 || s[i][j]==3)
            {
                f=0;
                break;
            }
        }
        if(f==1)
        {

            a[t++]=i+1;//

            sum++;
        }
    }
    printf("%d\n", sum);
    if(sum!=0)
    {
        for(int i=0; i<t; i++)
        {
            printf("%d", a[i]);
            if(i<t-1)
                printf(" ");
        }
    }
    return 0;
}

 

ICS v9.5 OverbyteIcsWSocket.pas 整体架构分析 核心架构:OverbyteIcsWSocket.pas 是 Internet Component Suite (ICS) 的基础网络组件单元,提供跨平台 Winsock API 封装,支持TCP/UDP 客户端/服务器,DNS 解析和Raw Socket。在 v9.5 中,SSL/TLS 代码已分离至 OverbyteIcsSslBase.pas 等单元,使核心单元更精简,专注于非加密 socket 操作。 阅读详情

相关推荐

SPSS27 paired t-test 中的Cohen’s D – Effect Size for T-Test

两组数据是相关的且是连续的。

moonlightpeng的博客 910

Toy Cars

Description Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph. T...

无限迭代中...... 1021

从零到一:如何用YOLOv8和PyQt5打造你的第一个花卉识别桌面应用

本文详细介绍了如何使用YOLOv8和PyQt5从零开始构建一个花卉识别桌面应用。涵盖环境搭建、数据准备、模型训练、界面设计、模型集成与性能优化等全流程,帮助开发者快速掌握深度学习目标识别技术的实际应用。

weixin_29048775的博客 454

每日一练习——车辆碰撞选好车问题

Description Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph. There are n toy cars. Each pair collides. The result of

Koalallll的博客 256

了解随机振动疲劳分析中 Ansys nCode DesignLife 的平均应力校正

通过选择静态环境,我们可以将其结果视为疲劳计算的平均应力,如图 3 所示,因此从静态偏移载荷工况中提取的平均应力用于转移预测雨流计数中所有循环的平均值。您可以通过观看下面的教学视频获得宝贵的见解,该视频将指导您完成利用 Ansys nCode DesignLife 分析平均应力对随机振动载荷下结构的影响的过程。它基于 R 比率或平均应力水平。另一方面,平均应力校正可以帮助消除平均应力的负面影响,提高结果的保真度。Ansys nCode 提供先进的平均应力校正技术,使工程师能够考虑平均应力对疲劳寿命的影响。

jkh920184196的博客 1519

用STM32的SPI接口读取MT6835磁编码器,手把手教你避开数据读取的坑

本文详细介绍了如何使用STM32的SPI接口读取MT6835磁编码器,并提供了21个实战细节与避坑指南。从硬件连接、SPI配置到数据解析和实时调试,全面解析了读取位置信息过程中的常见问题及解决方案,帮助工程师在工业控制、伺服电机等场景中高效应用AMR技术。

weixin_30729609的博客 1441

CodeForces - 545A Toy Cars (模拟)

【题目链接】:click here~~ 【题目大意】:题意】:给一个矩阵表示i行j列某辆车的状态,统计最后没有坏的车 代码: /* * Problem: CodeForces - 545A * Running time: 15MS * Complier: G++ * Author: herongwei * Create Time: 7:47 2015/9/17 星期四 *统

herongwei 的 BLOG 2171

运动控制软件:Siemens Sinamics二次开发_(6).通信接口与协议详解

PROFIBUSPROFINETModbus TCPCANopenEtherCAT每种通信接口都有其特定的应用场景和优势。选择合适的通信接口可以显著提高系统的性能和可靠性。在选择通信协议时,需要根据具体的应用场景和需求综合考虑。每种通信协议都有其特定的优势和局限性,因此在设计运动控制系统时,应选择最适合的协议,以确保系统的性能、可靠性、成本和维护性。通过以上对比和分析,希望开发者能够更好地理解和选择适合的通信接口和协议,从而优化运动控制系统的开发和应用。

2401_87715305的博客 900

codeforces #303 div2 A. Toy Cars

A. Toy Cars time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Susie, thanks to her older brother, likes

somebody oneday 696

【电源专题】案例:对比不同电池在不同电流下的电池放电曲线

无

一点硬件 2840

BMP390L数字大气压传感器原理图设计,已量产(压力传感器)

在工业设备的室内定位、地下设施监测这类 GPS 信号盲区场景里,气压高度检测的 “靠谱程度” 直接决定了系统的可用性 —— 毕竟谁也不想在地下停车场导航时,设备把 1 楼误判成 3 楼。最近在项目里基于博世 BMP390L 做了硬件电路设计,正好聊聊这款工业级数字气压传感器的硬实力,以及原理图里的那些关键设计细节。

不脱发的程序猿 352

CodeForces - 545A Toy Cars

Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph. There are n t...

qq_26139541的博客 324

YOLOv11训练命令完全指南:从核心参数解析到高级调优实战(数据配置、epochs设定、batch-size优化与img-size调整)(二)

本文介绍了YOLOv11训练命令的完整配置与解析,提供了基础训练命令示例及参数详解。示例命令包含数据集配置(coco.yaml)、训练轮次(300)、批次大小(64)、图像尺寸(640)等核心参数,以及优化器(AdamW)、学习率(0.001)等调优选项。通过代码实现展示了训练器的初始化流程,包括参数解析、设备设置、数据加载和模型创建等关键步骤,为YOLOv11模型训练提供了实用指导。

本博客聚焦 YOLOv11 全流程落地,涵盖架构优化、数据集处理、训练技巧与多场景部署,兼及国产数据库、Java 开发与 AI 模型应用,内容兼顾理论与工程实践,为开发者提供系统干货,助力高效提升技术能力。 1094

周赛二 CodeForces 545A

Description Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph

became_a_wolf的专栏 449

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

Statistics and Machine Learning Toolbox

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

codeforces 545A Toy Cars

点击打开链接 A. Toy Cars time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little Susie, thanks to her older

zhang__liuchen的博客 268

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

CodeForces - 545A Toy Cars 水题

题目链接:点击查看 Little Susie, thanks to her older brother, likes to play with cars. Today she decided to set up a tournament between them. The process of a tournament is described in the next paragraph. T...

还我笑颜 263

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

Codeforces Round #545 (Div. 2) A、B、C、D

Codeforces Round #545 (Div. 2) A. Sushi for Two 题意 找出最长一段分别连续的1和2, 做法 统计每一段连续的数的长度,对相邻两个数去max,最后乘以二 代码 #include &amp;lt;cstdio&amp;gt; #include &amp;lt;queue&amp;gt; using namespace std; typedef long long ll; int a[1...

qq_42680479的博客 171

Codeforces Round #545 (Div. 2) A Sushi for Two,B Circus,C. Skyscrapers

这次div2好难。。打完看介绍才发现不对劲。。 Codeforces Round #545 (Div. 2) A题 题意 给n个数字,这些数字非1即2,要求找出一段连续的长度为len的区间,前len/2为1(或者2),后len/2为2(或者1),输出符合的len的最大值 思路 记录连续相同的数字的长度,比如 2 2 2 1 1 2 2,记录为 3 2 2,然后在两两匹配的最小值中找最大的,就...

低级算法工程师w 354

【Codeforces Round #545 (Div. 2)】 A B C D

这场失策的地方是 当时C过的人比B多 但是自己还在肝B 使得D差几分钟就能出 D(赛后一遍过) A 题意 1代表一种菜 2 代表另一个菜 问你偶数区间一分为二 两边各是一种菜 区间最长为 我们可以找到第一个右边不等于左边的菜进行左右枚举即可 #include &lt;cstdio&gt; #include &lt;cstring&gt; #include &lt;iostream&gt;...

我是谁 --- 卡比兽 135

Codeforces Round #545 Div1 题解

Codeforces Round #545 Div1 题解 来写题解啦QwQ 本来想上红的,结果没做出D。。。。 A. Skyscrapers CF1137A 题意 给定一个\(n*m\)的网格,每个格子里都有一个数,对于任意一行和任意一列,要求把这\(n+m-1\)个数重新用正整数编号,并且对于这一行,数与数之间的大小关系不变,对于这一列同理。求出任意一行和任意一列编号使用的最大编号的最小值。 ...

weixin_30551947的博客 174

Codeforces Round 545 (Div. 2) A. Sushi for Two

观察到区间可以分成两类,111…,并且要找的子区间就由两个这样的不同区间组成,所以说原本的数组就可以转换为一个新数组,新数组每个元素记录着每个对应区间的长度,然后可以遍历这个数组,从每两个相邻区间内找出最长的。找子区间长度的我先想到滑动窗口,然而不是所有子区间都符合条件,滑动窗口是难以对它们进行判断的(就像找最长回文子串)。

puzhaoyu的博客 370

Codeforces Round #545 (Div. 2)A. Sushi for Two(思维)

题目链接:http://codeforces.com/contest/1138/problem/A 题意:给你一个由1和2组成的数组,让你找出最长的连续1和2,也就是12,1122,111222这种。 思路:求出连续1和2的个数,然后取最小值更新ans即可。 #include&lt;bits/stdc++.h&gt; using namespace std; const int MAXN ...

sugarbliss 689

Codeforces Round #545 (Div. 2) D. Camp Schedule(A,B,C,D)

题目链接:http://codeforces.com/contest/1138/problem 第一题(暴力): #include&lt;bits/stdc++.h&gt; using namespace std; #define debug puts("YES"); #define rep(x,y,z) for(int (x)=(y);(x)&lt;(z);(x)++) #define ...

满月照亮的路 233

Codeforces Round #545 (Div. 2)A B C D前四题题解

太垃圾了,只做得来,前四题,比赛时打得更菜 A. Sushi for Two 本场比赛最良心的题 题意:给你一串1和2组成的数字,要求你求一个最大串的长度,这个最大串必须是1和2的数量相等,并且只能一边是1一边是2,既1和2不能交叉。做法直接把1和2 的数量压缩了,然后直接遍历找到最大值 #include&lt;bits/stdc++.h&gt; using namespace std;...

KXL5180的博客 205

Codeforces Round #303 (Div. 2)

A.Toy Cars 原题:http://codeforces.com/contest/545/problem/A 题意: 有n辆车,给出n*n的矩阵; a[i][j] = 1表示第i辆车坏, = 2表示第j辆车坏,  = 3表示第i, j辆车都坏; 问好的车有几辆; #include #include int n; int arr[110][110], ans[110]; b

吧唧吧唧 496

Codeforces Round #303 (Div. 2) A B C D

题目链接:http://codeforces.com/contest/545A:水 代码:#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <string> #include <queue> #include <set>using namespace std;int n, a

mfcheer 135
上一篇: 图结构练习——最小生成树
下一篇: A. Toy Cars
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值