Skip to content

Commit

Permalink
t_task
Browse files Browse the repository at this point in the history
  • Loading branch information
hus-king committed Dec 5, 2024
1 parent e8d50e1 commit bb125ef
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"args": [],
"stopAtEntry": false,
"externalConsole": false,
"cwd": "c:/Users/HSQ/Desktop/LuoGuA~Z",
"program": "c:/Users/HSQ/Desktop/LuoGuA~Z/output/${fileBasenameNoExtension}.exe",
"cwd": "c:/Users/HSQ/Desktop/LuoGu",
"program": "c:/Users/HSQ/Desktop/LuoGu/output/${fileBasenameNoExtension}.exe",
"MIMode": "gdb",
"miDebuggerPath": "gdb",
"setupCommands": [
Expand Down
Binary file added output/t.exe
Binary file not shown.
40 changes: 40 additions & 0 deletions t.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include <stdio.h>
//0表示未提及
//1表示为是这一行的前置任务
//2表示为需要完成
#define MAX 20
int main(){
int n;
scanf("%d", &n);
getchar();
int task[MAX][MAX]={0};
int make[MAX]={0};
int k[MAX]={0};
for(int i = 0; i < n; i++){
scanf("%d", &k[i]);
for(int j = 0; j < k[i]; j++){
int m;
scanf("%d", &m);
task[i][m-1]=1;
}
getchar();
}
make[0]=1;
for(int i = 0,k=0; k < 2*n; i++){
i=i%n;
if(make[i]==1){
for(int j=0;j<n;j++){
if(task[i][j]==1)
make[j]=1;
}
}
k++;
}
int flag=0;
for(int i = 0; i < n; i++){
if(make[i]==1){
flag++;
}
}
printf("%d", flag);
}

0 comments on commit bb125ef

Please sign in to comment.