当前位置:网站首页>~2 CCF 2022-03-1 uninitialized warning
~2 CCF 2022-03-1 uninitialized warning
2022-07-25 09:54:00 【Ye Xiaobai】
Warning not initialized
Title Description

Input

Output

The sample input
10 7
1 2
3 3
3 0
3 3
6 2
2 1
8 2
Sample output
3
Source code
#include <iostream>
#include <vector>
using namespace std;
int main() {
int n , k ;
cin >> n >> k;
int res=0;
int temp1=0;
int temp2=0;
double *arr=new double [n];
for (int i = 0; i <n ; i++) {
arr[i]= 0;
}
arr[0]= 1;
for (int i = 0; i < k; i++) {
cin>>temp1>>temp2;
if (!arr[temp2]){
res++;
arr[temp1]= 1;
} else{
arr[temp1]= 1;
}
}
cout<<res<<endl;
delete []arr;
return 0;
}
The subtasks

About this problem
use bool Array Some data fail , So replace it in the back double It's shaped
边栏推荐
- Preliminary understanding and implementation of wechat applet bottom navigation bar
- ADC简介
- 低功耗和UPF介绍
- Learning new technology language process
- 目标检测与分割之MaskRCNN代码结构流程全面梳理+总结
- 十进制整数转换为其它进制的数
- Get to know opencv4.x for the first time --- add Gaussian noise to the image
- Minkowskiengine installation
- 手持振弦VH501TC采集仪传感器的连接与数据读取
- Temperature, humidity and light intensity acquisition based on smart cloud platform
猜你喜欢

从鱼眼到环视到多任务王炸——盘点Valeo视觉深度估计经典文章(从FisheyeDistanceNet到OmniDet)(上)

Kotlin collaboration: foundation and use of collaboration

CCF 201512-4 送货

CCF 201604-2 俄罗斯方块

Get to know opencv4.x for the first time --- add salt and pepper noise to the image

初识Opencv4.X----ROI截取

ARM预备知识

【深度学习】自编码器

Customize dialog to realize the pop-up box of privacy clause statement imitating Netease cloud music

初识Opencv4.X----图像直方图匹配
随机推荐
Android & kotlin: puzzle solution
低功耗和UPF介绍
Minkowskiengine installation
数字IC设计SOC入门进阶
深度估计自监督模型monodepth2论文总结和源码分析【理论部分】
Evolution based on packnet -- review of depth estimation articles of Toyota Research Institute (TRI) (Part 2)
Sort out personal technology selection in 2022
Gartner 2022年顶尖科技趋势之超级自动化
ARM预备知识
ARMV8 datasheet学习
matlab的find()函数的一些用法(快速查找符合条件的值)
Temperature, humidity and light intensity acquisition based on smart cloud platform
无向连通图邻接矩阵的创建输出广度深度遍历
降低程序空间复杂度的一些技巧
【数据挖掘】第三章 数据分析基础
CCF 201604-2 俄罗斯方块
FLASH read / write operation and flash upload file of esp8266
【数据挖掘】第二章 认识数据
CCF 201509-4 高速公路
[deep learning] convolutional neural network