foo.cc:40:5: error: redefinition of 'int n'
40 | int n,x,y,num;
| ^
foo.cc:3:5: note: 'int n' previously declared here
3 | int n,x,y;
| ^
foo.cc:40:7: error: redefinition of 'int x'
40 | int n,x,y,num;
| ^
foo.cc:3:7: note: 'int x' previously declared here
3 | int n,x,y;
| ^
foo.cc:40:9: error: redefinition of 'int y'
40 | int n,x,y,num;
| ^
foo.cc:3:9: note: 'int y' previously declared here
3 | int n,x,y;
| ^
foo.cc:41:15: error: redefinition of 'int s [105]'
41 | int head[105],s[105],vis[105];
| ^
foo.cc:5:5: note: 'int s [105]' previously declared here
5 | int s[105],d[105];
| ^
foo.cc:45:3: error: conflicting declaration 'node a [10005]'
45 | } a[10005];
| ^
foo.cc:4:5: note: previous declaration as 'int a [105][105]'
4 | int a[105][105],h[10005];
| ^
foo.cc: In function 'void work(int, int)':
foo.cc:48:12: error: request for member 'next' in 'a[num]', which is of non-class type 'int [105]'
48 | a[num].next=head[from];
| ^~~~
foo.cc:49:12: error: request for member 'u' in 'a[num]', which is of non-class type 'int [105]'
49 | a[num].u=from;
| ^
foo.cc:50:12: error: request for member 'v' in 'a[num]', which is of non-class type 'int [105]'
50 | a[num].v=to;
| ^
foo.cc: At global scope:
foo.cc:53:5: error: redefinition of 'int main()'
53 | int main() {
| ^~~~
foo.cc:6:5: note: 'int main()' previously defined here
6 | int main() {
| ^~~~
foo.cc: In function 'int main()':
foo.cc:74:38: error: request for member 'next' in 'a[i]', which is of non-class type 'int [105]'
74 | for(int i=head[h]; i; i=a[i].next) {
| ^~~~
foo.cc:75:26: error: request for member 'v' in 'a[i]', which is of non-class type 'int [105]'
75 | if(!vis[a[i].v]) {
| ^
foo.cc:76:24: error: request for member 'v' in 'a[i]', which is of non-class type 'int [105]'
76 | s[a[i].v]=s[h]+1;
| ^
foo.cc:77:26: error: request for member 'v' in 'a[i]', which is of non-class type 'int [105]'
77 | vis[a[i].v]=1;
| ^
foo.cc:78:29: error: request for member 'v' in 'a[i]', which is of non-class type 'int [105]'
78 | q.push(a[i].v);
| ^
foo.cc:79:25: error: request for member 'v' in 'a[i]', which is of non-class type 'int [105]'
79 | if(a[i].v==y) {
| ^
foo.cc: In function 'int main()':
foo.cc:7:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
7 | freopen("relationship.in","r",stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc:8:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
8 | freopen("relationship.out","w",stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
foo.cc: In function 'int main()':
foo.cc:56:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
56 | scanf("%d %d %d",&n,&x,&y);
| ~~~~~^~~~~~~~~~~~~~~~~~~~~
foo.cc:60:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
60 | scanf("%d",&t);
| ~~~~~^~~~~~~~~
正在同步测试数据,请稍后
Found 10 testcases.
[Hydro](https://hydro.ac)提供评测服务