QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#97360#5672. Connectivity Problemaguo123Compile Error//C++11692b2023-04-16 17:55:542023-04-16 17:55:57

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-16 17:55:57]
  • 评测
  • [2023-04-16 17:55:54]
  • 提交

answer

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cstring>
#include<map>
using namespace std;
typedef long long LL;
const int N=2e5+10;
int n,T;
int ans;
int p[1100];
int find(int x){
    if(p[x]!=x)p[x]=find(p[x]);
   retunr p[x];
}
int main()
{
    T=1;
    while(T--){
        ans=0;
        cin>>n;
        for(int i=0;i<=1000;i++)p[i]=i;
        for(int i=1;i<=n;i++){
            int a,b;
            cin>>a>>b;
            int pa=find(a),pb=find(b);
            if(pa!=pb){
                puts("N");
                p[pa]=pb;
            }else puts("Y");
        }
       // cout<<ans<<endl;
    }

    return 0;
}

Details

answer.code: In function ‘int find(int)’:
answer.code:15:4: error: ‘retunr’ was not declared in this scope
   15 |    retunr p[x];
      |    ^~~~~~
answer.code:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
   16 | }
      | ^