当前位置:网站首页>~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
边栏推荐
猜你喜欢

First knowledge of opencv4.x --- image histogram matching

【机器翻译】SCONES——用多标签任务做机器翻译

Swift creates weather app

Matlab drawing | some common settings of axis

Development history of convolutional neural network (part)

【深度学习】卷积神经网络

关于MLOps中的数据工程,你一定要知道的.......

MLX90640 红外热成像仪测温模块开发笔记(四)

初识Opencv4.X----图像直方图匹配

Hyperautomation for the enhancement of automation in industries 论文翻译
随机推荐
Creation of adjacency matrix of undirected connected graph output breadth depth traversal
How to import a large amount of data in MATLAB
CCF 201503-4 网络延时
CCF 201604-2 俄罗斯方块
Defect detection network -- hybrid supervision (kolektor defect data set reproduction)
Mixed supervision for surface defect detection: from weakly to fully supervised learning
服务器cuda toolkit多版本切换
单目深度估计自监督模型Featdepth解读(上)——论文理解和核心源码分析
ADC介绍
Customize the view to realize the background of redeeming lottery tickets [elementary]
¥ 1-3 SWUST OJ 942: reverse sequence table
Temperature, humidity and light intensity acquisition based on smart cloud platform
【RNN】剖析RNN 之 从RNN-(Simple|LSTM) 到 序列生成 再到 seq2seq框架(encoder-decoder,或称为seq2seq)
从鱼眼到环视到多任务王炸——盘点Valeo视觉深度估计经典文章(从FisheyeDistanceNet到OmniDet)(下)
【数据挖掘】第三章 数据分析基础
Creation of adjacency table of undirected connected graph output breadth depth traversal
pytorch使用tensorboard实现可视化总结
AI模型风险评估 第1部分:动机
MinkowskiEngine 安装
从Anaconda到TensorFlow到Jupyter一路踩坑一路填平