Codeforces Round #303 A. Toy Cars

Unity Android构建报错:compileSdk 35兼容性五层定位法 Android构建中的compileSdk是编译时API目标版本,其升级并非孤立操作,而是触发JDK、Android Gradle Plugin(AGP)、NDK、targetSdk与Unity引擎版本之间强耦合校验的起点。当出现'using a newer Android Gradle plugin to use compileSdk = 35'类报错,本质是代际技术栈错配——例如AGP 7.1.3不识别compileSdk 35所需Java 17语法,或NDK 21与AGP 7.4的ABI规范冲突。该问 阅读详情

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 test(s)
Input
3
-1 0 0
0 -1 1
0 2 -1
Output
2
1 3 
Input
4
-1 3 3 3
3 -1 3 3
3 3 -1 3
3 3 3 -1
Output
0
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#define LL long long
#define INF 0x3f3f3f3f

using namespace std;

int s[110][110];
bool vis[110];
int a[110];
int main()
{
    //freopen("in.txt","r",stdin);
    int n;
    while(cin>>n)
    {
        memset(vis,false,sizeof(vis));
        int ant = 0;
        for(int i=1; i<=n; i++)
        {
            for(int j=1; j<=n; j++)
            {
                int x;
                cin>>x;
                if(x == 1)
                    vis[i] = true;
                else if(x == 3)
                    vis[i] = true;
            }
        }
        for(int i=1; i<=n; i++)
        {
            if(!vis[i])
            {
                a[ant++] = i;
            }
        }
        printf("%d\n",ant);
        for(int i=0; i<ant; i++)
        {
            cout<<a[i];
            if(i == ant-1)
                cout<<endl;
            else
                cout<<" ";
        }
    }
    return 0;
}



代谢组数据分析(二十二):代谢组原始数据Zscore标准化和主成分分析(PCA)及热图 本教程介绍了使用Z-score标准化和主成分分析(PCA)进行代谢组学数据预处理和分析的方法。代谢物原始数据具有高噪声、高维小样本、高变异性和复杂相互作用关系等特点,因此在数据分析时需注意数据质量控制、参数选择、批次效应、假阳性控制等问题。Z-score标准化通过将数据转换为均值为0、标准差为1的标准正态分布,提高了数据的可比性,减少了系统误差,并适应了统计分析方法的需求。PCA则通过降维、去相关和特征提取,帮助理解数据的结构和模式。教程还详细介绍了数据预处理步骤,包括填补缺失值、设置名称和顺序等,并提供了 阅读详情

相关推荐

迪文串口屏开发环境搭建全流程:从DGUS Tool到串口联调

串口屏作为嵌入式人机交互的核心组件,通过串口通信实现主控MCU与显示终端的指令交互。其工作原理基于变量地址映射,主控读写VP地址即可驱动屏上控件,兼具低功耗与高稳定性。在工业控制、医疗设备及智能家居面板等场景中,串口屏能显著降低开发门槛与硬件成本。迪文屏凭借DGUS Tool上位机与自定义串口协议,成为主流选择。掌握DGUS Tool版本匹配、串口驱动安装及VP地址规划,是快速搭建开发环境的关键。

weixin_33937499的博客 607

计算光刻效率革命:为什么Hopkins模型比Abbe模型快?深入解析TCC的魔力

本文深入解析了计算光刻中Hopkins模型相比Abbe模型的效率优势,重点探讨了TCC(透射交叉系数)的工程智慧。通过预计算光学系统特性并复用TCC矩阵,Hopkins模型实现了数量级的加速,特别适用于复杂照明条件下的光刻仿真。文章详细介绍了TCC的物理意义、模态分解技术以及GPU并行计算等关键加速策略,为半导体制造中的光刻工艺优化提供了实用见解。

weixin_33364627的博客 389

挖掘机工作装置UG/NX三维建模与运动仿真毕业设计指南

