#include "Alice.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define pb push_back
#define ar array
#define nl '\n'
// 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().
std::vector<std::pair<int,int>> Alice(){
vector<pair<int, int>> edges;
int X = setN(5000);
for(int i = 1; i <= 5000; i++) {
if(i != X) edges.pb({X, i});
}
return edges;
}
#include "Bob.h"
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define pb push_back
#define ar array
#define nl '\n'
// 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){
vector<int> cnt(5001);
for(int i = 0; i < (int)V.size(); i++) {
auto [u, v] = V[i];
for(auto j : {u, v}) {
cnt[j]++;
if(cnt[j] == 2) return j;
}
}
}
Compilation message (stderr)
# 2번째 컴파일 단계
Bob.cpp: In function 'long long int Bob(std::vector<std::pair<int, int> >)':
Bob.cpp:23:1: warning: control reaches end of non-void function [-Wreturn-type]
23 | }
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |