QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#744347#7786. Graft and Transplantyld#WA 0ms3612kbC++20539b2024-11-13 21:36:362024-11-13 21:36:41

Judging History

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

  • [2024-11-13 21:36:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3612kb
  • [2024-11-13 21:36:36]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;
void solve()
{
    int n;
    cin>>n;
    vector<int> deg(n+1);
    for(int i=1;i<=n;i++)
    {
        int u,v;
        cin>>u>>v;
        deg[v]++;
        deg[u]++;
    }
    int flag=0;
    for(int i=1;i<=n;i++)
    {
        if(deg[i]==(i-1)*2) flag=1;
    }
    if(flag) cout<<"Bob\n";
    else cout<<"Alice\n";
}
signed main()
{
    cin.tie(0)->sync_with_stdio(0);
    int t=1;
    while(t--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3612kb

input:

4
1 2
2 3
3 4

output:

Bob

result:

wrong answer 1st words differ - expected: 'Alice', found: 'Bob'