机械设计中的三维建模与运动仿真是现代工程领域的核心技术,通过CAD/CAE软件实现复杂机构的可视化分析与优化。其原理基于参数化设计和多体动力学,能够精确模拟机械系统的运动轨迹、受力状态和干涉情况。在工程机械领域,这项技术对于挖掘机工作装置的设计具有重要价值,能够有效评估铰点布置合理性、液压缸推力需求和运动包络范围。基于UG/NX平台,设计师可以完成从动臂、斗杆建模到四连杆机构装配的全流程,通过虚拟装配约束和运动仿真分析,验证设计方案的可行性。毕业设计实践中,学生能够掌握铰点优化、干涉检查等关键技术,为重型机

weixin_33882452的博客 290

在Jetson Orin (Arm64)上从Ubuntu22.04回退至20.04的完整指南及ROS-noetic适配方案

本文提供了在Jetson Orin (Arm64)设备上将Ubuntu 22.04系统回退至20.04 LTS版本的完整操作指南。针对机器人开发中ROS-noetic对Ubuntu20.04的官方最佳支持,详细阐述了从关键备份、软件源与APT优先级配置、系统降级执行到后续问题排查的全过程,并附带了在Arm64架构上成功安装和验证ROS-noetic的适配方案,旨在为开发者构建稳定可靠的机器人开发环境。

flower的专栏 580

判断两个多边形是否相交(java实现)

判断两个多边形是否相交 ,当前认为一个点相交也是相交,可针对凹多边形和凸边型等多复杂的多边形进行相交判断,采用java实现,因为网上java实现的比较少,所以这里写下如何实现,适用于碰撞检测,地图等等应用场景

IT_CREATE的博客 5845

contest: Codeforces Round #303 (Div. 2), problem: (A) Toy Cars

contest: Codeforces Round #303 (Div. 2), problem: (A) Toy Cars 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

更好体验→ https://x-blankspace.github.io/ 824

Go语言面试:面试中经常被问到的50个经典面试题(附参考答案)

Go语言核心知识点摘要 基础语法与数据结构 make和new区别:new分配零值内存返回指针,make初始化引用类型返回实例 Slice底层:包含指针、长度、容量的结构体,多个slice可共享底层数组 nil与空slice:nil指针为nil,空slice指针非nil但JSON编码不同 Map原理:哈希表实现,非线程安全,扩容策略影响性能 for range注意:循环变量是拷贝,map遍历无序 defer执行:LIFO顺序,函数返回前执行 Struct比较:仅当所有字段可比较时才可比较 参数传递:只有值传递

数据知道的博客 4722

MVZ2鸭子版第12天:传动力板机制拆解与锁卡破解思路

在游戏关卡设计中,特殊地块机制往往比单纯堆叠数值更能决定挑战深度。以植物大战僵尸类Mod为例,当场地引入空间位移规则时,传统塔防的“阵型固化”思路便会失效。传动力板本质上是一个状态机,它依据单位进入触发格的时间、方向与目标格占用状态,执行强制位移操作。理解它的触发条件、作用优先级与连锁反应,是从“被动挨打”转向“主动控场”的关键。这类机制在关卡设计、策略推演与Mod测试领域都具有典型研究价值。本文以MVZ2鸭子版梦境世界拓展第12天为场景,拆解传动力板的判定流程,分析锁卡现象的根因,并给出可复现的验证方法与

weixin_34321753的博客 309

YOLOv9改进策略目录 | 包含卷积、主干、检测头、注意力机制、Neck上百种创新机制

Hello,各位读者们好本专栏自开设两个月以来已经更新改进教程50余篇其中包含RepNCSPELAN4、主干、检测头、注意力机制、Neck多种结构上创新,也有损失函数和一些细节点上的创新。同时本人一些讲解视频和包含我所有创新的YOLOv9文档并不能在优快云上传(所有的创新点都经过我的测试是可用的,得到该文件之后大家可以随意组合使用),所以会建立群的形式在内上传我的文件和视频我也会在群内不定期和大家交流回答大家问题,同时定期会更新一些文章的创新点(经过我融合测试后的,先到先得)。

Snu77的博客 1万+

CGAL AlphaShape算法(自适应Alpha值,二维版本)

CGAL AlphaShape算法(自适应Alpha值,二维版本)

dayuhaitang1的博客 2324

Codeforces Round #303 (Div.2)-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

梧桐下的四叶草 363

