Submission #1194521

#TimeUsernameProblemLanguageResultExecution timeMemory
1194521hengliaoMagic Show (APIO24_show)C++20
5 / 100
2 ms380 KiB
#include "Alice.h"
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define vll vector<ll>
#define pll pair<ll, ll>

typedef long long ll;

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

vector<pair<int,int>> Alice(){
    ll n=5000;
    ll tar=setN(n);
    vector<pair<int, int>> re;
    if(tar<=n){
        
        for(ll i=1;i<=n;i++){
            if(i==tar) continue;
            re.pb({i, tar});
        }

    }
    return re;
}
#include "Bob.h"
#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pb push_back
#define vll vector<ll>
#define pll pair<ll, ll>

typedef long long ll;
// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

long long Bob(std::vector<std::pair<int,int>> V){
	// add your code here
    ll n=5000;
    vll cnt(n+1);
    for(auto &[x, y]:V){
        cnt[x]++;
        cnt[y]++;
    }

    for(ll i=1;i<=n;i++){
        if(cnt[i]>1){
            return i;
        }
    }
}

Compilation message (stderr)

# 2번째 컴파일 단계

Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...