QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#666857#7786. Graft and Transplantnjupt_zyCompile Error//C++17737b2024-10-22 20:13:502024-10-22 20:14:07

Judging History

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

  • [2024-10-22 20:14:07]
  • 评测
  • [2024-10-22 20:13:50]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
template<typename T>
void read(T &t){
    t=0;int flag=1;char c=getchar();
    while(c<'0'||c>'9'){if(c=='-')flag=-1;c=getchar();}
    while(c>='0'&&c<='9'){t=(t<<3)+(t<<1)+c-'0';c=getchar();}
    t=t*flag;
}
const int N=1e5+5;
vector<int> p[N];
int du[N];
int main(){
    int n;cin>>n;
    for(int i=1;i<n;i++){
        int x,y;cin>>x>>y;
        p[x].push_back(y);
        p[y].push_back(x);
        du[x]++;du[y]++;
    }
    if(n==2){cout<<"Bob"<<endl;retutn 0;}
    int ans=0;
    for(int i=1;i<=n;i++){
        if(du[i]!=1)ans++;
    }
    if(ans%2==0)cout<<"Alice"<<endl;
    else cout<<"Bob"<<endl;
    return 0;
}

Details

answer.code: In function ‘int main()’:
answer.code:23:32: error: ‘retutn’ was not declared in this scope
   23 |     if(n==2){cout<<"Bob"<<endl;retutn 0;}
      |                                ^~~~~~