【数据集总结】不透水面积ISA:GAIA、CLUD-Urban、GISA

【数据集总结】不透水面积ISA:GAIA、CLUD-Urban、GISA

WW、forever的博客 2158

Codeforces Round #303 (Div. 2) A. Toy Cars 水题

A. Toy Cars Time Limit: 20 SecMemory Limit: 256 MB 题目连接 http://codeforces.com/contest/545/problem/A Description Little Susie, thanks to her older brother, likes to play with cars. Today...

weixin_30237281的博客 107

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

IEM模型,地表粗糙度模拟

利用微波反演土壤水分时候,利用IEM模型可以实现对随机地表的模拟

Codeforces Round #303 (Div. 2)

一个水题+4个贪心.... Codeforces Round #303 (Div. 2) A. Toy Cars time limit per test 1 second memory limit per test 256 megabytes input standard input output st

码代码的猿猿 2395

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

【解题报告】Codeforces Round #303 (Div. 2)

简略的解题报告

TRiddle的博客 840

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

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

http://codeforces.com/contest/545好水的一场div2. A. Toy Cars a[i][j] = 1,表示第i辆车坏掉了,=2 表示第j辆车坏掉了,=3表示i和j都坏掉了。求有几辆车是好的#include <bits/stdc++.h> #define foreach(v,i) for(__typeof((v).begin()) i=(v).begin();i!

fsdcyr 904

Codeforces Round #345 (Div. 2) C. Watchmen

题目链接:http://codeforces.com/contest/651/problem/C 题目大意:给出n个坐标,求存在(xi,yi),(xj, yj) 使|xi-xj|+|yi-yj| = sqrt((xi-xj)*(xi-xj)+(yi-yj)*(yi-yj))的组数 方法:等式两边平方,化简得只要两个点存在同一列或同一行就可以符合上述等式 #include using na

Code_KK的博客 942

Codeforces Educational Codeforces Round 8 B. New Skateboard

大致题意: 给出一串数,从中找出连续的字串,求能够整除4的字串的个数 方法: 从后往前遍历 如果一个数的后两位能被4整除,则这个数就是4的倍数 #include using namespace std; char str[10000000]; int main() { while(~scanf("%s",str)) { long long ant

Code_KK的博客 762

Codeforces Round #343 (Div. 2) Far Relative’s Birthday Cake

大致题意: 给出一个n*n的矩阵,求有多少对C在同一行或同一列 方法: 遍历每一行,求出每一行中C的数量,然后利用组合数学的排列组合求出方案数 遍历每一列,同上 。。。。。 A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 mega

Code_KK的博客 757

Codeforces Round #343 (Div. 2) B. Far Relative’s Problem

B. Far Relative’s Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Famil Door wants to celebrate his

Code_KK的博客 732

CodeForces Experimental Educational Round: VolBIT Formulas Blitz A. Again Twenty Five!

A. Again Twenty Five! time limit per test 0.5 seconds memory limit per test 64 megabytes input standard input output standard output The HR manager was disappointed agai

Code_KK的博客 688

Codeforces Educational Codeforces Round 8 A. Tennis Tournament

大致题意: 网球比赛,n个参赛者,每场比赛每位选手b瓶水+裁判1瓶水,全部比赛每个参赛者p条毛巾 每一轮比赛有2^k个人参加比赛(k为2^k 求所有比赛完成后所需要的水的数量和毛巾的数量

Code_KK的博客 623

Codeforces Experimental Educational Round: VolBIT Formulas Blitz D. Hexagons!

D. Hexagons! time limit per test 0.5 seconds memory limit per test 64 megabytes input standard input output standard output After a probationary period in the game devel

Code_KK的博客 595

CodeForces 445B DZY Loves Chemistry(并查集)

DZY loves chemistry, and he enjoys mixing chemicals. DZY has n chemicals, and m pairs of them will react. He wants to pour these chemicals into a test tube, and he needs to pour them in one by one,

Code_KK的博客 532
上一篇: BestCoder Round #50 (div.2) 1003
下一篇: Codeforces Round #303 Equidistant String
__铭
博客等级 码龄12年 35粉丝 274原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值